Пример #1
0
 protected GroupInfo(IReadOnlyPacket packet)
 {
     Id             = packet.ReadLegacyLong();
     Name           = packet.ReadString();
     BadgeCode      = packet.ReadString();
     PrimaryColor   = packet.ReadString();
     SecondaryColor = packet.ReadString();
     IsFavorite     = packet.ReadBool();
     OwnerId        = packet.ReadLegacyLong();
     HasForum       = packet.ReadBool();
 }
Пример #2
0
 protected UserSearchResult(IReadOnlyPacket packet)
 {
     Id             = packet.ReadLegacyLong();
     Name           = packet.ReadString();
     Motto          = packet.ReadString();
     Online         = packet.ReadBool();
     UnknownBoolA   = packet.ReadBool();
     UnknownStringA = packet.ReadString();
     UnknownLongA   = packet.ReadLegacyLong();
     Figure         = packet.ReadString();
     RealName       = packet.ReadString();
 }
Пример #3
0
        protected CatalogProduct(IReadOnlyPacket packet)
        {
            Type = packet.Protocol switch
            {
                ClientType.Flash => H.ToItemType(packet.ReadString()),
                ClientType.Unity => H.ToItemType(packet.ReadShort()),
                _ => throw new Exception($"Unknown client protocol: {packet.Protocol}.")
            };

            if (Type == ItemType.Badge)
            {
                Variant = packet.ReadString();
                Count   = 0;
            }
            else
            {
                Kind    = packet.ReadInt();
                Variant = packet.ReadString();
                Count   = packet.ReadInt();
                // int ?
                IsLimited = packet.ReadBool();
                if (IsLimited)
                {
                    LimitedTotal     = packet.ReadInt();
                    LimitedRemaining = packet.ReadInt();
                }
            }
        }
    }
Пример #4
0
 protected UserData(IReadOnlyPacket packet)
 {
     Id               = packet.ReadLegacyLong();
     Name             = packet.ReadString();
     Figure           = packet.ReadString();
     Gender           = H.ToGender(packet.ReadString());
     Motto            = packet.ReadString();
     String4          = packet.ReadString();
     Bool1            = packet.ReadBool();
     TotalRespects    = packet.ReadInt();
     RespectsLeft     = packet.ReadInt();
     ScratchesLeft    = packet.ReadInt();
     Bool2            = packet.ReadBool();
     LastLogin        = packet.ReadString();
     IsNameChangeable = packet.ReadBool();
     IsSafetyLocked   = packet.ReadBool();
     Bool3            = packet.ReadBool();
 }
Пример #5
0
 internal RoomUser(long id, int index, IReadOnlyPacket packet)
     : this(id, index)
 {
     Gender           = H.ToGender(packet.ReadString());
     GroupId          = packet.ReadLegacyLong();
     Int8             = packet.ReadInt();
     GroupName        = packet.ReadString();
     FigureExtra      = packet.ReadString();
     AchievementScore = packet.ReadInt();
     Bool1            = packet.ReadBool();
 }
Пример #6
0
        protected RoomData(bool isUpdating, IReadOnlyPacket packet)
            : base(packet)
        {
            IsUpdating = isUpdating;

            ForceLoad    = packet.ReadBool(); // if IsUpdating == false
            Bool3        = packet.ReadBool();
            BypassAccess = packet.ReadBool();
            IsRoomMuted  = packet.ReadBool();

            Moderation = ModerationSettings.Parse(packet);

            ShowMuteButton = packet.ReadBool();
            ChatSettings   = ChatSettings.Parse(packet);

            if (packet.Protocol == ClientType.Unity)
            {
                UnknownInt1 = packet.ReadInt();
                UnknownInt2 = packet.ReadInt();
            }
        }
