internal void SerializeCatalogItem(ServerMessage CatalogPage, Cache.Catalog CPages, Cache.Items eItem) { #region CatalogItem if (eItem.Name.Contains("wallpaper") || eItem.Name.Contains("floor") || eItem.Name.Contains("landscape")) { try { string[] WallPaperPart = eItem.Name.Split('_'); CatalogPage.AppendInt32(eItem.Id); // Item Id CatalogPage.AppendString(eItem.Name); // Item Name CatalogPage.AppendInt32(eItem.Cost_Credits); // Cost (Credits) CatalogPage.AppendInt32(eItem.Cost_Pixels); // Cost (Pixels, SnowFlakes or maybe Hearts) CatalogPage.AppendInt32(CPages.PageQuest); // Page Type; 0 = nothing, 1 = Snowflakes, 2 = hearts, 3 = ? CatalogPage.AppendBoolean(true); // ?? CatalogPage.AppendInt32(eItem.ItemIds.Count); // Count of Furnis of the deal foreach (int FurniId in eItem.ItemIds) { Cache.FurniTure fItem = Cache.FurniTure.RegisteredFurnis[FurniId]; CatalogPage.AppendString(fItem.Type); // Special type of furni? CatalogPage.AppendInt32(fItem.SpriteId); // SpriteID CatalogPage.AppendString(WallPaperPart[2]); // Separe CatalogPage.AppendInt32(eItem.Amount); CatalogPage.AppendBreak(); // Separe } CatalogPage.AppendInt32(eItem.IsClub); // Is HC Button? } catch { return; } } else { try { CatalogPage.AppendInt32(eItem.Id); // Item Id CatalogPage.AppendString(eItem.Name); // Item Name CatalogPage.AppendInt32(eItem.Cost_Credits); // Cost (Credits) CatalogPage.AppendInt32(eItem.Cost_Pixels); // Cost (Pixels, SnowFlakes or maybe Hearts) CatalogPage.AppendInt32(CPages.PageQuest); // Page Type; 0 = nothing, 1 = Snowflakes, 2 = hearts, 3 = ? CatalogPage.AppendBoolean(true); // ?? CatalogPage.AppendInt32(eItem.ItemIds.Count); // Count of Furnis of the deal foreach (int FurniId in eItem.ItemIds) { Cache.FurniTure fItem = Cache.FurniTure.RegisteredFurnis[FurniId]; CatalogPage.AppendString(fItem.Type); // Type ("i","s",etc) CatalogPage.AppendInt32(fItem.SpriteId); // SpriteID CatalogPage.AppendString(eItem.ExtraInformation); // Separe Char (like a AppendString("")) if (eItem.ExtraAmounts.ContainsKey(FurniId)) CatalogPage.AppendInt32(eItem.ExtraAmounts[FurniId]); // Amount else CatalogPage.AppendInt32(eItem.Amount); // Amount CatalogPage.AppendBreak(); // Separe } CatalogPage.AppendInt32(eItem.IsClub); // Is HC(1)/VIP(2) Item? } catch { return; } } #endregion }
internal void ThirdRequest() { DataRow Row = GetRoom(User.HabboUser.CurrentRoomId); BuildMessage NewBuild = new BuildMessage(); ServerMessage First = new ServerMessage(Headers.FIRSTP); First.AppendInt32(0); NewBuild.AppendPacket(First); ServerMessage First1 = new ServerMessage(Headers.FIRST1); First1.AppendInt32(0); NewBuild.AppendPacket(First1); //Data.UserList.Add(Habbo); //Data.CurrentUsersInRoom++; User.HabboUser.X = Cache.Models.RoomModelByName[Row["model"].ToString()].DoorX; User.HabboUser.Y = Cache.Models.RoomModelByName[Row["model"].ToString()].DoorY; User.HabboUser.Z = "0.0"; ServerMessage First2 = new ServerMessage(Headers.WALLITEMS); First2.AppendInt32(0); First2.AppendInt32(0); NewBuild.AppendPacket(First2); ServerMessage First3 = new ServerMessage(Headers.FLOORITEMS); First3.AppendInt32(0); First3.AppendInt32(0); NewBuild.AppendPacket(First3); ServerMessage SerializeUser = new ServerMessage(Headers.SERIALIZEUSER); SerializeUser.AppendInt32(1); foreach (User Rowf in UserManager._Users.Values) { //UsersData UserData = tUser.GetUserData(); SerializeUser.AppendInt32(Convert.ToInt32(Rowf.HabboUser.UserRow["id"])); SerializeUser.AppendString(Convert.ToString(Rowf.HabboUser.UserRow["username"])); SerializeUser.AppendString(Convert.ToString(Rowf.HabboUser.UserRow["motto"])); SerializeUser.AppendString(Convert.ToString(Rowf.HabboUser.UserRow["figure"])); SerializeUser.AppendInt32(0); // Rot SerializeUser.AppendInt32(Rowf.HabboUser.X); SerializeUser.AppendInt32(Rowf.HabboUser.Y); SerializeUser.AppendString(Rowf.HabboUser.Z); SerializeUser.AppendInt32(2); SerializeUser.AppendInt32(1); SerializeUser.AppendString(Convert.ToString(Rowf.HabboUser.UserRow["gender"]).ToLower()); SerializeUser.AppendBreak(); SerializeUser.AppendBreak(); SerializeUser.AppendInt32(0); SerializeUser.AppendInt32(460); // Score points } NewBuild.AppendPacket(SerializeUser); ServerMessage Extra1 = new ServerMessage(Headers.EXTRA1); Extra1.AppendBoolean(false); Extra1.AppendInt32(0); Extra1.AppendInt32(0); NewBuild.AppendPacket(Extra1); ServerMessage Extra2 = new ServerMessage(Headers.EXTRA2); Extra2.AppendBoolean(true); Extra2.AppendInt32(User.HabboUser.CurrentRoomId); Extra2.AppendBoolean(true); NewBuild.AppendPacket(Extra2); User.sendPacket(NewBuild); }
public void GetPages() { #region Packet BuildMessage BuildCatalog = new BuildMessage(); int PageId = User.ActualClientMessage.GetNextInt(); Cache.Catalog Ld = Cache.Catalog.Page[PageId]; if (Ld.EnabledPage) { if (Ld.MinRank > Convert.ToInt32(User.HabboUser.UserRow["rank"])) { return; } ServerMessage CatalogPage = new ServerMessage(Headers.SelectPages); CatalogPage.AppendInt32(PageId); switch (Ld.Extra) { case "frontpage": #region FrontPage CatalogPage.AppendString("frontpage3"); CatalogPage.AppendInt32(3); CatalogPage.AppendString("catalog_frontpage_headline_shop_DKCOMNLDE_02"); CatalogPage.AppendString("topstory_balloonmachine"); CatalogPage.AppendString(""); CatalogPage.AppendInt32(11); CatalogPage.AppendString("THE RARE BALLOON MACHINE"); CatalogPage.AppendString("Celebrate New Year holding cheerful Balloons!"); CatalogPage.AppendString("The Last Xmas Rare âºâº"); CatalogPage.AppendString("How to get Habbo Credits"); CatalogPage.AppendString("You can get Habbo Credits via Prepaid Cards, Home Phone, Credit Card, Mobile, completing offers and more!" + Convert.ToChar(10).ToString() + "" + Convert.ToChar(10).ToString() + " To redeem your Habbo Credits, enter your voucher code below."); CatalogPage.AppendString("Redeem a voucher code here:"); CatalogPage.AppendString("Snowflake Gifts"); CatalogPage.AppendString("#FEFEFE"); CatalogPage.AppendString("#FEFEFE"); CatalogPage.AppendString("Want all the options? Click here!"); CatalogPage.AppendString("magic.credits"); CatalogPage.AppendInt32(0); CatalogPage.AppendInt32(-1); #endregion break; case "defaultpage": CatalogPage.AppendString("default_3x3"); CatalogPage.AppendInt32(3); CatalogPage.AppendString(Ld.HeadLine); CatalogPage.AppendString(Ld.PageTeaser); CatalogPage.AppendString(Ld.TextSpecial); CatalogPage.AppendInt32(3); CatalogPage.AppendString(Ld.Text); CatalogPage.AppendString(Ld.TextDetails); if (!Cache.Items.HaveDeals(Ld.Id)) CatalogPage.AppendString(Ld.TextTeaser); CatalogPage.AppendInt32(0); break; case "VIPage": if (Ld.Name == "VIP Club") { CatalogPage.AppendString("vip_buy"); } else if (Ld.Name == "VIP Club as Gift") { CatalogPage.AppendString("vip_gift"); } CatalogPage.AppendInt32(2); CatalogPage.AppendString(Ld.HeadLine); CatalogPage.AppendString(Ld.PageTeaser); CatalogPage.AppendInt32(0); CatalogPage.AppendInt32(0); CatalogPage.AppendBreak(); BuildCatalog.AppendPacket(CatalogPage); break; case "VIPGifts": CatalogPage.AppendString("club_gifts"); CatalogPage.AppendInt32(1); CatalogPage.AppendString("ctlg_buy_vip_header"); CatalogPage.AppendInt32(1); CatalogPage.AppendString(""); CatalogPage.AppendInt32(0); break; case "pets2": CatalogPage.AppendString("pets"); CatalogPage.AppendInt32(2); CatalogPage.AppendString(Ld.HeadLine); CatalogPage.AppendString(Ld.PageTeaser); CatalogPage.AppendInt32(4); CatalogPage.AppendString(Ld.Text); CatalogPage.AppendString(Ld.AnotherText); CatalogPage.AppendString(Ld.TextDetails); CatalogPage.AppendString(Ld.TextSpecial); Console.WriteLine("Estamos aka"); break; case "pet3": CatalogPage.AppendString("petcustomization"); CatalogPage.AppendInt32(2); CatalogPage.AppendString(Ld.HeadLine); // CatalogPage.AppendString(Ld.PageTeaser); CatalogPage.AppendString(Ld.TextSpecial); CatalogPage.AppendInt32(3); CatalogPage.AppendString(Ld.Text); CatalogPage.AppendString(Ld.AnotherText); CatalogPage.AppendString(Ld.TextDetails); break; case "lost_monkey": CatalogPage.AppendString("monkey"); CatalogPage.AppendInt32(3); CatalogPage.AppendString(Ld.HeadLine); CatalogPage.AppendString(Ld.PageTeaser); CatalogPage.AppendString(Ld.TextSpecial); CatalogPage.AppendInt32(1); CatalogPage.AppendString(Ld.Text); CatalogPage.AppendString(""); CatalogPage.AppendString(""); break; case "music": #region Music CatalogPage.AppendString("soundmachine"); CatalogPage.AppendInt32(2); CatalogPage.AppendString(Ld.HeadLine); CatalogPage.AppendString(Ld.PageTeaser); CatalogPage.AppendInt32(2); CatalogPage.AppendString(Ld.Text); CatalogPage.AppendString(Ld.TextDetails); #endregion break; case "guild": #region guild CatalogPage.AppendString("guild_frontpage"); CatalogPage.AppendInt32(2); CatalogPage.AppendString(Ld.HeadLine); CatalogPage.AppendString(Ld.PageTeaser); CatalogPage.AppendInt32(3); CatalogPage.AppendString("Habbo Groups are a great way to stay in touch with your friends and share your interests with others. Each Group has a homeroom that can be decorated by other Group members, members can also purchase exclusive Group Furni that can be customised with your Group colours!\n * Get together with people you get together with!\n * Co-op room decorating for group members\n * Show off your group badge!\n * Get some neat Furni in your group's colors!"); CatalogPage.AppendString(""); CatalogPage.AppendString(""); CatalogPage.AppendInt32(0); #endregion break; case "spacepage": CatalogPage.AppendString("spaces_new"); CatalogPage.AppendInt32(1); CatalogPage.AppendString(Ld.HeadLine); CatalogPage.AppendInt32(1); CatalogPage.AppendString(Ld.Text); break; } if (Ld.Extra == "VIPage") { if (Ld.Name == "VIP Club") { #region Cuerpo del packet ServerMessage VipButons = new ServerMessage(Headers.PageVipInit); VipButons.AppendInt32(5); VipButons.AppendInt32(10735); // Item Id?? VipButons.AppendString("HABBO_CLUB_VIP_1_DAY"); VipButons.AppendInt32(2); VipButons.AppendBoolean(true); VipButons.AppendInt32(0); VipButons.AppendInt32(1); // Días VipButons.AppendInt32(1); // Días VipButons.AppendInt32(2011); VipButons.AppendInt32(12); VipButons.AppendInt32(22); VipButons.AppendInt32(10734); VipButons.AppendString("HABBO_CLUB_VIP_7_DAYS"); VipButons.AppendInt32(10); VipButons.AppendBoolean(true); VipButons.AppendInt32(0); VipButons.AppendInt32(7); // Días VipButons.AppendInt32(7); // Días VipButons.AppendInt32(2011); VipButons.AppendInt32(12); VipButons.AppendInt32(0); VipButons.AppendInt32(10733); VipButons.AppendString("HABBO_CLUB_VIP_3_DAYS"); VipButons.AppendInt32(5); VipButons.AppendBoolean(true); VipButons.AppendInt32(0); VipButons.AppendInt32(3); // Días VipButons.AppendInt32(3); // Días VipButons.AppendInt32(2011); VipButons.AppendInt32(12); VipButons.AppendInt32(24); VipButons.AppendInt32(4898); VipButons.AppendString("HABBO_CLUB_VIP_1_MONTH"); VipButons.AppendInt32(25); // COST VipButons.AppendBoolean(true); VipButons.AppendInt32(1); VipButons.AppendInt32(0); // Días VipButons.AppendInt32(0); // Días VipButons.AppendInt32(2012); VipButons.AppendInt32(1); VipButons.AppendInt32(21); VipButons.AppendInt32(19); //////////// ?? VipButons.AppendString("HABBO_CLUB_VIP_3_MONTHS"); VipButons.AppendInt32(60); // COST VipButons.AppendBoolean(true); VipButons.AppendInt32(3); VipButons.AppendInt32(0); // Días VipButons.AppendInt32(0); // Días VipButons.AppendInt32(2012); VipButons.AppendInt32(3); VipButons.AppendInt32(23); VipButons.AppendInt32(1); BuildCatalog.AppendPacket(VipButons); #endregion } else if (Ld.Name == "VIP Club as Gift") { #region Cuerpo del packet ServerMessage VipButons = new ServerMessage(Headers.PageVipInit); VipButons.AppendInt32(5); VipButons.AppendInt32(10735); // Item Id?? VipButons.AppendString("HABBO_CLUB_VIP_1_DAY"); VipButons.AppendInt32(2); VipButons.AppendBoolean(true); VipButons.AppendInt32(0); VipButons.AppendInt32(1); // Días VipButons.AppendInt32(1); // Días VipButons.AppendInt32(2011); VipButons.AppendInt32(12); VipButons.AppendInt32(22); VipButons.AppendInt32(10734); VipButons.AppendString("HABBO_CLUB_VIP_7_DAYS"); VipButons.AppendInt32(10); VipButons.AppendBoolean(true); VipButons.AppendInt32(0); VipButons.AppendInt32(7); // Días VipButons.AppendInt32(7); // Días VipButons.AppendInt32(2011); VipButons.AppendInt32(12); VipButons.AppendInt32(0); VipButons.AppendInt32(10733); VipButons.AppendString("HABBO_CLUB_VIP_3_DAYS"); VipButons.AppendInt32(5); VipButons.AppendBoolean(true); VipButons.AppendInt32(0); VipButons.AppendInt32(3); // Días VipButons.AppendInt32(3); // Días VipButons.AppendInt32(2011); VipButons.AppendInt32(12); VipButons.AppendInt32(24); VipButons.AppendInt32(4898); VipButons.AppendString("HABBO_CLUB_VIP_1_MONTH"); VipButons.AppendInt32(25); // COST VipButons.AppendBoolean(true); VipButons.AppendInt32(1); VipButons.AppendInt32(0); // Días VipButons.AppendInt32(0); // Días VipButons.AppendInt32(2012); VipButons.AppendInt32(1); VipButons.AppendInt32(21); VipButons.AppendInt32(19); //////////// ?? VipButons.AppendString("HABBO_CLUB_VIP_3_MONTHS"); VipButons.AppendInt32(60); // COST VipButons.AppendBoolean(true); VipButons.AppendInt32(3); VipButons.AppendInt32(0); // Días VipButons.AppendInt32(0); // Días VipButons.AppendInt32(2012); VipButons.AppendInt32(3); VipButons.AppendInt32(23); VipButons.AppendInt32(1); BuildCatalog.AppendPacket(VipButons); #endregion } } else { List<Cache.Items> ActualItems = Cache.Items.GetItemsForPageId(Ld.Id); CatalogPage.AppendInt32(ActualItems.Count); foreach (Cache.Items eItem in ActualItems) { this.SerializeCatalogItem(CatalogPage, Ld, eItem); } } if (Ld.Extra != "VIPage" || Ld.Extra != "VIPGifts") { CatalogPage.AppendBreak(); BuildCatalog.AppendPacket(CatalogPage); } User.sendPacket(BuildCatalog); } #endregion }
internal void UpdateLook() { #region Packet string Gender = "M"; if (User.ActualClientMessage.GetNextString() == "F") Gender = "F"; string NewLook = User.ActualClientMessage.GetNextString(); MySQL Lol = new MySQL(Init.ServerMySQL); Lol.Query("UPDATE users_characters SET figure = '" + NewLook + "', gender = '" + Gender + "' WHERE id = '" + this.UserRow["id"] + "'"); this.UserRow["figure"] = NewLook; this.UserRow["gender"] = Gender; ServerMessage SUpdateInRoom = new ServerMessage(1567); SUpdateInRoom.AppendBreak(); SUpdateInRoom.AppendString(NewLook); SUpdateInRoom.AppendString(Gender.ToLower()); SUpdateInRoom.AppendString(this.UserRow["motto"]); SUpdateInRoom.AppendInt32(0); User.sendPacket(SUpdateInRoom); /* ServerMessage SUpdateInRoom2 = new ServerMessage(1567); SUpdateInRoom.AppendInt32(User.connectionID); SUpdateInRoom.AppendString(UserRow["figure"]); SUpdateInRoom.AppendString(UserRow["gender"].ToString().ToLower()); SUpdateInRoom2.AppendString(this.UserRow["motto"]); SUpdateInRoom2.AppendInt32(0); //StaticGame.SendPacketToAllRoom(this, SUpdateInRoom); User.sendPacket(SUpdateInRoom2); */ #endregion }