本文整理汇总了C#中ClientMsgProtobuf类的典型用法代码示例。如果您正苦于以下问题:C# ClientMsgProtobuf类的具体用法?C# ClientMsgProtobuf怎么用?C# ClientMsgProtobuf使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClientMsgProtobuf类属于命名空间,在下文中一共展示了ClientMsgProtobuf类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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>());
}
}
示例2: AcceptNewLoginKey
/// <summary>
/// Accepts the new Login Key provided by a <see cref="LoginKeyCallback"/>.
/// </summary>
/// <param name="callback">The callback containing the new Login Key.</param>
public void AcceptNewLoginKey( LoginKeyCallback callback )
{
var acceptance = new ClientMsgProtobuf<CMsgClientNewLoginKeyAccepted>( EMsg.ClientNewLoginKeyAccepted );
acceptance.Body.unique_id = callback.UniqueID;
this.Client.Send( acceptance );
}
示例3: 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);
}
示例4: RequestCommentNotifications
/// <summary>
/// Request to see if the client user has any comment notifications
/// </summary>
public void RequestCommentNotifications()
{
var clientRequestCommentNotifications =
new ClientMsgProtobuf<CMsgClientRequestCommentNotifications>(EMsg.ClientRequestCommentNotifications);
Client.Send(clientRequestCommentNotifications);
}
示例5: LogOn
/// <summary>
/// Logs onto the Steam network as a persistent game server.
/// The client should already have been connected at this point.
/// Results are return in a <see cref="SteamUser.LoggedOnCallback"/>.
/// </summary>
/// <param name="details">The details to use for logging on.</param>
/// <exception cref="System.ArgumentNullException">No logon details were provided.</exception>
/// <exception cref="System.ArgumentException">Username or password are not set within <paramref name="details"/>.</exception>
public void LogOn( LogOnDetails details )
{
if ( details == null )
{
throw new ArgumentNullException( "details" );
}
if ( string.IsNullOrEmpty( details.Username ) || string.IsNullOrEmpty( details.Password ) )
{
throw new ArgumentException( "LogOn requires a username and password to be set in 'details'." );
}
var logon = new ClientMsgProtobuf<CMsgClientLogon>( EMsg.ClientLogon );
SteamID gsId = new SteamID( 0, 0, Client.ConnectedUniverse, EAccountType.GameServer );
logon.ProtoHeader.client_sessionid = 0;
logon.ProtoHeader.steamid = gsId.ConvertToUInt64();
uint localIp = NetHelpers.GetIPAddress( this.Client.LocalIP );
logon.Body.obfustucated_private_ip = localIp ^ MsgClientLogon.ObfuscationMask;
logon.Body.protocol_version = MsgClientLogon.CurrentProtocol;
logon.Body.client_os_type = ( uint )Utils.GetOSType();
logon.Body.game_server_app_id = ( int )details.AppID;
logon.Body.machine_id = Utils.GenerateMachineID();
logon.Body.account_name = details.Username;
logon.Body.password = details.Password;
this.Client.Send( logon );
}
示例6: HandleFromGC
void HandleFromGC( IPacketMsg packetMsg )
{
var msg = new ClientMsgProtobuf<CMsgGCClient>( packetMsg );
var callback = new MessageCallback( msg.Body );
this.Client.PostCallback( callback );
}
示例7: HandleResponse
void HandleResponse(IPacketMsg packetMsg)
{
var response = new ClientMsgProtobuf<CMsgClientPlayerNicknameList>(packetMsg);
var nicknames = response.Body.nicknames;
Client.PostCallback(new ClientPlayerNicknameListCallback(nicknames));
}
示例8: HandleWebAPINonce
void HandleWebAPINonce(IPacketMsg packetMsg)
{
var nonceMsg = new ClientMsgProtobuf<CMsgClientRequestWebAPIAuthenticateUserNonceResponse>(packetMsg);
var callback = new NonceCallback(nonceMsg.Body);
Client.PostCallback(callback);
}
示例9: AddFriend
/// <summary>
/// Sends a friend request to a user.
/// </summary>
/// <param name="steamId">The SteamID of the friend to add.</param>
public void AddFriend( SteamID steamId )
{
var addFriend = new ClientMsgProtobuf<CMsgClientAddFriend>( EMsg.ClientAddFriend );
addFriend.Body.steamid_to_add = steamId;
this.Client.Send( addFriend );
}
示例10: HandleClientUserNotifications
private void HandleClientUserNotifications(IPacketMsg packetMsg)
{
var clientUserNotificationResponse = new ClientMsgProtobuf<CMsgClientUserNotifications>(packetMsg);
CMsgClientUserNotifications result = clientUserNotificationResponse.Body;
Client.PostCallback(new NotificationCallback(result));
}
示例11: HandleClientCommentNotifications
private void HandleClientCommentNotifications(IPacketMsg packetMsg)
{
var clientCommentNotifications = new ClientMsgProtobuf<CMsgClientCommentNotifications>(packetMsg);
CMsgClientCommentNotifications result = clientCommentNotifications.Body;
Client.PostCallback(new CommentNotificationCallback(result));
}
示例12: CancelPendingTrade
/// <summary>
/// Cancels a pending trade request.
/// </summary>
/// <param name="target">The target account you want to trade with.</param>
public void CancelPendingTrade(SteamID target)
{
var cancelTrade = new ClientMsgProtobuf<CMsgTrading_CancelTradeRequest>( EMsg.EconTrading_CancelTradeRequest );
cancelTrade.Body.other_steamid = target;
this.Client.Send(cancelTrade);
}
示例13: HandleAccountDataResponse
void HandleAccountDataResponse( IPacketMsg packetMsg )
{
var msg = new ClientMsgProtobuf<CMsgClientRequestAccountDataResponse>( packetMsg );
var callback = new ResponseCallback( msg.TargetJobID, msg.Body );
Client.PostCallback( callback );
}
示例14: 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 );
}
示例15: HandleSteamLevelsResponse
void HandleSteamLevelsResponse( IPacketMsg msg )
{
var clientMsg = new ClientMsgProtobuf<CMsgClientFSGetFriendsSteamLevelsResponse>( msg );
var callback = new SteamLevelsCallback( clientMsg.TargetJobID, clientMsg.Body );
Client.PostCallback( callback );
}