Пример #7
0
        protected CatalogOffer(IReadOnlyPacket packet)
        {
            Id                    = packet.ReadInt();
            FurniLine             = packet.ReadString();
            IsRentable            = packet.ReadBool();
            PriceInCredits        = packet.ReadInt();
            PriceInActivityPoints = packet.ReadInt();
            ActivityPointType     = (ActivityPointType)packet.ReadInt();
            CanPurchaseAsGift     = packet.ReadBool();

            short n = packet.ReadLegacyShort();

            for (int i = 0; i < n; i++)
            {
                Products.Add(CatalogProduct.Parse(packet));
            }

            ClubLevel           = packet.ReadInt();
            CanPurchaseMultiple = packet.ReadBool();
            IsPet        = packet.ReadBool();
            PreviewImage = packet.ReadString();
        }
Пример #8
0
        protected NavigatorSearchResultList(IReadOnlyPacket packet)
        {
            Category      = packet.ReadString();
            Text          = packet.ReadString();
            ActionAllowed = packet.ReadInt();
            BoolA         = packet.ReadBool();
            ViewMode      = packet.ReadInt();
            short n = packet.ReadLegacyShort();

            for (int i = 0; i < n; i++)
            {
                Add(RoomInfo.Parse(packet));
            }
        }
Пример #9
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();
            }
        }
Пример #10
0
 protected Achievement(IReadOnlyPacket packet)
 {
     Id              = packet.ReadInt();
     Level           = packet.ReadInt();
     BadgeName       = packet.ReadString();
     BaseProgress    = packet.ReadInt();
     MaxProgress     = packet.ReadInt();
     Int5            = packet.ReadInt();
     Int6            = packet.ReadInt();
     CurrentProgress = packet.ReadInt();
     IsCompleted     = packet.ReadBool();
     Category        = packet.ReadString();
     String3         = packet.ReadString();
     MaxLevel        = packet.ReadInt();
     Int9            = packet.ReadInt();
     _Short1         = packet.ReadShort();
 }
Пример #11
0
        protected CatalogPageNode(IReadOnlyPacket packet)
        {
            IsVisible = packet.ReadBool();
            Icon      = packet.ReadInt();
            Id        = packet.ReadInt();
            Name      = packet.ReadString();
            Text      = packet.ReadString();

            short n = packet.ReadLegacyShort();

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

            n = packet.ReadLegacyShort();
            for (int i = 0; i < n; i++)
            {
                Children.Add(Parse(packet));
            }
        }
Пример #12
0
 internal Pet(long id, int index, IReadOnlyPacket packet)
     : this(id, index)
 {
     Breed       = packet.ReadInt();
     OwnerId     = packet.ReadLegacyLong();
     OwnerName   = packet.ReadString();
     RarityLevel = packet.ReadInt();
     Bool1       = packet.ReadBool();
     Bool2       = packet.ReadBool();
     Bool3       = packet.ReadBool();
     Bool4       = packet.ReadBool();
     Bool5       = packet.ReadBool();
     Bool6       = packet.ReadBool();
     Level       = packet.ReadInt();
     Stance      = packet.ReadString();
 }
Пример #13
0
        protected CatalogPage(IReadOnlyPacket packet)
        {
            Id         = packet.ReadInt();
            Mode       = packet.ReadString();
            LayoutCode = packet.ReadString();

            short n = packet.ReadLegacyShort();

            for (int i = 0; i < n; i++)
            {
                Images.Add(packet.ReadString());
            }

            n = packet.ReadLegacyShort();
            for (int i = 0; i < n; i++)
            {
                Texts.Add(packet.ReadString());
            }

            n = packet.ReadLegacyShort();
            for (int i = 0; i < n; i++)
            {
                Offers.Add(CatalogOffer.Parse(packet));
            }

            UnknownIntA = packet.ReadInt();
            AcceptSeasonCurrencyAsCredits = packet.ReadBool();
            if (packet.Available > 0)
            {
                n = packet.ReadLegacyShort();
                for (int i = 0; i < n; i++)
                {
                    Data.Add(CatalogPageData.Parse(packet));
                }
            }
        }
Пример #14
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
        }
