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


C# ClientMsg类代码示例

本文整理汇总了C#中ClientMsg的典型用法代码示例。如果您正苦于以下问题:C# ClientMsg类的具体用法?C# ClientMsg怎么用?C# ClientMsg使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ClientMsg类属于命名空间,在下文中一共展示了ClientMsg类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeclineClanInvite

 internal void DeclineClanInvite(ulong clanID)
 {
     var request = new ClientMsg<CMsgClientClanInviteAction>((int) EMsg.ClientAcknowledgeClanInvite);
     request.Body.GroupID = clanID;
     request.Body.AcceptInvite = false;
     Client.Send(request);
 }
开发者ID:Pandiora,项目名称:ArchiSteamFarm,代码行数:7,代码来源:ArchiHandler.cs

示例2: HandleNumberOfPlayersResponse

        void HandleNumberOfPlayersResponse( IPacketMsg packetMsg )
        {
            var msg = new ClientMsg<MsgClientGetNumberOfCurrentPlayersResponse>( packetMsg );

            var callback = new NumberOfPlayersCallback( msg.Header.TargetJobID, msg.Body );
            Client.PostCallback( callback );
        }
开发者ID:Badca52,项目名称:SteamKit,代码行数:7,代码来源:SteamUserStats.cs

示例3: PayloadReaderReadsNullTermString

        public void PayloadReaderReadsNullTermString()
        {
            var msg = new ClientMsg<MsgClientChatEnter>( BuildStructMsg() );

            string chatName = msg.ReadNullTermString();

            Assert.Equal( chatName, "Saxton Hell" );
        }
开发者ID:Zaharkov,项目名称:SteamKit,代码行数:8,代码来源:ClientMsgFacts.cs

示例4: GetNumberOfCurrentPlayers

        /// <summary>
        /// Retrieves the number of current players for a given <see cref="GameID"/>.
        /// Results are returned in a <see cref="NumberOfPlayersCallback"/>.
        /// </summary>
        /// <param name="gameId">The GameID to request the number of players for.</param>
        /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="NumberOfPlayersCallback"/>.</returns>
        public AsyncJob<NumberOfPlayersCallback> GetNumberOfCurrentPlayers( GameID gameId )
        {
            var msg = new ClientMsg<MsgClientGetNumberOfCurrentPlayers>();
            msg.SourceJobID = Client.GetNextJobID();

            msg.Body.GameID = gameId;

            Client.Send( msg );

            return new AsyncJob<NumberOfPlayersCallback>( this.Client, msg.SourceJobID );
        }
开发者ID:logtcn,项目名称:SteamKit,代码行数:17,代码来源:SteamUserStats.cs

示例5: GetNumberOfCurrentPlayers

        /// <summary>
        /// Retrieves the number of current players for a given <see cref="GameID"/>.
        /// Results are returned in a <see cref="NumberOfPlayersCallback"/>.
        /// </summary>
        /// <param name="gameId">The GameID to request the number of players for.</param>
        /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="NumberOfPlayersCallback"/>.</returns>
        public JobID GetNumberOfCurrentPlayers( GameID gameId )
        {
            var msg = new ClientMsg<MsgClientGetNumberOfCurrentPlayers>();
            msg.SourceJobID = Client.GetNextJobID();

            msg.Body.GameID = gameId;

            Client.Send( msg );

            return msg.SourceJobID;
        }
开发者ID:Jwsonic,项目名称:SteamKit,代码行数:17,代码来源:SteamUserStats.cs

示例6: HandleNumberOfPlayersResponse

        void HandleNumberOfPlayersResponse( IPacketMsg packetMsg )
        {
            var msg = new ClientMsg<MsgClientGetNumberOfCurrentPlayersResponse>( packetMsg );
#if STATIC_CALLBACKS
            var innerCallback = new NumberOfPlayersCallback( Client, msg.Body );
            var callback = new SteamClient.JobCallback<NumberOfPlayersCallback>( Client, msg.Header.TargetJobID, innerCallback );
            SteamClient.PostCallback( callback );
#else
            var innerCallback = new NumberOfPlayersCallback( msg.Body );
            var callback = new SteamClient.JobCallback<NumberOfPlayersCallback>( msg.Header.TargetJobID, innerCallback );
            Client.PostCallback( callback );
#endif
        }
开发者ID:ampped101,项目名称:SteamBot,代码行数:13,代码来源:SteamUserStats.cs

示例7: Respond

        private bool Respond(SteamID roomID, string message)
        {
            string[] query = StripCommand(message, Options.ChatCommand.Command);
            if(query != null)
            {
                var msg = new ClientMsg<MsgClientChatAction>();
                msg.Body.SteamIdChat = SteamHelper.ToChatID(roomID);
                msg.Body.SteamIdUserToActOn = SteamHelper.ToChatID(roomID);
                msg.Body.ChatAction = EChatAction.LockChat;

                Bot.steamClient.Send(msg);
                return true;
            }
            return false;
        }
开发者ID:Steam-Chat-Bot,项目名称:SteamChatBot,代码行数:15,代码来源:LockChatTrigger.cs

示例8: PayloadReaderDoesNotOverflowPastNullTermString

        public void PayloadReaderDoesNotOverflowPastNullTermString()
        {
            var msg = new ClientMsg<MsgClientChatEnter>( BuildStructMsg() );

            string chatName = msg.ReadNullTermString();

            Assert.Equal( chatName, "Saxton Hell" );

            byte nextByte = msg.ReadByte();
            char mByte = (char)msg.ReadByte();

            // next byte should be a null
            Assert.Equal( nextByte, 0 );
            // and the one after should be the beginning of a MessageObject
            Assert.Equal( mByte, 'M' );
        }
开发者ID:Zaharkov,项目名称:SteamKit,代码行数:16,代码来源:ClientMsgFacts.cs

示例9: BanChatMember

        /// <summary>
        /// Bans the specified chat member from the given chat room.
        /// </summary>
        /// <param name="steamIdChat">The SteamID of chat room to ban the member from.</param>
        /// <param name="steamIdMember">The SteamID of the member to ban from the chat.</param>
        public void BanChatMember( SteamID steamIdChat, SteamID steamIdMember )
        {
            SteamID chatId = steamIdChat.ConvertToUInt64(); // copy the steamid so we don't modify it

            var banMember = new ClientMsg<MsgClientChatAction>();

            if ( chatId.IsClanAccount )
            {
                // this steamid is incorrect, so we'll fix it up
                chatId.AccountInstance = ( uint )SteamID.ChatInstanceFlags.Clan;
                chatId.AccountType = EAccountType.Chat;
            }

            banMember.Body.SteamIdChat = chatId;
            banMember.Body.SteamIdUserToActOn = steamIdMember;

            banMember.Body.ChatAction = EChatAction.Ban;

            this.Client.Send( banMember );
        }
开发者ID:nuds7,项目名称:text2steam,代码行数:25,代码来源:steamfriends+reference.cs

示例10: IgnoreFriend

        /// <summary>
        /// Ignores or unignores a friend on Steam.
        /// Results are returned in a <see cref="IgnoreFriendCallback"/>.
        /// </summary>
        /// <param name="steamId">The SteamID of the friend to ignore or unignore.</param>
        /// <param name="setIgnore">if set to <c>true</c>, the friend will be ignored; otherwise, they will be unignored.</param>
        /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="IgnoreFriendCallback"/>.</returns>
        public JobID IgnoreFriend( SteamID steamId, bool setIgnore = true )
        {
            var ignore = new ClientMsg<MsgClientSetIgnoreFriend>();
            ignore.SourceJobID = Client.GetNextJobID();

            ignore.Body.MySteamId = Client.SteamID;
            ignore.Body.Ignore = ( byte )( setIgnore ? 1 : 0 );
            ignore.Body.SteamIdFriend = steamId;

            this.Client.Send( ignore );

            return ignore.SourceJobID;
        }
开发者ID:katsalap,项目名称:SteamKit,代码行数:20,代码来源:SteamFriends.cs

示例11: HandleChatEnter

        void HandleChatEnter( IPacketMsg packetMsg )
        {
            var chatEnter = new ClientMsg<MsgClientChatEnter>( packetMsg );

            byte[] payload = chatEnter.Payload.ToArray();

            var callback = new ChatEnterCallback( chatEnter.Body, payload );
            this.Client.PostCallback( callback );
        }
