Наследование: ISteamSerializableMessage
Пример #1
0
 internal ChatEnterCallback( SteamClient client, MsgClientChatEnter msg )
     : base( client )
Пример #2
0
            internal ChatEnterCallback( MsgClientChatEnter msg )
            {
                ChatID = msg.SteamIdChat;
                FriendID = msg.SteamIdFriend;

                ChatRoomType = msg.ChatRoomType;

                OwnerID = msg.SteamIdOwner;
                ClanID = msg.SteamIdClan;

                ChatFlags = msg.ChatFlags;

                EnterResponse = msg.EnterResponse;
            }
Пример #3
0
            internal ChatEnterCallback( MsgClientChatEnter msg, byte[] payload )
            {
                ChatID = msg.SteamIdChat;
                FriendID = msg.SteamIdFriend;

                ChatRoomType = msg.ChatRoomType;

                OwnerID = msg.SteamIdOwner;
                ClanID = msg.SteamIdClan;

                ChatFlags = msg.ChatFlags;

                EnterResponse = msg.EnterResponse;

                NumChatMembers = msg.NumMembers;

                using ( var ms = new MemoryStream( payload ) )
                {
                    // steamclient always attempts to read the chat room name, regardless of the enter response
                    ChatRoomName = ms.ReadNullTermString( Encoding.UTF8 );

                    if ( EnterResponse != EChatRoomEnterResponse.Success )
                    {
                        // the rest of the payload depends on a successful chat enter
                        return;
                    }

                    var memberList = new List<ChatMemberInfo>();

                    for ( int x = 0 ; x < NumChatMembers ; ++x )
                    {
                        var memberInfo = new ChatMemberInfo();
                        memberInfo.ReadFromStream( ms );

                        memberList.Add( memberInfo );
                    }

                    ChatMembers = new ReadOnlyCollection<ChatMemberInfo>( memberList );
                }
            }