• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ClientMsg类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: HandleLoggedOff

        void HandleLoggedOff( IPacketMsg packetMsg )
        {
            EResult result = EResult.Invalid;

            if ( packetMsg.IsProto )
            {
                var loggedOff = new ClientMsgProtobuf<CMsgClientLoggedOff>( packetMsg );
                result = ( EResult )loggedOff.Body.eresult;
            }
            else
            {
                var loggedOff = new ClientMsg<MsgClientLoggedOff>( packetMsg );
                result = loggedOff.Body.Result;
            }

            this.Client.PostCallback( new LoggedOffCallback( result ) );
        }
开发者ID:stil,项目名称:SteamKit,代码行数:17,代码来源:SteamUser.cs


示例17: HandleChatActionResult

        void HandleChatActionResult( IPacketMsg packetMsg )
        {
            var actionResult = new ClientMsg<MsgClientChatActionResult>( packetMsg );

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


示例18: HandleChatActionResult

        void HandleChatActionResult( IPacketMsg packetMsg )
        {
            var actionResult = new ClientMsg<MsgClientChatActionResult>( packetMsg );

#if STATIC_CALLBACKS
            var callback = new ChatActionResultCallback( Client, actionResult.Body );
            SteamClient.PostCallback( callback );
#else
            var callback = new ChatActionResultCallback( actionResult.Body );
            this.Client.PostCallback( callback );
#endif
        }
开发者ID:wheybags,项目名称:steamirc,代码行数:12,代码来源:SteamFriends.cs


示例19: InviteUserToGroup

        /// <summary>
        /// Invites a use to the specified Steam Group
        /// </summary>
        /// <param name="user">SteamID of the user to invite.</param>
        /// <param name="groupId">SteamID of the group to invite the user to.</param>
        public void InviteUserToGroup(SteamID user, SteamID groupId)
        {
            var InviteUser = new ClientMsg<CMsgInviteUserToGroup>((int)EMsg.ClientInviteUserToClan);

            InviteUser.Body.GroupID = groupId.ConvertToUInt64();
            InviteUser.Body.Invitee = user.ConvertToUInt64();
            InviteUser.Body.UnknownInfo = true;

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


示例20: HandleChatMemberInfo

        void HandleChatMemberInfo( IPacketMsg packetMsg )
        {
            var membInfo = new ClientMsg<MsgClientChatMemberInfo>( packetMsg );

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

#if STATIC_CALLBACKS
            var callback = new ChatMemberInfoCallback( Client, membInfo.Body, payload );
            SteamClient.PostCallback( callback );
#else
            var callback = new ChatMemberInfoCallback( membInfo.Body, payload );
            this.Client.PostCallback( callback );
#endif
        }
开发者ID:wheybags,项目名称:steamirc,代码行数:14,代码来源:SteamFriends.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ClientMsgProtobuf类代码示例发布时间:2022-05-24
下一篇:
C# ClientMessage类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap