Esempio n. 1
0
        protected UserProfile(IReadOnlyPacket packet)
            : this()
        {
            if (packet.Protocol == ClientType.Flash)
            {
                Id                  = packet.ReadInt();
                Name                = packet.ReadString();
                Figure              = packet.ReadString();
                Motto               = packet.ReadString();
                Created             = packet.ReadString();
                ActivityPoints      = packet.ReadInt();
                Friends             = packet.ReadInt();
                IsFriend            = packet.ReadBool();
                IsFriendRequestSent = packet.ReadBool();
                IsOnline            = packet.ReadBool();

                int n = packet.ReadInt();
                for (int i = 0; i < n; i++)
                {
                    Groups.Add(GroupInfo.Parse(packet));
                }

                LastLogin       = TimeSpan.FromSeconds(packet.ReadInt());
                DisplayInClient = packet.ReadBool();
            }
            else
            {
                Id      = packet.ReadLong();
                Name    = packet.ReadString();
                Figure  = packet.ReadString();
                Motto   = packet.ReadString();
                Created = packet.ReadString();
                // ActivityPoints = packet.ReadInt();
                Friends  = packet.ReadInt();
                IsFriend = packet.ReadBool();
                // IsFriendRequestSent = packet.ReadBool();
                // IsOnline = packet.ReadBool();

                // long secondsSinceLastLogin
                // bool showInClient ???
                // bool ?
                // int ?
                // int ?
                // int ?
                // bool ?
                // bool ?

                short n = packet.ReadShort();
                for (int i = 0; i < n; i++)
                {
                    Groups.Add(GroupInfo.Parse(packet));
                }

                LastLogin       = TimeSpan.FromSeconds(packet.ReadInt());
                DisplayInClient = packet.ReadBool();
            }
        }
Esempio n. 2
0
        protected Sticky(IReadOnlyPacket packet)
        {
            Id = packet.Protocol switch
            {
                ClientType.Flash => long.Parse(packet.ReadString()),
                ClientType.Unity => packet.ReadLong(),
                _ => throw new Exception("Unknown client protocol.")
            };
            string text       = packet.ReadString();
            int    spaceIndex = text.IndexOf(' ');

            Color = text[0..6];
Esempio n. 3
0
        protected GroupData(IReadOnlyPacket packet, ClientType clientType)
        {
            Id                  = packet.ReadLong();
            CanLeave            = packet.ReadBool();
            Type                = (GroupType)packet.ReadInt();
            Name                = packet.ReadString();
            Description         = packet.ReadString();
            Badge               = packet.ReadString();
            HomeRoomId          = packet.ReadLong();
            HomeRoomName        = packet.ReadString();
            MemberStatus        = (GroupMemberStatus)packet.ReadInt();
            MemberCount         = packet.ReadInt();
            IsFavourite         = packet.ReadBool();
            Created             = packet.ReadString();
            IsOwner             = packet.ReadBool();
            IsAdmin             = packet.ReadBool();
            OwnerName           = packet.ReadString();
            DisplayInClient     = packet.ReadBool();
            CanDecorateHomeRoom = packet.ReadBool();
            PendingRequests     = packet.ReadInt();
            CanViewForum        = packet.ReadBool();

            // TODO extra 8 bytes
        }