当前位置: 首页>>代码示例>>C#>>正文


C# ClientMsgProtobuf类代码示例

本文整理汇总了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>());
            }
        }
开发者ID:RJacksonm1,项目名称:SteamDatabaseBackend,代码行数:34,代码来源:FreeLicense.cs

示例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 );
        }
开发者ID:Zaharkov,项目名称:SteamKit,代码行数:11,代码来源:SteamUser.cs

示例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);
        }
开发者ID:ampped101,项目名称:SteamBot,代码行数:30,代码来源:SteamTrading.cs

示例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);
        }
开发者ID:Xitcklif,项目名称:SteamBot,代码行数:10,代码来源:Notifications.cs

示例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 );
        }
开发者ID:Klumb3r,项目名称:SteamKit,代码行数:41,代码来源:SteamGameServer.cs

示例6: HandleFromGC

        void HandleFromGC( IPacketMsg packetMsg )
        {
            var msg = new ClientMsgProtobuf<CMsgGCClient>( packetMsg );

            var callback = new MessageCallback( msg.Body );
            this.Client.PostCallback( callback );
        }
开发者ID:Zaharkov,项目名称:SteamKit,代码行数:7,代码来源:SteamGameCoordinator.cs

示例7: HandleResponse

        void HandleResponse(IPacketMsg packetMsg)
        {
            var response = new ClientMsgProtobuf<CMsgClientPlayerNicknameList>(packetMsg);

            var nicknames = response.Body.nicknames;
            Client.PostCallback(new ClientPlayerNicknameListCallback(nicknames));
        }
开发者ID:The-Mad-Pirate,项目名称:Mist,代码行数:7,代码来源:PlayerNicknames.cs

示例8: HandleWebAPINonce

        void HandleWebAPINonce(IPacketMsg packetMsg)
        {
            var nonceMsg = new ClientMsgProtobuf<CMsgClientRequestWebAPIAuthenticateUserNonceResponse>(packetMsg);

            var callback = new NonceCallback(nonceMsg.Body);
            Client.PostCallback(callback);
        }
开发者ID:ElPresidentePro,项目名称:CSGOShop-Steambot,代码行数:7,代码来源:ClientMsgHandler.cs

示例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 );
        }
开发者ID:nuds7,项目名称:text2steam,代码行数:12,代码来源:steamfriends+reference.cs

示例10: HandleClientUserNotifications

        private void HandleClientUserNotifications(IPacketMsg packetMsg)
        {
            var clientUserNotificationResponse = new ClientMsgProtobuf<CMsgClientUserNotifications>(packetMsg);

            CMsgClientUserNotifications result = clientUserNotificationResponse.Body;

            Client.PostCallback(new NotificationCallback(result));
        }
开发者ID:einsteinsci,项目名称:SteamBot,代码行数:8,代码来源:Notifications.cs

示例11: HandleClientCommentNotifications

        private void HandleClientCommentNotifications(IPacketMsg packetMsg)
        {
            var clientCommentNotifications = new ClientMsgProtobuf<CMsgClientCommentNotifications>(packetMsg);

            CMsgClientCommentNotifications result = clientCommentNotifications.Body;

            Client.PostCallback(new CommentNotificationCallback(result));
        }
开发者ID:einsteinsci,项目名称:SteamBot,代码行数:8,代码来源:Notifications.cs

示例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);
        }
开发者ID:ampped101,项目名称:SteamBot,代码行数:12,代码来源:SteamTrading.cs

示例13: HandleAccountDataResponse

        void HandleAccountDataResponse( IPacketMsg packetMsg )
        {
            var msg = new ClientMsgProtobuf<CMsgClientRequestAccountDataResponse>( packetMsg );

            var callback = new ResponseCallback( msg.TargetJobID, msg.Body );

            Client.PostCallback( callback );
        }
开发者ID:Markusyatina,项目名称:steam-irc-bot,代码行数:8,代码来源:SteamAccountHandler.cs

示例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 );
        }
开发者ID:JustHev,项目名称:SteamKit,代码行数:8,代码来源:SteamCloud.cs

示例15: HandleSteamLevelsResponse

        void HandleSteamLevelsResponse( IPacketMsg msg )
        {
            var clientMsg = new ClientMsgProtobuf<CMsgClientFSGetFriendsSteamLevelsResponse>( msg );

            var callback = new SteamLevelsCallback( clientMsg.TargetJobID, clientMsg.Body );

            Client.PostCallback( callback );
        }
开发者ID:Markusyatina,项目名称:steam-irc-bot,代码行数:8,代码来源:SteamLevelHandler.cs


注:本文中的ClientMsgProtobuf类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。