public override void WriteTo(HPacket packet) { packet.Write(Id); packet.Write(CatalogType); packet.Write(LayoutCode); packet.Write(Images.Length); foreach (string image in Images) { packet.Write(image); } packet.Write(Texts.Length); foreach (string text in Texts) { packet.Write(text); } packet.Write(Offers.Length); foreach (HCatalogOffer offer in Offers) { offer.WriteTo(packet); } packet.Write(OfferId); packet.Write(AcceptSeasonCurrencyAsCredits); // TODO: ???????????????????? // IsFrontPage?? }
public static HPacket ToPacket(ushort packetId, HFormat format, IList <HWallItem> wallItems) { HPacket packet = format.CreatePacket(packetId); packet.Write(0); var owners = new Dictionary <int, string>(); foreach (HWallItem wallItem in wallItems) { if (owners.ContainsKey(wallItem.OwnerId)) { continue; } owners.Add(wallItem.OwnerId, wallItem.OwnerName); packet.Write(wallItem.OwnerId); packet.Write(wallItem.OwnerName); } packet.Write(owners.Count, 0); packet.Write(wallItems.Count); foreach (HWallItem wallItem in wallItems) { wallItem.WriteTo(packet); } return(packet); }
public override void WriteTo(HPacket packet) { packet.Write((int)Remnants.Dequeue()); string unknown1 = (string)Remnants.Dequeue(); packet.Write(unknown1); }
public override void WriteTo(HPacket packet) { packet.Write((char)Type); switch (Type) { case HProductType.Badge: { packet.Write(ExtraData); break; } default: { packet.Write(ClassId); packet.Write(ExtraData); packet.Write(ProductCount); packet.Write(IsLimited); if (IsLimited) { packet.Write(LimitedTotal); packet.Write(LimitedRemaining); } break; } } }
public static HPacket ToPacket(ushort packetId, HFormat format, IList <HFriendData> friends) { HPacket packet = format.CreatePacket(packetId); packet.Write(0); packet.Write(0); packet.Write(friends.Count); foreach (HFriendData friend in friends) { friend.WriteTo(packet); } return(packet); }
public static HPacket ToPacket(ushort packetId, HFormat format, IList <HItem> items) { HPacket packet = format.CreatePacket(packetId); packet.Write(0); packet.Write(0); packet.Write(items.Count); foreach (HItem item in items) { item.WriteTo(packet); } return(packet); }
public void WriteTo(HPacket packet) { packet.Write(Id); packet.Write(Name); packet.Write(BadgeCode); packet.Write(PrimaryColor); packet.Write(SecondaryColor); packet.Write(Favorite); packet.Write(OwnerId); packet.Write(HasForum); }
public static HPacket ToPacket(ushort packetId, HFormat format, IList <HEntity> entities) { HPacket packet = format.CreatePacket(packetId); packet.Write(entities.Count); foreach (HEntity entity in entities) { entity.WriteTo(packet); } return(packet); }
public static HPacket ToPacket(ushort packetId, HFormat format, IList <HEntityUpdate> updates) { HPacket packet = format.CreatePacket(packetId); packet.Write(updates.Count); foreach (HEntityUpdate update in updates) { update.WriteTo(packet); } return(packet); }
public override void WriteTo(HPacket packet) { packet.Write(Index); packet.Write(Tile.X); packet.Write(Tile.Y); packet.Write(Tile.Z.ToString(CultureInfo.InvariantCulture)); packet.Write((int)HeadFacing); packet.Write((int)BodyFacing); packet.Write((string)Remnants.Dequeue()); }
public override void WriteTo(HPacket packet) { packet.Write(Id); packet.Write(TypeId); packet.Write(Location); packet.Write(State); packet.Write(SecondsToExpiration); packet.Write(UsagePolicy); packet.Write(OwnerId); }
public static HPacket ToPacket(ushort packetId, HFormat format, IList<HFloorItem> floorItems) { HPacket packet = format.CreatePacket(packetId); packet.Write(0); var owners = new Dictionary<int, string>(); foreach (HFloorItem floorItem in floorItems) { if (owners.ContainsKey(floorItem.OwnerId)) continue; owners.Add(floorItem.OwnerId, floorItem.OwnerName); packet.Write(floorItem.OwnerId); packet.Write(floorItem.OwnerName); } packet.Write(owners.Count, 0); packet.Write(floorItems.Count); foreach (HFloorItem floorItem in floorItems) { floorItem.WriteTo(packet); } return packet; }
public override void WriteTo(HPacket packet) { packet.Write(SearchCode); packet.Write(Text); packet.Write(ActionAllowed); packet.Write(ForceClosed); packet.Write(ViewMode); packet.Write(Rooms.Length); for (int i = 0; i < Rooms.Length; i++) { Rooms[i].WriteTo(packet); } }
public override void WriteTo(HPacket packet) { packet.Write(Id); packet.Write(TypeId); packet.Write(Tile.X, Tile.X); packet.Write((int)Facing); packet.Write(Tile.Z.ToString(CultureInfo.InvariantCulture)); packet.Write((string)Remnants.Dequeue()); packet.Write((int)Remnants.Dequeue()); packet.Write(Category); packet.Write(Format.GetBytes(Stuff)); packet.Write(SecondsToExpiration); packet.Write(UsagePolicy); packet.Write(OwnerId); if (TypeId < 0) { packet.Write((string)Remnants.Dequeue()); } }
public override void WriteTo(HPacket packet) { packet.Write(Id); packet.Write(DisplayName); packet.Write(IsRentable); packet.Write(CreditCost); packet.Write(OtherCurrencyCost); packet.Write(OtherCurrencyType); packet.Write(CanGift); packet.Write(Products.Length); foreach (HCatalogProduct product in Products) { product.WriteTo(packet); } packet.Write(ClubLevel); packet.Write(IsPet); packet.Write(AllowBundle); packet.Write(PreviewImage); }
public override void WriteTo(HPacket packet) { packet.Write(Id); packet.Write(Username); packet.Write(Motto); packet.Write(Figure); packet.Write(CreationDate); packet.Write(AchievementScore); packet.Write(FriendCount); packet.Write(IsFriend); packet.Write(IsFriendRequestSent); packet.Write(IsOnline); packet.Write(Groups.Length); foreach (var group in Groups) { group.WriteTo(packet); } packet.Write(LastAccessSinceInSeconds); packet.Write(OpenProfileView); }
public override void WriteTo(HPacket packet) { packet.Write(Id); packet.Write(Name); packet.Write(Motto); packet.Write(FigureId); packet.Write(Index); packet.Write(Tile.X); packet.Write(Tile.Z); packet.Write(Tile.Z.ToString(CultureInfo.InvariantCulture)); packet.Write((int)Remnants.Dequeue()); packet.Write(EntityType); switch (EntityType) { case 1: { packet.Write(Gender.ToString().Substring(0, 1)); packet.Write((int)Remnants.Dequeue()); packet.Write((int)Remnants.Dequeue()); packet.Write(FavoriteGroup); packet.Write((string)Remnants.Dequeue()); packet.Write((int)Remnants.Dequeue()); packet.Write((bool)Remnants.Dequeue()); break; } case 2: { packet.Write((int)Remnants.Dequeue()); packet.Write((int)Remnants.Dequeue()); packet.Write((string)Remnants.Dequeue()); packet.Write((int)Remnants.Dequeue()); packet.Write((bool)Remnants.Dequeue()); packet.Write((bool)Remnants.Dequeue()); packet.Write((bool)Remnants.Dequeue()); packet.Write((bool)Remnants.Dequeue()); packet.Write((bool)Remnants.Dequeue()); packet.Write((bool)Remnants.Dequeue()); packet.Write((int)Remnants.Dequeue()); packet.Write((string)Remnants.Dequeue()); break; } case 3: { packet.Write((string)Remnants.Dequeue()); packet.Write((int)Remnants.Dequeue()); packet.Write((string)Remnants.Dequeue()); var j = (int)Remnants.Dequeue(); packet.Write(j); for (int i = 0; i < j; i++) { packet.Write((ushort)Remnants.Dequeue()); } break; } } }
public override void WriteTo(HPacket packet) { packet.Write(Id); packet.Write(Name); packet.Write(OwnerId); packet.Write(OwnerName); packet.Write(DoorMode); packet.Write(UserCount); packet.Write(MaxUserCount); packet.Write(Description); packet.Write(TradeMode); packet.Write(Ranking); packet.Write(Category); packet.Write(Stars); //TODO: Not happy with this int bitmaskPosition = packet.BodyLength; packet.Write(0); HRoomFlags flags = HRoomFlags.None; if (!string.IsNullOrEmpty(ThumbnailUrl)) { flags |= HRoomFlags.HasCustomThumbnail; packet.Write(ThumbnailUrl); } if (!string.IsNullOrEmpty(GroupName) && !string.IsNullOrEmpty(GroupBadgeCode)) { flags |= HRoomFlags.HasGroup; packet.Write(GroupId); packet.Write(GroupName); packet.Write(GroupBadgeCode); } if (!string.IsNullOrEmpty(AdName) && !string.IsNullOrEmpty(AdDescription)) { flags |= HRoomFlags.HasAdvertisement; packet.Write(AdName); packet.Write(AdDescription); packet.Write(AdExpiresInMinutes); } flags |= ShowOwner ? HRoomFlags.ShowOwner : 0; flags |= AllowPets ? HRoomFlags.AllowPets : 0; flags |= ShowEntryAd ? HRoomFlags.ShowRoomAd : 0; packet.Write((int)flags, bitmaskPosition); }
public override void WriteTo(HPacket packet) { packet.Write(Id); packet.Write(Username); packet.Write(Gender == HGender.Male ? 1 : 0); // TODO GEEKER: Check if 0 is for Female, or is it 2? idk packet.Write(IsOnline); packet.Write(CanFollow); packet.Write(Figure); packet.Write(CategoryId); packet.Write(Motto); packet.Write(RealName); packet.Write((string)Remnants.Dequeue()); packet.Write(IsPersisted); packet.Write((bool)Remnants.Dequeue()); packet.Write(IsPocketHabboUser); packet.Write((ushort)RelationshipStatus); }