Пример #15
0
        protected InventoryItem(IReadOnlyPacket packet)
            : this()
        {
            ItemId = packet.ReadLegacyLong();

            if (packet.Protocol == ClientType.Flash)
            {
                Type = H.ToItemType(packet.ReadString());
            }
            else
            {
                Type = H.ToItemType(packet.ReadShort());
            }

            Id                   = packet.ReadLegacyLong();
            Kind                 = packet.ReadInt();
            Category             = (FurniCategory)packet.ReadInt();
            Data                 = StuffData.Parse(packet);
            _Bool1               = packet.ReadBool();
            IsTradeable          = packet.ReadBool();
            IsGroupable          = packet.ReadBool();
            IsSellable           = packet.ReadBool();
            SecondsToExpiration  = packet.ReadInt();
            HasRentPeriodStarted = packet.ReadBool();
            RoomId               = packet.ReadLegacyLong();

            if (packet.Protocol == ClientType.Unity)
            {
                // - Seems to be consistent
                _String1 = packet.ReadString(); // string ""
                _String2 = packet.ReadString(); // string "r" / "s"
                _Int3    = packet.ReadInt();    // int 1187551480
            }

            if (Type == ItemType.Floor)
            {
                if (packet.Protocol == ClientType.Flash)
                {
                    _String2 = packet.ReadString();
                    Extra    = packet.ReadInt();
                }
                else
                {
                    // 10 bytes ?
                    _String3 = packet.ReadString();
                    Extra    = packet.ReadInt();
                    _Int5    = packet.ReadInt();
                }
            }
            else
            {
                _String3 = string.Empty;
            }

            /*if (clientType == ClientType.Flash)
             * {
             *  ItemId = packet.ReadInt();
             *  Type = H.ToItemType(packet.ReadString());
             *  Id = packet.ReadInt();
             *  Kind = packet.ReadInt();
             *  Category = (FurniCategory)packet.ReadInt();
             *  Data = StuffData.Parse(packet, clientType);
             *  _Bool1 = packet.ReadBool();
             *  IsTradeable = packet.ReadBool();
             *  IsGroupable = packet.ReadBool();
             *  IsSellable = packet.ReadBool();
             *  SecondsToExpiration = packet.ReadInt();
             *  HasRentPeriodStarted = packet.ReadBool();
             *  RoomId = packet.ReadInt();
             *
             *  if (Type == ItemType.Floor)
             *  {
             *      _String2 = packet.ReadString();
             *      Extra = packet.ReadInt();
             *  }
             * }
             * else
             * {
             *  ItemId = packet.ReadLong();
             *  Type = H.ToItemType(packet.ReadShort());
             *  Id = packet.ReadLong();
             *  Kind = packet.ReadInt();
             *  Category = (FurniCategory)packet.ReadInt();
             *  Data = StuffData.Parse(packet, clientType);
             *  _Bool1 = packet.ReadBool();
             *  IsTradeable = packet.ReadBool();
             *  IsGroupable = packet.ReadBool();
             *  IsSellable = packet.ReadBool();
             *  SecondsToExpiration = packet.ReadInt();
             *  HasRentPeriodStarted = packet.ReadBool();
             *  RoomId = packet.ReadLong();
             *
             *  // - Seems to be consistent
             *  _String1 = packet.ReadString(); // string ""
             *  _String2 = packet.ReadString(); // string "r" / "s"
             *  _Int3 = packet.ReadInt(); // int 1187551480
             *
             *  if (Type == ItemType.Floor)
             *  {
             *      // 10 bytes ?
             *      _String3 = packet.ReadString();
             *      Extra = packet.ReadInt();
             *      _Int5 = packet.ReadInt();
             *  }
             *  else
             *  {
             *      _String3 = string.Empty;
             *  }
             * }*/
        }
Пример #16
0
 public static new RoomData Parse(IReadOnlyPacket packet)
 {
     return(new RoomData(packet.ReadBool(), packet));
 }
Пример #17
0
 protected Catalog(IReadOnlyPacket packet)
 {
     Root         = CatalogPageNode.Parse(packet);
     UnknownBoolA = packet.ReadBool();
     Mode         = packet.ReadString();
 }