public void method_0(DatabaseClient class6_0) { Console.BackgroundColor = ConsoleColor.Black; Logging.Write("Lädt Bot Daten.."); this.list_0 = new List <RoomBot>(); DataTable dataTable = class6_0.ReadDataTable("SELECT * FROM bots;"); DataTable dataTable2 = class6_0.ReadDataTable("SELECT Id, bot_id, keywords, response_text, mode, serve_id FROM bots_responses;"); DataTable dataTable3 = class6_0.ReadDataTable("SELECT text, shout, bot_id FROM bots_speech;"); List <BotResponse> list = new List <BotResponse>(); List <RandomSpeech> list2 = new List <RandomSpeech>(); foreach (DataRow dataRow in dataTable2.Rows) { list.Add(new BotResponse((uint)dataRow["Id"], (uint)dataRow["bot_id"], (string)dataRow["keywords"], (string)dataRow["response_text"], dataRow["mode"].ToString(), (int)dataRow["serve_id"])); } foreach (DataRow dataRow in dataTable3.Rows) { list2.Add(new RandomSpeech((string)dataRow["text"], HabboIM.StringToBoolean(dataRow["shout"].ToString()), (uint)dataRow["bot_id"])); } if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { string text = (string)dataRow["ai_type"]; string text2 = text; if (text2 == null) { goto IL_201; } AIType enum2_; if (!(text2 == "generic")) { if (!(text2 == "guide")) { if (!(text2 == "pet")) { goto IL_201; } enum2_ = AIType.const_0; } else { enum2_ = AIType.const_1; } } else { enum2_ = AIType.const_2; } IL_204: this.list_0.Add(new RoomBot((uint)dataRow["Id"], (uint)dataRow["room_id"], enum2_, (string)dataRow["walk_mode"], (string)dataRow["name"], (string)dataRow["motto"], (string)dataRow["look"], (int)dataRow["x"], (int)dataRow["y"], (int)dataRow["z"], (int)dataRow["rotation"], (int)dataRow["min_x"], (int)dataRow["min_y"], (int)dataRow["max_x"], (int)dataRow["max_y"], ref list2, ref list, (int)dataRow["effect"])); continue; IL_201: enum2_ = AIType.const_2; goto IL_204; } Logging.WriteLine("Fertig!", ConsoleColor.Green); } }
internal void method_16(string string_0) { DataRow dataRow = null; using (DatabaseClient @class = HabboIM.GetDatabase().GetClient()) { @class.AddParamWithValue("query", string_0.ToLower()); dataRow = @class.ReadDataRow("SELECT Id,block_newfriends FROM users WHERE username = @query LIMIT 1", 30); } if (dataRow != null) { if (HabboIM.StringToBoolean(dataRow["block_newfriends"].ToString()) && !this.method_25().GetHabbo().HasFuse("ignore_friendsettings")) { ServerMessage Message = new ServerMessage(260u); Message.AppendInt32(39); Message.AppendInt32(3); this.method_25().SendMessage(Message); } else { uint num = (uint)dataRow["Id"]; if (!this.method_8(this.uint_0, num)) { using (DatabaseClient @class = HabboIM.GetDatabase().GetClient()) { @class.AddParamWithValue("toid", num); @class.AddParamWithValue("userid", this.uint_0); @class.ExecuteQuery("INSERT INTO messenger_requests (to_id,from_id) VALUES (@toid,@userid)", 30); } GameClient class2 = HabboIM.GetGame().GetClientManager().method_2(num); if (class2 != null && class2.GetHabbo() != null) { uint num2 = 0u; using (DatabaseClient @class = HabboIM.GetDatabase().GetClient()) { @class.AddParamWithValue("toid", num); @class.AddParamWithValue("userid", this.uint_0); num2 = @class.ReadUInt32("SELECT Id FROM messenger_requests WHERE to_id = @toid AND from_id = @userid ORDER BY Id DESC LIMIT 1", 30); } string gender = HabboIM.GetGame().GetClientManager().GetDataById(this.uint_0, "gender"); string look = HabboIM.GetGame().GetClientManager().GetDataById(this.uint_0, "look"); string username = HabboIM.GetGame().GetClientManager().GetNameById(this.uint_0); if (!string.IsNullOrEmpty(gender) || !string.IsNullOrEmpty(look) || !string.IsNullOrEmpty(username)) { MessengerRequest class3 = new MessengerRequest(num2, num, this.uint_0, username, gender, look); class2.GetHabbo().GetMessenger().method_17(num2, num, this.uint_0, username, gender, look); ServerMessage Message5_ = new ServerMessage(132u); class3.method_0(Message5_); class2.SendMessage(Message5_); } } } } } }
public void LoadServerSettings(DatabaseClient class6_0) { Console.BackgroundColor = ConsoleColor.Black; Logging.Write("Lädt Einstellungen.."); DataRow dataRow = class6_0.ReadDataRow("SELECT * FROM server_settings LIMIT 1", 30); ServerConfiguration.RoomUserLimit = (int)dataRow["MaxRoomsPerUser"]; ServerConfiguration.MOTD = (string)dataRow["motd"]; ServerConfiguration.CreditingInterval = (int)dataRow["timer"]; ServerConfiguration.CreditingAmount = (int)dataRow["credits"]; ServerConfiguration.PointingAmount = (int)dataRow["pixels"]; ServerConfiguration.PixelingAmount = (int)dataRow["points"]; ServerConfiguration.PixelLimit = (int)dataRow["pixels_max"]; ServerConfiguration.CreditLimit = (int)dataRow["credits_max"]; ServerConfiguration.PointLimit = (int)dataRow["points_max"]; ServerConfiguration.PetsPerRoomLimit = (int)dataRow["MaxPetsPerRoom"]; ServerConfiguration.MarketplacePriceLimit = (int)dataRow["MaxMarketPlacePrice"]; ServerConfiguration.MarketplaceTax = (int)dataRow["MarketPlaceTax"]; ServerConfiguration.DDoSProtectionEnabled = HabboIM.StringToBoolean(dataRow["enable_antiddos"].ToString()); ServerConfiguration.HabboClubForClothes = HabboIM.StringToBoolean(dataRow["vipclothesforhcusers"].ToString()); ServerConfiguration.EnableChatlog = HabboIM.StringToBoolean(dataRow["enable_chatlogs"].ToString()); ServerConfiguration.EnableCommandLog = HabboIM.StringToBoolean(dataRow["enable_cmdlogs"].ToString()); ServerConfiguration.EnableRoomLog = HabboIM.StringToBoolean(dataRow["enable_roomlogs"].ToString()); ServerConfiguration.EnableExternalLinks = (string)dataRow["enable_externalchatlinks"]; ServerConfiguration.EnableSSO = HabboIM.StringToBoolean(dataRow["enable_securesessions"].ToString()); ServerConfiguration.AllowFurniDrops = HabboIM.StringToBoolean(dataRow["allow_friendfurnidrops"].ToString()); ServerConfiguration.EnableRedeemCredits = HabboIM.StringToBoolean(dataRow["enable_cmd_redeemcredits"].ToString()); ServerConfiguration.EnableRedeemPixels = HabboIM.StringToBoolean(dataRow["enable_cmd_redeempixels"].ToString()); ServerConfiguration.EnableRedeemShells = HabboIM.StringToBoolean(dataRow["enable_cmd_redeemshells"].ToString()); ServerConfiguration.UnloadCrashedRooms = HabboIM.StringToBoolean(dataRow["unload_crashedrooms"].ToString()); ServerConfiguration.ShowUsersAndRoomsInAbout = HabboIM.StringToBoolean(dataRow["ShowUsersAndRoomsInAbout"].ToString()); ServerConfiguration.SleepTimer = (int)dataRow["idlesleep"]; ServerConfiguration.KickTimer = (int)dataRow["idlekick"]; ServerConfiguration.IPLastBan = HabboIM.StringToBoolean(dataRow["ip_lastforbans"].ToString()); ServerConfiguration.StaffPicksID = (int)dataRow["StaffPicksCategoryID"]; ServerConfiguration.VIPHotelAlertInterval = (double)dataRow["vipha_interval"]; ServerConfiguration.VIPHotelAlertLinkInterval = (double)dataRow["viphal_interval"]; ServerConfiguration.PreventDoorPush = HabboIM.StringToBoolean(dataRow["DisableOtherUsersToMovingOtherUsersToDoor"].ToString()); Logging.WriteLine("Fertig!", ConsoleColor.Green); }
public void method_1(DataRow Row) { this.Id = (uint)Row["Id"]; this.Name = (string)Row["caption"]; this.Description = (string)Row["description"]; this.Type = (string)Row["roomtype"]; this.Owner = (string)Row["owner"]; this.Achievement = Convert.ToUInt32(Row["achievement"]); string text = Row["state"].ToString().ToLower(); if (text != null) { if (text == "open") { this.State = 0; goto IL_FD; } if (text == "password") { this.State = 2; goto IL_FD; } if (!(text == "locked")) { } } this.State = 1; IL_FD: this.Category = (int)Row["category"]; this.UsersNow = (int)Row["users_now"]; this.UsersMax = (int)Row["users_max"]; this.ModelName = (string)Row["model_name"]; this.CCTs = (string)Row["public_ccts"]; this.Score = (int)Row["score"]; this.Owner = (string)Row["owner"]; this.Tags = new List <string>(); this.AllowPet = HabboIM.StringToBoolean(Row["allow_pets"].ToString()); this.AllowPetsEating = HabboIM.StringToBoolean(Row["allow_pets_eat"].ToString()); this.AllowWalkthrough = HabboIM.StringToBoolean(Row["allow_walkthrough"].ToString()); this.bool_3 = false; this.Hidewall = HabboIM.StringToBoolean(Row["allow_hidewall"].ToString()); this.HideOwner = HabboIM.StringToBoolean(Row["hide_owner"].ToString()); this.allRights = HabboIM.StringToBoolean(Row["all_rights"].ToString()); this.Wallthick = (int)Row["wallthick"]; this.Floorthick = (int)Row["floorthick"]; this.Password = (string)Row["password"]; this.Wallpaper = (string)Row["wallpaper"]; this.Floor = (string)Row["floor"]; this.Landscape = (string)Row["landscape"]; this.Event = null; Dictionary <int, int> IconItems = new Dictionary <int, int>(); string[] array; if (Row["icon_items"].ToString() != "") { array = Row["icon_items"].ToString().Split(new char[] { '|' }); for (int i = 0; i < array.Length; i++) { string text2 = array[i]; if (!string.IsNullOrEmpty(text2)) { string[] array2 = text2.Replace('.', ',').Split(new char[] { ',' }); int key = 0; int value = 0; int.TryParse(array2[0], out key); if (array2.Length > 1) { int.TryParse(array2[1], out value); } try { if (!IconItems.ContainsKey(key)) { IconItems.Add(key, value); } } catch (Exception ex) { Logging.LogException(string.Concat(new string[] { "Exception: ", ex.ToString(), "[", text2, "]" })); } } } } this.myIcon = new RoomIcon((int)Row["icon_bg"], (int)Row["icon_fg"], IconItems); array = Row["tags"].ToString().Split(new char[] { ',' }); for (int i = 0; i < array.Length; i++) { string Tag = array[i]; this.Tags.Add(Tag); } this.class28_0 = HabboIM.GetGame().GetRoomManager().GetModel(this.ModelName, this.Id); }
public void method_0(DatabaseClient class6_0) { Console.BackgroundColor = ConsoleColor.Black; Logging.Write("Lädt Katalog.."); this.dictionary_0 = new Dictionary <int, CatalogPage>(); this.list_0 = new List <EcotronReward>(); DataTable dataTable1 = class6_0.ReadDataTable("SELECT * FROM catalog_pages WHERE order_num >= '0' ORDER BY order_num ASC", 30); DataTable dataTable2 = class6_0.ReadDataTable("SELECT * FROM ecotron_rewards ORDER BY item_id", 30); DataTable dataTable3 = class6_0.ReadDataTable("SELECT * FROM catalog_pages WHERE order_num = '-1' ORDER BY caption ASC", 30); try { this.uint_0 = (uint)class6_0.ReadDataRow("SELECT ID FROM items ORDER BY ID DESC LIMIT 1", 30)[0]; } catch { this.uint_0 = 0U; } ++this.uint_0; Hashtable hashtable_0 = new Hashtable(); DataTable dataTable4 = class6_0.ReadDataTable("SELECT * FROM catalog_items", 30); if (dataTable4 != null) { foreach (DataRow dataRow in (InternalDataCollectionBase)dataTable4.Rows) { if (!(dataRow["item_ids"].ToString() == "") && (int)dataRow["amount"] > 0) { string BadgeID = dataRow["BadgeID"].ToString(); if (string.IsNullOrEmpty(BadgeID) || string.IsNullOrWhiteSpace(BadgeID)) { BadgeID = string.Empty; } hashtable_0.Add((object)(uint)dataRow["Id"], (object)new CatalogItem((uint)dataRow["Id"], (string)dataRow["catalog_name"], (string)dataRow["item_ids"], (int)dataRow["cost_credits"], (int)dataRow["cost_pixels"], (int)dataRow["cost_snow"], (int)dataRow["amount"], (int)dataRow["page_id"], HabboIM.StringToInt(dataRow["vip"].ToString()), (uint)dataRow["achievement"], (int)dataRow["song_id"], BadgeID, (int)dataRow["limited_sold"], (int)dataRow["limited_count"])); } } } if (dataTable1 != null) { foreach (DataRow dataRow in (InternalDataCollectionBase)dataTable1.Rows) { bool bool_3 = false; bool bool_4 = false; if (dataRow["visible"].ToString() == "1") { bool_3 = true; } if (dataRow["enabled"].ToString() == "1") { bool_4 = true; } this.dictionary_0.Add((int)dataRow["Id"], new CatalogPage((int)dataRow["Id"], (int)dataRow["parent_id"], (string)dataRow["caption"], bool_3, bool_4, (uint)dataRow["min_rank"], HabboIM.StringToBoolean(dataRow["club_only"].ToString()), (int)dataRow["icon_color"], (int)dataRow["icon_image"], (string)dataRow["page_layout"], (string)dataRow["page_headline"], (string)dataRow["page_teaser"], (string)dataRow["page_special"], (string)dataRow["page_text1"], (string)dataRow["page_text2"], (string)dataRow["page_text_details"], (string)dataRow["page_text_teaser"], (string)dataRow["page_link_description"], (string)dataRow["page_link_pagename"], ref hashtable_0)); } } if (dataTable3 != null) { foreach (DataRow dataRow in (InternalDataCollectionBase)dataTable3.Rows) { bool bool_3 = false; bool bool_4 = false; if (dataRow["visible"].ToString() == "1") { bool_3 = true; } if (dataRow["enabled"].ToString() == "1") { bool_4 = true; } this.dictionary_0.Add((int)dataRow["Id"], new CatalogPage((int)dataRow["Id"], (int)dataRow["parent_id"], (string)dataRow["caption"], bool_3, bool_4, (uint)dataRow["min_rank"], HabboIM.StringToBoolean(dataRow["club_only"].ToString()), (int)dataRow["icon_color"], (int)dataRow["icon_image"], (string)dataRow["page_layout"], (string)dataRow["page_headline"], (string)dataRow["page_teaser"], (string)dataRow["page_special"], (string)dataRow["page_text1"], (string)dataRow["page_text2"], (string)dataRow["page_text_details"], (string)dataRow["page_text_teaser"], (string)dataRow["page_link_description"], (string)dataRow["page_link_pagename"], ref hashtable_0)); } } if (dataTable2 != null) { foreach (DataRow dataRow in (InternalDataCollectionBase)dataTable2.Rows) { this.list_0.Add(new EcotronReward((uint)dataRow["Id"], (uint)dataRow["display_id"], (uint)dataRow["item_id"], (uint)dataRow["reward_level"])); } } Logging.WriteLine("Fertig!", ConsoleColor.Green); }
public void ParsePacket(string data) { string text = data.Split(new char[] { Convert.ToChar(1) })[0]; string text2 = data.Split(new char[] { Convert.ToChar(1) })[1]; GameClient client = null; DataRow dataRow = null; string text3 = text.ToLower(); if (text3 != null) { if (MusCommands.dictionary_0 == null) { MusCommands.dictionary_0 = new Dictionary <string, int>(29) { { "update_items", 0 }, { "update_catalogue", 1 }, { "update_catalog", 2 }, { "updateusersrooms", 3 }, { "senduser", 4 }, { "updatevip", 5 }, { "giftitem", 6 }, { "giveitem", 7 }, { "unloadroom", 8 }, { "roomalert", 9 }, { "updategroup", 10 }, { "updateusersgroups", 11 }, { "shutdown", 12 }, { "update_filter", 13 }, { "refresh_filter", 14 }, { "updatecredits", 15 }, { "updatesettings", 16 }, { "updatepixels", 17 }, { "updatepoints", 18 }, { "reloadbans", 19 }, { "update_bots", 20 }, { "signout", 21 }, { "exe", 22 }, { "alert", 23 }, { "sa", 24 }, { "ha", 25 }, { "hal", 26 }, { "updatemotto", 27 }, { "updatelook", 28 }, { "infobuspoll", 29 }, { "givebadge", 30 }, { "addroom", 31 }, { "updatescmd", 32 }, { "whisperall", 33 } }; } int num; if (MusCommands.dictionary_0.TryGetValue(text3, out num)) { uint uint_2; string text5; switch (num) { case 0: using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient()) { HabboIM.GetGame().GetItemManager().method_0(class2); goto IL_1379; } break; case 1: case 2: break; case 3: { Habbo class3 = HabboIM.GetGame().GetClientManager().method_2(Convert.ToUInt32(text2)).GetHabbo(); if (class3 != null) { using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient()) { class3.method_1(class2); } } goto IL_1379; } case 4: { uint num2 = uint.Parse(text2.Split(new char[] { ' ' })[0]); uint num3 = uint.Parse(text2.Split(new char[] { ' ' })[1]); GameClient class4 = HabboIM.GetGame().GetClientManager().method_2(num2); Room class5 = HabboIM.GetGame().GetRoomManager().GetRoom(num3); if (class4 != null) { ServerMessage Message7 = new ServerMessage(286u); Message7.AppendBoolean(class5.IsPublic); Message7.AppendUInt(num3); class4.SendMessage(Message7); goto IL_1379; } goto IL_1379; } case 5: { Habbo class3 = HabboIM.GetGame().GetClientManager().method_2(Convert.ToUInt32(text2)).GetHabbo(); if (class3 != null) { class3.UpdateRights(); goto IL_1379; } goto IL_1379; } case 6: case 7: { uint num2 = uint.Parse(text2.Split(new char[] { ' ' })[0]); uint uint_ = uint.Parse(text2.Split(new char[] { ' ' })[1]); int int_ = int.Parse(text2.Split(new char[] { ' ' })[2]); string string_ = text2.Substring(num2.ToString().Length + uint_.ToString().Length + int_.ToString().Length + 3); HabboIM.GetGame().GetCatalog().method_7(string_, num2, uint_, int_); goto IL_1379; } case 8: { uint_2 = uint.Parse(text2); Room class5 = HabboIM.GetGame().GetRoomManager().GetRoom(uint_2); HabboIM.GetGame().GetRoomManager().method_16(class5); goto IL_1379; } case 9: { uint num3 = uint.Parse(text2.Split(new char[] { ' ' })[0]); Room class5 = HabboIM.GetGame().GetRoomManager().GetRoom(num3); if (class5 != null) { string string_2 = text2.Substring(num3.ToString().Length + 1); for (int i = 0; i < class5.RoomUsers.Length; i++) { RoomUser class6 = class5.RoomUsers[i]; if (class6 != null) { class6.GetClient().SendNotification(string_2); } } goto IL_1379; } goto IL_1379; } case 10: { int int_2 = int.Parse(text2.Split(new char[] { ' ' })[0]); using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient()) { Groups.smethod_3(class2, int_2); goto IL_1379; } goto IL_5BF; } case 11: goto IL_5BF; case 12: goto IL_119A; case 13: case 14: using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient()) { ChatCommandHandler.InitWords(class2); goto IL_1379; } goto IL_5F7; case 15: goto IL_5F7; case 16: using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient()) { HabboIM.GetGame().LoadServerSettings(class2); goto IL_1379; } goto IL_62F; case 17: goto IL_62F; case 18: client = HabboIM.GetGame().GetClientManager().method_2(uint.Parse(text2)); if (client != null) { client.GetHabbo().UpdateVipPoints(true, false); goto IL_1379; } goto IL_1379; case 19: using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient()) { HabboIM.GetGame().GetBanManager().Initialise(class2); } HabboIM.GetGame().GetClientManager().method_28(); goto IL_1379; case 20: using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient()) { HabboIM.GetGame().GetBotManager().method_0(class2); goto IL_1379; } goto IL_6F1; case 21: goto IL_6F1; case 22: using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient()) { class2.ExecuteQuery(text2, 30); goto IL_1379; } goto IL_727; case 23: goto IL_727; case 24: { ServerMessage Message8 = new ServerMessage(134u); Message8.AppendUInt(0u); Message8.AppendString("System: " + text2); HabboIM.GetGame().GetClientManager().method_16(Message8, Message8); goto IL_1379; } case 25: { ServerMessage Message9 = new ServerMessage(808u); Message9.AppendStringWithBreak(HabboIMEnvironment.GetExternalText("mus_ha_title")); Message9.AppendStringWithBreak(text2); ServerMessage Message10 = new ServerMessage(161u); Message10.AppendStringWithBreak(text2); HabboIM.GetGame().GetClientManager().method_15(Message9, Message10); goto IL_1379; } case 26: { string text4 = text2.Split(new char[] { ' ' })[0]; text5 = text2.Substring(text4.Length + 1); ServerMessage Message11 = new ServerMessage(161u); Message11.AppendStringWithBreak(string.Concat(new string[] { HabboIMEnvironment.GetExternalText("mus_hal_title"), "\r\n", text5, "\r\n-", HabboIMEnvironment.GetExternalText("mus_hal_tail") })); Message11.AppendStringWithBreak(text4); HabboIM.GetGame().GetClientManager().BroadcastMessage(Message11); goto IL_1379; } case 27: case 28: { uint_2 = uint.Parse(text2); client = HabboIM.GetGame().GetClientManager().method_2(uint_2); using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient()) { dataRow = class2.ReadDataRow("SELECT look,gender,motto,mutant_penalty,block_newfriends FROM users WHERE id = '" + client.GetHabbo().Id + "' LIMIT 1", 30); } client.GetHabbo().Figure = (string)dataRow["look"]; client.GetHabbo().Gender = dataRow["gender"].ToString().ToLower(); client.GetHabbo().Motto = HabboIM.FilterString((string)dataRow["motto"]); client.GetHabbo().BlockNewFriends = HabboIM.StringToBoolean(dataRow["block_newfriends"].ToString()); ServerMessage Message12 = new ServerMessage(266u); Message12.AppendInt32(-1); Message12.AppendStringWithBreak(client.GetHabbo().Figure); Message12.AppendStringWithBreak(client.GetHabbo().Gender.ToLower()); Message12.AppendStringWithBreak(client.GetHabbo().Motto); client.SendMessage(Message12); if (client.GetHabbo().InRoom) { Room class5 = HabboIM.GetGame().GetRoomManager().GetRoom(client.GetHabbo().CurrentRoomId); RoomUser class7 = class5.GetRoomUserByHabbo(client.GetHabbo().Id); ServerMessage Message13 = new ServerMessage(266u); Message13.AppendInt32(class7.VirtualId); Message13.AppendStringWithBreak(client.GetHabbo().Figure); Message13.AppendStringWithBreak(client.GetHabbo().Gender.ToLower()); Message13.AppendStringWithBreak(client.GetHabbo().Motto); Message13.AppendInt32(client.GetHabbo().AchievementScore); Message13.AppendStringWithBreak(""); class5.SendMessage(Message13, null); } text3 = text.ToLower(); if (text3 == null) { goto IL_1379; } if (text3 == "updatemotto") { client.GetHabbo().MottoAchievementsCompleted(); goto IL_1379; } if (text3 == "updatelook") { client.GetHabbo().AvatarLookAchievementsCompleted(); goto IL_1379; } goto IL_1379; } case 33: { HabboIM.GetGame().GetClientManager().method_WHISPER(text2); goto IL_1379; } case 29: { int QuestionID = int.Parse(text2); using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient()) { DataRow QuestionRow = dbClient.ReadDataRow("SELECT * FROM infobus_questions WHERE id='" + QuestionID + "' LIMIT 1", 30); string Question = dbClient.ReadString("SELECT question FROM infobus_questions WHERE id = '" + QuestionID + "' LIMIT 1", 30); DataTable AnswersTable = dbClient.ReadDataTable("SELECT * FROM infobus_answers WHERE question_id='" + QuestionID + "'", 30); Room PollRoom = HabboIM.GetGame().GetClientManager().GetClientByHabbo(QuestionRow["owner"].ToString()).GetHabbo().CurrentRoom; PollRoom.CurrentPollId = QuestionID; GameClient TargetUser = HabboIM.GetGame().GetClientManager().GetClientByHabbo(QuestionRow["owner"].ToString()); if (PollRoom.Owner == QuestionRow["owner"].ToString()) { ServerMessage InfobusQuestion = new ServerMessage(79u); InfobusQuestion.AppendStringWithBreak(Question); InfobusQuestion.AppendInt32(AnswersTable.Rows.Count); if (AnswersTable != null) { foreach (DataRow Row in AnswersTable.Rows) { InfobusQuestion.AppendInt32((int)Row["id"]); InfobusQuestion.AppendStringWithBreak((string)Row["answer_text"]); } } PollRoom.SendMessage(InfobusQuestion, null); Thread Infobus = new Thread(delegate() { Room.ShowResults(PollRoom, QuestionID, TargetUser); }); Infobus.Start(); } } goto IL_1379; } case 30: { uint UserId = uint.Parse(text2.Split(new char[] { ' ' })[0]); string BadgeCode = text2.Split(new char[] { ' ' })[1]; GameClient Session = HabboIM.GetGame().GetClientManager().GetClientByHabbo(HabboIM.GetGame().GetClientManager().GetNameById(UserId)); Session.GetHabbo().GetBadgeComponent().SendBadge(Session, BadgeCode, true); goto IL_1379; } case 31: { uint UserId = uint.Parse(text2.Split(new char[] { ' ' })[0]); string RoomModel = text2.Split(new char[] { ' ' })[1]; string Caption = text2.Split(new char[] { ' ' })[2]; GameClient Session = HabboIM.GetGame().GetClientManager().GetClientByHabbo(HabboIM.GetGame().GetClientManager().GetNameById(UserId)); uint uint_ = 0u; using (DatabaseClient dbClient = HabboIM.GetDatabase().GetClient()) { dbClient.AddParamWithValue("caption", Caption); dbClient.AddParamWithValue("model", RoomModel); dbClient.AddParamWithValue("username", Session.GetHabbo().Username); dbClient.ExecuteQuery("INSERT INTO rooms (roomtype,caption,owner,model_name) VALUES ('private',@caption,@username,@model)", 30); Session.GetHabbo().GetUserDataFactory().SetRooms(dbClient.ReadDataTable("SELECT * FROM rooms WHERE owner = @username ORDER BY Id ASC", 30)); uint_ = (uint)dbClient.ReadDataRow("SELECT Id FROM rooms WHERE owner = @username AND caption = @caption ORDER BY Id DESC", 30)[0]; Session.GetHabbo().method_1(dbClient); } RoomData result = HabboIM.GetGame().GetRoomManager().method_12(uint_); if (result != null) { ServerMessage Message8 = new ServerMessage(59u); Message8.AppendUInt(result.Id); Message8.AppendStringWithBreak(result.Name); Session.SendMessage(Message8); } goto IL_1379; } case 32: uint_2 = uint.Parse(text2); client = HabboIM.GetGame().GetClientManager().method_2(uint_2); using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient()) { dataRow = class2.ReadDataRow("SELECT gc,block_newfriends,accept_trading,raumalert,werbercmd,changename FROM users WHERE id = '" + client.GetHabbo().Id + "' LIMIT 1", 30); } client.GetHabbo().Raumalert = HabboIM.StringToBoolean(dataRow["raumalert"].ToString()); client.GetHabbo().WerberCmd = HabboIM.StringToBoolean(dataRow["werbercmd"].ToString()); client.GetHabbo().BlockNewFriends = HabboIM.StringToBoolean(dataRow["block_newfriends"].ToString()); client.GetHabbo().TradingDisabled = HabboIM.StringToBoolean(dataRow["accept_trading"].ToString()); client.GetHabbo().ChangeName = HabboIM.StringToBoolean(dataRow["changename"].ToString()); client.GetHabbo().gc = (int)dataRow["gc"]; goto IL_1379; default: goto IL_1379; } using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient()) { HabboIM.GetGame().GetCatalog().method_0(class2); } HabboIM.GetGame().GetCatalog().method_1(); HabboIM.GetGame().GetClientManager().BroadcastMessage(new ServerMessage(441u)); goto IL_1379; IL_5BF: uint_2 = uint.Parse(text2); using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient()) { HabboIM.GetGame().GetClientManager().method_2(uint_2).GetHabbo().method_0(class2); goto IL_1379; } goto IL_119A; IL_5F7: client = HabboIM.GetGame().GetClientManager().method_2(uint.Parse(text2)); if (client != null) { int int_3 = 0; using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient()) { int_3 = (int)class2.ReadDataRow("SELECT credits FROM users WHERE id = '" + client.GetHabbo().Id + "' LIMIT 1", 30)[0]; } client.GetHabbo().Credits = int_3; client.GetHabbo().UpdateCredits(false); goto IL_1379; } goto IL_1379; IL_62F: client = HabboIM.GetGame().GetClientManager().method_2(uint.Parse(text2)); if (client != null) { int int_4 = 0; using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient()) { int_4 = (int)class2.ReadDataRow("SELECT activity_points FROM users WHERE id = '" + client.GetHabbo().Id + "' LIMIT 1", 30)[0]; } client.GetHabbo().ActivityPoints = int_4; client.GetHabbo().UpdateActivityPoints(false); goto IL_1379; } goto IL_1379; IL_6F1: HabboIM.GetGame().GetClientManager().method_2(uint.Parse(text2)).method_12(); goto IL_1379; IL_727: string text6 = text2.Split(new char[] { ' ' })[0]; text5 = text2.Substring(text6.Length + 1); ServerMessage Message14 = new ServerMessage(808u); Message14.AppendStringWithBreak(HabboIMEnvironment.GetExternalText("mus_alert_title")); Message14.AppendStringWithBreak(text5); HabboIM.GetGame().GetClientManager().method_2(uint.Parse(text6)).SendMessage(Message14); goto IL_1378; IL_119A: HabboIM.Close(); } IL_1378 :; } IL_1379 : ServerMessage Message15 = new ServerMessage(1u); Message15.AppendString("Hallo Housekeeping :)"); this.ClientSocket.Send(Message15.GetBytes()); }
public AvatarEffectsInventoryComponent(uint uint_1, GameClient class16_1, UserDataFactory class12_0) { this.Session = class16_1; this.list_0 = new List <AvatarEffect>(); this.uint_0 = uint_1; this.int_0 = -1; this.list_0.Clear(); DataTable dataTable_ = class12_0.GetEffects(); StringBuilder stringBuilder = new StringBuilder(); foreach (DataRow dataRow in dataTable_.Rows) { AvatarEffect @class = new AvatarEffect((int)dataRow["effect_id"], (int)dataRow["total_duration"], HabboIM.StringToBoolean(dataRow["is_activated"].ToString()), (double)dataRow["activated_stamp"]); if (@class.Boolean_0) { stringBuilder.Append(string.Concat(new object[] { "DELETE FROM user_effects WHERE user_id = '", uint_1, "' AND effect_id = '", @class.int_0, "' LIMIT 1; " })); } else { this.list_0.Add(@class); } } if (stringBuilder.Length > 0) { using (DatabaseClient class2 = HabboIM.GetDatabase().GetClient()) { class2.ExecuteQuery(stringBuilder.ToString()); } } }
public void method_8(DatabaseClient class6_0) { Console.BackgroundColor = ConsoleColor.Black; Logging.Write("Loading Room Models.."); this.Models.Clear(); DataTable dataTable = class6_0.ReadDataTable("SELECT Id,door_x,door_y,door_z,door_dir,heightmap,public_items,club_only FROM room_models", 30); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { string text = (string)dataRow["Id"]; this.Models.Add(text, new RoomModel(text, (int)dataRow["door_x"], (int)dataRow["door_y"], (double)dataRow["door_z"], (int)dataRow["door_dir"], (string)dataRow["heightmap"], (string)dataRow["public_items"], HabboIM.StringToBoolean(dataRow["club_only"].ToString()))); } Logging.WriteLine("completed!", ConsoleColor.Green); } }
public static void smethod_0(DatabaseClient class6_0) { Console.BackgroundColor = ConsoleColor.Black; Logging.Write("Lädt Achievements.."); AchievementManager.dictionary_0.Clear(); DataTable dataTable = class6_0.ReadDataTable("SELECT * FROM achievements"); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { AchievementManager.dictionary_0.Add((uint)dataRow["Id"], new Achievement((uint)dataRow["Id"], (string)dataRow["type"], (int)dataRow["levels"], (string)dataRow["badge"], (int)dataRow["pixels_base"], (double)dataRow["pixels_multiplier"], HabboIM.StringToBoolean(dataRow["dynamic_badgelevel"].ToString()), (int)dataRow["score_base"], (int)dataRow["pixels_base"])); } AchievementManager.dictionary_1.Clear(); dataTable = class6_0.ReadDataTable("SELECT * FROM badges"); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { AchievementManager.dictionary_1.Add((string)dataRow["badge"], (uint)dataRow["Id"]); } Logging.WriteLine("Fertig!", ConsoleColor.Green); } } }
public void method_0(DatabaseClient class6_0) { Console.BackgroundColor = ConsoleColor.Black; Logging.Write("Lädt Items.."); this.dictionary_0 = new Dictionary <uint, Item>(); DataTable dataTable = class6_0.ReadDataTable("SELECT * FROM furniture;"); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { try { this.dictionary_0.Add((uint)dataRow["Id"], new Item((string)dataRow["sfx"], (uint)dataRow["Id"], (int)dataRow["sprite_id"], (string)dataRow["public_name"], (string)dataRow["item_name"], (string)dataRow["type"], (int)dataRow["width"], (int)dataRow["length"], (double)dataRow["stack_height"], HabboIM.StringToBoolean(dataRow["can_stack"].ToString()), HabboIM.StringToBoolean(dataRow["is_walkable"].ToString()), HabboIM.StringToBoolean(dataRow["can_sit"].ToString()), HabboIM.StringToBoolean(dataRow["allow_recycle"].ToString()), HabboIM.StringToBoolean(dataRow["allow_trade"].ToString()), HabboIM.StringToBoolean(dataRow["allow_marketplace_sell"].ToString()), HabboIM.StringToBoolean(dataRow["allow_gift"].ToString()), HabboIM.StringToBoolean(dataRow["allow_inventory_stack"].ToString()), (string)dataRow["interaction_type"], (int)dataRow["interaction_modes_count"], (string)dataRow["vending_ids"], dataRow["height_adjustable"].ToString(), Convert.ToByte((int)dataRow["EffectF"]), Convert.ToByte((int)dataRow["EffectM"]), HabboIM.StringToBoolean(dataRow["HeightOverride"].ToString()))); } catch (Exception e) { Logging.WriteLine("Could not load item #" + (uint)dataRow["Id"] + ", please verify the data is okay."); Logging.LogItemError(e.Message); } } } Logging.WriteLine("Fertig!", ConsoleColor.Green); /*Logging.smethod_0("Loading Soundtracks.."); //OMA LUOTU :3 * this.dictionary_1 = new Dictionary<int, Soundtrack>(); * DataTable dataTable2 = class6_0.ReadDataTable("SELECT * FROM soundtracks;"); * if (dataTable2 != null) * { * foreach (DataRow dataRow in dataTable2.Rows) * { * try * { * this.dictionary_1.Add((int)dataRow["Id"], new Soundtrack((int)dataRow["Id"], (string)dataRow["name"], (string)dataRow["author"], (string)dataRow["track"], (int)dataRow["length"])); * } * catch (Exception) * { * Logging.WriteLine("Could not load item #" + (uint)dataRow["Id"] + ", please verify the data is okay."); * } * } * } * Logging.WriteLine("completed!", ConsoleColor.Green);*/ Console.BackgroundColor = ConsoleColor.Black; Logging.Write("Lädt Soundtracks.."); SongManager.Initialize(); Logging.WriteLine("Fertig!", ConsoleColor.Green); }
private static Habbo CreateHabbo(DataRow habboData, string ssoTicket, GameClient session, UserDataFactory otherData) { uint Id = (uint)habboData["Id"]; string Username = (string)habboData["username"]; string Name = (string)habboData["real_name"]; uint Rank = (uint)habboData["rank"]; string Motto = (string)habboData["motto"]; string ip_last = (string)habboData["ip_last"]; string look = (string)habboData["look"]; string gender = (string)habboData["gender"]; int credits = (int)habboData["credits"]; int pixels = (int)habboData["activity_points"]; string account_created = (string)habboData["account_created"]; double activity_points_lastupdate = (double)habboData["activity_points_lastupdate"]; string last_loggedin = (string)habboData["last_loggedin"]; int daily_respect_points = (int)habboData["daily_respect_points"]; int daily_pet_respect_points = (int)habboData["daily_pet_respect_points"]; double vipha_last = (double)habboData["vipha_last"]; double viphal_last = (double)habboData["viphal_last"]; //string static_id = (string)habboData["static_id_last"]; string static_id = "NOT EXIST IN THIS MOMENT"; int jail = (int)habboData["jail"]; int lovepoints = (int)habboData["lovepoints"]; int gc = (int)habboData["gc"]; double jailtime = (double)habboData["jailtime"]; double kisstime = (double)habboData["lastkiss_time"]; double hugtime = (double)habboData["lasthug_time"]; int boyfriend = (int)habboData["boyfriend"]; int kissed = (int)habboData["kisses_bf"]; int hugged = (int)habboData["hugs_bf"]; double lovedate = (double)habboData["love_date"]; int bez_level = (int)habboData["bz_level"]; double support_last = (double)habboData["support_last"]; return(new Habbo(support_last, bez_level, lovedate, kissed, hugged, lovepoints, kisstime, hugtime, boyfriend, gc, static_id, jailtime, jail, Id, Username, Name, ssoTicket, Rank, Motto, look, gender, credits, pixels, activity_points_lastupdate, account_created, HabboIM.StringToBoolean(habboData["is_muted"].ToString()), (uint)habboData["home_room"], (int)habboData["newbie_status"], HabboIM.StringToBoolean(habboData["block_newfriends"].ToString()), HabboIM.StringToBoolean(habboData["hide_inroom"].ToString()), HabboIM.StringToBoolean(habboData["hide_online"].ToString()), HabboIM.StringToBoolean(habboData["vip"].ToString()), (int)habboData["volume"], (int)habboData["vip_points"], HabboIM.StringToBoolean(habboData["accept_trading"].ToString()), ip_last, session, otherData, last_loggedin, daily_respect_points, daily_pet_respect_points, vipha_last, viphal_last, HabboIM.StringToBoolean(habboData["friend_stream_enabled"].ToString()), HabboIM.StringToBoolean(habboData["raumalert"].ToString()), HabboIM.StringToBoolean(habboData["werbercmd"].ToString()), (string)habboData["working"], (string)habboData["changenametime"], HabboIM.StringToBoolean(habboData["changename"].ToString()))); }
public void method_0(DatabaseClient class6_0) { Console.BackgroundColor = ConsoleColor.Black; Logging.Write("Lädt Navigator.."); this.list_0.Clear(); this.dictionary_0.Clear(); this.dictionary_1.Clear(); DataTable dataTable = class6_0.ReadDataTable("SELECT Id,caption,min_rank,cantrade FROM navigator_flatcats WHERE enabled = '1'"); DataTable dataTable2 = class6_0.ReadDataTable("SELECT Id,bannertype,caption,image,image_type,room_id,category,category_parent_id FROM navigator_publics ORDER BY ordernum ASC;"); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { this.list_0.Add(new FlatCat((int)dataRow["Id"], (string)dataRow["caption"], (int)dataRow["min_rank"], HabboIM.StringToBoolean(dataRow["cantrade"].ToString()))); } } if (dataTable2 != null) { foreach (DataRow dataRow in dataTable2.Rows) { this.dictionary_0.Add((int)dataRow["Id"], new PublicItem((int)dataRow["Id"], int.Parse(dataRow["bannertype"].ToString()), (string)dataRow["caption"], (string)dataRow["image"], (dataRow["image_type"].ToString().ToLower() == "internal") ? PublicImageType.INTERNAL : PublicImageType.EXTERNAL, (uint)dataRow["room_id"], HabboIM.StringToBoolean(dataRow["category"].ToString()), (int)dataRow["category_parent_id"])); if (!this.dictionary_0[(int)dataRow["Id"]].bool_0) { this.dictionary_1.Add((int)dataRow["Id"], this.dictionary_0[(int)dataRow["Id"]]); } } } Logging.WriteLine("Fertig!", ConsoleColor.Green); }