當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。