开发者ID:katsalap,项目名称:SteamKit,代码行数:9,代码来源:SteamFriends.cs

示例12: LeaveChat

        /// <summary>
        /// Attempts to leave a chat room.
        /// </summary>
        /// <param name="steamId">The SteamID of the chat room.</param>
        public void LeaveChat( SteamID steamId )
        {
            SteamID chatId = steamId.ConvertToUInt64(); // copy the steamid so we don't modify it

            var leaveChat = new ClientMsg<MsgClientChatMemberInfo>();

            if ( chatId.IsClanAccount )
            {
                // this steamid is incorrect, so we'll fix it up
                chatId.AccountInstance = ( uint )SteamID.ChatInstanceFlags.Clan;
                chatId.AccountType = EAccountType.Chat;
            }

            leaveChat.Body.SteamIdChat = chatId;
            leaveChat.Body.Type = EChatInfoType.StateChange;

            leaveChat.Write( Client.SteamID.ConvertToUInt64() ); // ChatterActedOn
            leaveChat.Write( ( uint )EChatMemberStateChange.Left ); // StateChange
            leaveChat.Write( Client.SteamID.ConvertToUInt64() ); // ChatterActedBy

            Client.Send( leaveChat );
        }
开发者ID:katsalap,项目名称:SteamKit,代码行数:26,代码来源:SteamFriends.cs

示例13: SendChatRoomMessage

        /// <summary>
        /// Sends a message to a chat room.
        /// </summary>
        /// <param name="steamIdChat">The SteamID of the chat room.</param>
        /// <param name="type">The message type.</param>
        /// <param name="message">The message.</param>
        public void SendChatRoomMessage( SteamID steamIdChat, EChatEntryType type, string message )
        {
            SteamID chatId = steamIdChat.ConvertToUInt64(); // copy the steamid so we don't modify it

            if ( chatId.IsClanAccount )
            {
                // this steamid is incorrect, so we'll fix it up
                chatId.AccountInstance = ( uint )SteamID.ChatInstanceFlags.Clan;
                chatId.AccountType = EAccountType.Chat;
            }

            var chatMsg = new ClientMsg<MsgClientChatMsg>();

            chatMsg.Body.ChatMsgType = type;
            chatMsg.Body.SteamIdChatRoom = chatId;
            chatMsg.Body.SteamIdChatter = Client.SteamID;

            chatMsg.WriteNullTermString( message, Encoding.UTF8 );

            this.Client.Send( chatMsg );
        }
开发者ID:katsalap,项目名称:SteamKit,代码行数:27,代码来源:SteamFriends.cs

示例14: DeclineGroupInvite

        /// <summary>
        /// Declines the invite to a Steam Group
        /// </summary>
        /// <param name="group">SteamID of the group to decline the invite from.</param>
        private void DeclineGroupInvite(SteamID group)
        {
            var declineMsg = new ClientMsg<CMsgGroupInviteAction>((int)EMsg.ClientAcknowledgeClanInvite);

            declineMsg.Body.GroupID = group.ConvertToUInt64();
            declineMsg.Body.AcceptInvite = false;

            SteamClient.Send(declineMsg);
            Log.Info("Declined group invite to {0}.", group.ToString());
        }
开发者ID:einsteinsci,项目名称:SteamBot,代码行数:14,代码来源:Bot.cs

示例15: DeclineGroupInvite

        /// <summary>
        /// Declines the invite to a Steam Group
        /// </summary>
        /// <param name="group">SteamID of the group to decline the invite from.</param>
        private void DeclineGroupInvite(SteamID group)
        {
            var DeclineInvite = new ClientMsg<CMsgGroupInviteAction>((int)EMsg.ClientAcknowledgeClanInvite);

            DeclineInvite.Body.GroupID = group.ConvertToUInt64();
            DeclineInvite.Body.AcceptInvite = false;

            this.SteamClient.Send(DeclineInvite);
        }
开发者ID:nicolas-martin,项目名称:csgoescrow,代码行数:13,代码来源:Bot.cs


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