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(); } } } }
protected CatalogPageData(IReadOnlyPacket packet) : this() { Position = packet.ReadInt(); String1 = packet.ReadString(); String2 = packet.ReadString(); Type = packet.ReadInt(); switch (Type) { case 0: String3 = packet.ReadString(); break; case 1: Int3 = packet.ReadInt(); break; case 2: String4 = packet.ReadString(); break; default: break; } SecondsToExpiration = packet.ReadInt(); }
protected GroupMember(IReadOnlyPacket packet) { Type = (GroupMemberType)packet.ReadInt(); Id = packet.ReadLegacyLong(); Name = packet.ReadString(); Figure = packet.ReadString(); Joined = DateTime.Parse(packet.ReadString()); }
protected NavigatorSearchResults(IReadOnlyPacket packet) { Category = packet.ReadString(); Filter = packet.ReadString(); short n = packet.ReadLegacyShort(); for (int i = 0; i < n; i++) { Add(NavigatorSearchResultList.Parse(packet)); } }
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(); }
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(); }
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(); }
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];
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)); } }
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(); }
protected override void Initialize(IReadOnlyPacket packet) { Value = packet.ReadString(); Result = packet.ReadInt(); base.Initialize(packet); }
public Bot(EntityType type, long id, int index, IReadOnlyPacket packet) : this(type, id, index) { if (type == EntityType.PrivateBot) { Gender = H.ToGender(packet.ReadString()); OwnerId = packet.ReadLegacyLong(); OwnerName = packet.ReadString(); short n = packet.ReadLegacyShort(); for (int i = 0; i < n; i++) { Data.Add(packet.ReadShort()); } } }
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(); } }
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(); }
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)); } }
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(); }
protected RoomInfo(IReadOnlyPacket packet) : this() { Id = packet.ReadLegacyLong(); Name = packet.ReadString(); OwnerId = packet.ReadLegacyLong(); OwnerName = packet.ReadString(); Access = (RoomAccess)packet.ReadInt(); Users = packet.ReadInt(); MaxUsers = packet.ReadInt(); Description = packet.ReadString(); Trading = (TradePermissions)packet.ReadInt(); Score = packet.ReadInt(); Ranking = packet.ReadInt(); Category = (RoomCategory)packet.ReadInt(); int n = packet.ReadLegacyShort(); for (int i = 0; i < n; i++) { Tags.Add(packet.ReadString()); } Flags = (RoomFlags)packet.ReadInt(); if (Flags.HasFlag(RoomFlags.HasOfficialRoomPic)) { OfficialRoomPicRef = packet.ReadString(); } if (Flags.HasFlag(RoomFlags.IsGroupHomeRoom)) { GroupId = packet.ReadLegacyLong(); GroupName = packet.ReadString(); GroupBadge = packet.ReadString(); } if (Flags.HasFlag(RoomFlags.HasEvent)) { EventName = packet.ReadString(); EventDescription = packet.ReadString(); EventMinutesLeft = packet.ReadInt(); } }
private void HandleTradeOpenFail(IReadOnlyPacket packet) { if (!_roomManager.IsInRoom) { DebugUtil.Log("not in room"); return; } int reason = packet.ReadInt(); string name = packet.ReadString(); ResetTrade(); OnStartFail(reason, name); }
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)); } } }
protected MarketplaceItem(IReadOnlyPacket packet) { Id = packet.ReadLegacyLong(); UnknownInt2 = packet.ReadInt(); int itemType = packet.ReadInt(); switch (itemType) { case 1: Type = ItemType.Floor; Kind = packet.ReadInt(); Data = StuffData.Parse(packet); break; case 2: Type = ItemType.Wall; Kind = packet.ReadInt(); Data = new LegacyData() { Value = packet.ReadString() }; break; case 3: Type = ItemType.Floor; Kind = packet.ReadInt(); Data = new LegacyData() { Flags = ItemDataFlags.IsLimitedRare, LimitedNumber = packet.ReadInt(), LimitedTotal = packet.ReadInt() }; break; default: throw new Exception($"Unknown MarketplaceItem type: {itemType}"); } Price = packet.ReadInt(); TimeRemaining = packet.ReadInt(); Average = packet.ReadInt(); Offers = packet.ReadInt(); }
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(); }
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 }
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; * } * }*/ }
public static WallLocation Parse(IReadOnlyPacket packet) => Parse(packet.ReadString());
protected Badge(IReadOnlyPacket packet) { Id = packet.ReadInt(); Code = packet.ReadString(); }
protected Catalog(IReadOnlyPacket packet) { Root = CatalogPageNode.Parse(packet); UnknownBoolA = packet.ReadBool(); Mode = packet.ReadString(); }