本文整理汇总了C#中IPacketMsg类的典型用法代码示例。如果您正苦于以下问题:C# IPacketMsg类的具体用法?C# IPacketMsg怎么用?C# IPacketMsg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPacketMsg类属于命名空间,在下文中一共展示了IPacketMsg类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleNumberOfPlayersResponse
void HandleNumberOfPlayersResponse( IPacketMsg packetMsg )
{
var msg = new ClientMsg<MsgClientGetNumberOfCurrentPlayersResponse>( packetMsg );
var callback = new NumberOfPlayersCallback( msg.Header.TargetJobID, msg.Body );
Client.PostCallback( callback );
}
示例2: HandleClientRequestFreeLicenseResponse
private static void HandleClientRequestFreeLicenseResponse(IPacketMsg packetMsg)
{
var resp = new ClientMsgProtobuf<CMsgClientRequestFreeLicenseResponse>(packetMsg);
JobAction job;
JobManager.TryRemoveJob(packetMsg.TargetJobID, out job);
var packageIDs = resp.Body.granted_packageids;
var appIDs = resp.Body.granted_appids;
Log.WriteDebug("FreeLicense", "Received free license: {0} ({1} apps, {2} packages)", (EResult)resp.Body.eresult, appIDs.Count, packageIDs.Count);
if (packageIDs.Count > 0)
{
Steam.Instance.Apps.PICSGetProductInfo(Enumerable.Empty<uint>(), packageIDs);
if (packageIDs.Count > 5)
{
IRC.Instance.SendMain("{0}{1}{2} new free licenses granted", Colors.OLIVE, packageIDs.Count, Colors.NORMAL);
}
else
{
foreach (var package in packageIDs)
{
IRC.Instance.SendMain("New free license granted: {0}{1}{2} -{3} {4}", Colors.OLIVE, Steam.GetPackageName(package), Colors.NORMAL, Colors.DARKBLUE, SteamDB.GetPackageURL(package));
}
}
}
if (appIDs.Count > 0)
{
Steam.Instance.Apps.PICSGetAccessTokens(appIDs, Enumerable.Empty<uint>());
}
}
示例3: HandleMsg
public override void HandleMsg(IPacketMsg packetMsg) {
if (packetMsg == null) {
ArchiLogger.LogNullError(nameof(packetMsg));
return;
}
switch (packetMsg.MsgType) {
case EMsg.ClientFSOfflineMessageNotification:
HandleFSOfflineMessageNotification(packetMsg);
break;
case EMsg.ClientItemAnnouncements:
HandleItemAnnouncements(packetMsg);
break;
case EMsg.ClientPlayingSessionState:
HandlePlayingSessionState(packetMsg);
break;
case EMsg.ClientPurchaseResponse:
HandlePurchaseResponse(packetMsg);
break;
case EMsg.ClientRedeemGuestPassResponse:
HandleRedeemGuestPassResponse(packetMsg);
break;
case EMsg.ClientSharedLibraryLockStatus:
HandleSharedLibraryLockStatus(packetMsg);
break;
case EMsg.ClientUserNotifications:
HandleUserNotifications(packetMsg);
break;
}
}
示例4: HandleInitiateTradeResult
void HandleInitiateTradeResult(IPacketMsg packetMsg)
{
var msg = new ClientMsgProtobuf<CMsgTrading_InitiateTradeResult>(packetMsg);
var callback = new TradeRequestCallback();
callback.Response = msg.Body.response;
callback.TradeRequestId = msg.Body.trade_request_id;
callback.Other = msg.Body.other_steamid;
if (callback.Response == 0)
callback.Status = ETradeStatus.Accepted;
else if (callback.Response == 1)
callback.Status = ETradeStatus.Rejected;
else if (callback.Response == 6)
callback.Status = ETradeStatus.Unknown;
else if (callback.Response == 7)
callback.Status = ETradeStatus.Cancelled;
else if (callback.Response == 8)
callback.Status = ETradeStatus.Unknown;
else if (callback.Response == 11)
callback.Status = ETradeStatus.InTrade;
else if (callback.Response == 12)
callback.Status = ETradeStatus.Unknown2;
else if (callback.Response == 13)
callback.Status = ETradeStatus.TimedOut;
else
throw new Exception("Unknown trade status: "+callback.Status);
this.Client.PostCallback(callback);
}
示例5: HandleFromGC
void HandleFromGC( IPacketMsg packetMsg )
{
var msg = new ClientMsgProtobuf<CMsgGCClient>( packetMsg );
var callback = new MessageCallback( msg.Body );
this.Client.PostCallback( callback );
}
示例6: HandleResponse
void HandleResponse(IPacketMsg packetMsg)
{
var response = new ClientMsgProtobuf<CMsgClientPlayerNicknameList>(packetMsg);
var nicknames = response.Body.nicknames;
Client.PostCallback(new ClientPlayerNicknameListCallback(nicknames));
}
示例7: HandleMsg
public override void HandleMsg(IPacketMsg packetMsg)
{
if (packetMsg.MsgType == EMsg.ClientRequestFreeLicenseResponse)
{
HandleClientRequestFreeLicenseResponse(packetMsg);
}
}
示例8: HandleWebAPINonce
void HandleWebAPINonce(IPacketMsg packetMsg)
{
var nonceMsg = new ClientMsgProtobuf<CMsgClientRequestWebAPIAuthenticateUserNonceResponse>(packetMsg);
var callback = new NonceCallback(nonceMsg.Body);
Client.PostCallback(callback);
}
示例9: HandleClientUserNotifications
private void HandleClientUserNotifications(IPacketMsg packetMsg)
{
var clientUserNotificationResponse = new ClientMsgProtobuf<CMsgClientUserNotifications>(packetMsg);
CMsgClientUserNotifications result = clientUserNotificationResponse.Body;
Client.PostCallback(new NotificationCallback(result));
}
示例10: HandleClientCommentNotifications
private void HandleClientCommentNotifications(IPacketMsg packetMsg)
{
var clientCommentNotifications = new ClientMsgProtobuf<CMsgClientCommentNotifications>(packetMsg);
CMsgClientCommentNotifications result = clientCommentNotifications.Body;
Client.PostCallback(new CommentNotificationCallback(result));
}
示例11: HandleAccountDataResponse
void HandleAccountDataResponse( IPacketMsg packetMsg )
{
var msg = new ClientMsgProtobuf<CMsgClientRequestAccountDataResponse>( packetMsg );
var callback = new ResponseCallback( msg.TargetJobID, msg.Body );
Client.PostCallback( callback );
}
示例12: HandleSteamLevelsResponse
void HandleSteamLevelsResponse( IPacketMsg msg )
{
var clientMsg = new ClientMsgProtobuf<CMsgClientFSGetFriendsSteamLevelsResponse>( msg );
var callback = new SteamLevelsCallback( clientMsg.TargetJobID, clientMsg.Body );
Client.PostCallback( callback );
}
示例13: HandleUGCDetailsResponse
void HandleUGCDetailsResponse( IPacketMsg packetMsg )
{
var infoResponse = new ClientMsgProtobuf<CMsgClientUFSGetUGCDetailsResponse>( packetMsg );
var innerCallback = new UGCDetailsCallback( infoResponse.Body );
var callback = new SteamClient.JobCallback<UGCDetailsCallback>( infoResponse.TargetJobID, innerCallback );
this.Client.PostCallback( callback );
}
示例14: HandleMsg
/// <summary>
/// Handles a client message. This should not be called directly.
/// </summary>
/// <param name="packetMsg">The packet message that contains the data.</param>
public override void HandleMsg( IPacketMsg packetMsg )
{
switch ( packetMsg.MsgType )
{
case EMsg.ClientUFSGetUGCDetailsResponse:
HandleUGCDetailsResponse( packetMsg );
break;
}
}
示例15: HandleMsg
public override void HandleMsg( IPacketMsg packetMsg )
{
switch ( packetMsg.MsgType )
{
case EMsg.ClientRequestAccountDataResponse:
HandleAccountDataResponse( packetMsg );
break;
}
}