internal void FourthRequest() { DataRow Row = GetRoom(User.HabboUser.CurrentRoomId); BuildMessage NewBuild = new BuildMessage(); ServerMessage Extra3 = new ServerMessage(Headers.INSERTU); foreach (User Rowf in UserManager._Users.Values) { Extra3.AppendInt32(1); Extra3.AppendInt32(Rowf.connectionID); Extra3.AppendInt32(Rowf.HabboUser.X); Extra3.AppendInt32(Rowf.HabboUser.Y); Extra3.AppendString(Rowf.HabboUser.Z); Extra3.AppendInt32(2); Extra3.AppendInt32(2); Extra3.AppendString("/flatctrl 4//"); } NewBuild.AppendPacket(Extra3); ServerMessage Extra4 = new ServerMessage(Headers.EXTRA4); Extra4.AppendInt32(0); NewBuild.AppendPacket(Extra4); ServerMessage Message = new ServerMessage(Headers.ROOMINFOO); Message.AppendBoolean(true); Message.AppendInt32((int)Row["id"]); Message.AppendBoolean(false); // events Message.AppendString((string)Row["name"]); Message.AppendInt32((int)Row["ownerid"]); Message.AppendString("Xdr"); Message.AppendInt32(0); Message.AppendInt32((int)Row["usersnow"]); Message.AppendInt32(Row["id"]); Message.AppendString(Row["description"]); Message.AppendInt32(0); Message.AppendInt32((Convert.ToInt32(Row["category"]) == 3) ? 0 : 2); Message.AppendInt32(Row["score"]); Message.AppendInt32(Row["category"]); Message.AppendString(""); Message.AppendInt32(0); Message.AppendInt32(0); Message.AppendInt32(0); // tags count //foreach (string D in Data.TagList) // Message.AppendString(D); Message.AppendInt32(0); Message.AppendInt32(0); Message.AppendInt32(0); // booleans Message.AppendBoolean(true); Message.AppendBoolean(true); Message.AppendBoolean(false); Message.AppendBoolean(false); Message.AppendBoolean(false); NewBuild.AppendPacket(Message); 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 sendPacket(BuildMessage Message) { if (Message.ToString().Length > 0) { if (Message == null) { return; } Game.sendData(Message.ToBytes()); } }
internal void LoadModel() { try { BuildMessage CollectMaps = new BuildMessage(); DataRow Row = GetRoom(User.HabboUser.CurrentRoomId); Cache.Models GetModel = Cache.Models.RoomModelByName[Row["model"].ToString()]; ServerMessage ModelHeightMap = new ServerMessage(Headers.HEIGHTMAP); ModelHeightMap.AppendString(GetModel.GetPremairParams()); CollectMaps.AppendPacket(ModelHeightMap); ServerMessage ModelAnothers = new ServerMessage(Headers.ANOTHERMAP); ModelAnothers.AppendString(GetModel.GetSecondairParams()); CollectMaps.AppendPacket(ModelAnothers); User.sendPacket(CollectMaps); } catch { } }
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); }
internal void LoadRoom() { int RoomId = User.ActualClientMessage.GetNextInt(); MySQL RoomsRow = new MySQL(Init.ServerMySQL); RoomsRow.Query("SELECT * FROM rooms WHERE id = '" + RoomId + "' LIMIT 1"); Out.WriteLine(RoomsRow.Num_Rows()); if (RoomsRow.Num_Rows() == 1) { DataRow RD = RoomsRow.Fetch_Assoc(); User.HabboUser.CurrentRoomId = RoomId; //Habbo.VisitedRooms += RoomId + ";"; //Habbo.IsOnRoom = true; BuildMessage Load = new BuildMessage(); ServerMessage LoadRooms = new ServerMessage(Headers.LOADROOMS); Load.AppendPacket(LoadRooms); ServerMessage LoadRooms2 = new ServerMessage(1059); LoadRooms2.AppendInt32(77824); LoadRooms2.AppendInt32(513); Load.AppendPacket(LoadRooms2); ServerMessage Model = new ServerMessage(Headers.LOADMODEL); Model.AppendString(RD["model"].ToString()); Model.AppendInt32(RoomId); Load.AppendPacket(Model); if (RD["wall"].ToString() != "0") { ServerMessage SendWallpaper = new ServerMessage(Headers.LOADWALLSFLOORSLANDS); SendWallpaper.AppendString("wallpaper"); SendWallpaper.AppendString(RD["wall"]); Load.AppendPacket(SendWallpaper); } if (RD["floor"].ToString() != "0") { ServerMessage SendFloor = new ServerMessage(Headers.LOADWALLSFLOORSLANDS); SendFloor.AppendString("floor"); SendFloor.AppendString(RD["floor"]); Load.AppendPacket(SendFloor); } ServerMessage SendLandscape = new ServerMessage(Headers.LOADWALLSFLOORSLANDS); SendLandscape.AppendString("landscape"); SendLandscape.AppendString(RD["landscape"] + ".0"); Load.AppendPacket(SendLandscape); ServerMessage Unk = new ServerMessage(Headers.UNK); Unk.AppendInt32(4); Load.AppendPacket(Unk); if (RD["OwnerId"] == User.HabboUser.UserRow["id"]) { ServerMessage LoadPows = new ServerMessage(Headers.LOADPOWS); Load.AppendPacket(LoadPows); } ServerMessage LoadScore = new ServerMessage(Headers.LOADSCORE); LoadScore.AppendInt32((int)RD["score"]); LoadScore.AppendBoolean(false); Load.AppendPacket(LoadScore); ServerMessage LoadEvent = new ServerMessage(Headers.LOADEVENTS); LoadEvent.AppendString("-1"); Load.AppendPacket(LoadEvent); //Habbo.Cache.Rooms; User.sendPacket(Load); } }
internal void AppendBuilder(BuildMessage oB) { AppendPackets.AddRange(oB.ToBytes()); }