public static void UpdateFilters(DatabaseClient dbClient) { ChatCommandHandler.BadWords.Clear(); ChatCommandHandler.BadReplacement.Clear(); ChatCommandHandler.BadStrict.Clear(); ChatCommandHandler.ExternalLinks.Clear(); DataTable Table = dbClient.ReadDataTable("SELECT * FROM wordfilter ORDER BY word ASC;"); if (Table != null) { foreach (DataRow Row in Table.Rows) { ChatCommandHandler.BadWords.Add(Row["word"].ToString()); ChatCommandHandler.BadReplacement.Add(Row["replacement"].ToString()); ChatCommandHandler.BadStrict.Add(PhoenixEnvironment.EnumToBool(Row["strict"].ToString())); } } DataTable Table2 = dbClient.ReadDataTable("SELECT * FROM linkfilter;"); if (Table2 != null) { foreach (DataRow Row in Table2.Rows) { ChatCommandHandler.ExternalLinks.Add(Row["externalsite"].ToString()); } } }
public void Initialize(DatabaseClient adapter) { Logging.Write("Loading Navigator.."); this.PrivateCategories.Clear(); this.PublicItems.Clear(); this.dictionary_1.Clear(); DataTable dataTable = adapter.ReadDataTable("SELECT Id,caption,min_rank,cantrade FROM navigator_flatcats WHERE enabled = '1'"); DataTable dataTable2 = adapter.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.PrivateCategories.Add(new FlatCat((int)dataRow["Id"], (string)dataRow["caption"], (int)dataRow["min_rank"], PhoenixEnvironment.EnumToBool(dataRow["cantrade"].ToString()))); } } if (dataTable2 != null) { foreach (DataRow dataRow in dataTable2.Rows) { this.PublicItems.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"], PhoenixEnvironment.EnumToBool(dataRow["category"].ToString()), (int)dataRow["category_parent_id"])); if (!this.PublicItems[(int)dataRow["Id"]].Category) { this.dictionary_1.Add((int)dataRow["Id"], this.PublicItems[(int)dataRow["Id"]]); } } } Logging.WriteLine("completed!"); }
public void LoadBots(DatabaseClient adapter) { Logging.Write("Loading Bot data.."); this.Bots = new List<RoomBot>(); DataTable dataTable = adapter.ReadDataTable("SELECT * FROM bots;"); DataTable dataTable2 = adapter.ReadDataTable("SELECT Id, bot_id, keywords, response_text, mode, serve_id FROM bots_responses;"); DataTable dataTable3 = adapter.ReadDataTable("SELECT text, shout, bot_id FROM bots_speech;"); List<BotResponse> Response = new List<BotResponse>(); List<RandomSpeech> Speech = new List<RandomSpeech>(); foreach (DataRow dataRow in dataTable2.Rows) { Response.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) { Speech.Add(new RandomSpeech((string)dataRow["text"], PhoenixEnvironment.EnumToBool(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.Pet; } else { enum2_ = AIType.Guide; } } else { enum2_ = AIType.Generic; } IL_204: this.Bots.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 Speech, ref Response, (int)dataRow["effect"])); continue; IL_201: enum2_ = AIType.Generic; goto IL_204; } Logging.WriteLine("completed!"); } }
public static void InitFilter(DatabaseClient dbClient) { Logging.Write("Loading Chat Filter.."); BadWords = new List<string>(); BadReplacement = new List<string>(); BadStrict = new List<bool>(); ExternalLinks = new List<string>(); UpdateFilters(dbClient); Logging.WriteLine("completed!"); }
public static void LoadGroups(DatabaseClient dbClient) { Logging.Write("Loading groups..."); GroupManager.ClearGroups(); DataTable dataTable = dbClient.ReadDataTable("SELECT * FROM groups;"); foreach (DataRow dataRow in dataTable.Rows) { GroupManager.GroupList.Add((int)dataRow["Id"], new Group((int)dataRow["Id"], dataRow, dbClient)); } Logging.WriteLine("completed!"); }
public void Initialize(DatabaseClient dbClient) { Logging.Write("Loading Catalogue.."); this.Pages = new Dictionary<int, CatalogPage>(); this.EcotronRewards = new List<EcotronReward>(); DataTable Table = dbClient.ReadDataTable("SELECT * FROM catalog_pages ORDER BY order_num ASC"); DataTable dataTable2 = dbClient.ReadDataTable("SELECT * FROM ecotron_rewards ORDER BY item_id"); try { this.mCacheID = (uint)dbClient.ReadDataRow("SELECT ID FROM items ORDER BY ID DESC LIMIT 1")[0]; } catch { this.mCacheID = 0; } this.mCacheID += 1; Hashtable cataItems = new Hashtable(); DataTable dataTable3 = dbClient.ReadDataTable("SELECT * FROM catalog_items"); if (dataTable3 != null) { foreach (DataRow dataRow in dataTable3.Rows) { if (!(dataRow["item_ids"].ToString() == "") && (int)dataRow["amount"] > 0) { cataItems.Add((uint)dataRow["Id"], 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"], PhoenixEnvironment.EnumToInt(dataRow["vip"].ToString()), (uint)dataRow["achievement"], (int)dataRow["song_id"])); } } } if (Table != null) { foreach (DataRow Row in Table.Rows) { bool Visible = false; bool Enabled = false; if (Row["visible"].ToString() == "1") { Visible = true; } if (Row["enabled"].ToString() == "1") { Enabled = true; } this.Pages.Add((int)Row["Id"], new CatalogPage((int)Row["Id"], (int)Row["parent_id"], (string)Row["caption"], Visible, Enabled, (uint)Row["min_rank"], PhoenixEnvironment.EnumToBool(Row["club_only"].ToString()), (int)Row["icon_color"], (int)Row["icon_image"], (string)Row["page_layout"], (string)Row["page_headline"], (string)Row["page_teaser"], (string)Row["page_special"], (string)Row["page_text1"], (string)Row["page_text2"], (string)Row["page_text_details"], (string)Row["page_text_teaser"], (string)Row["page_link_description"], (string)Row["page_link_pagename"], ref cataItems)); } } if (dataTable2 != null) { foreach (DataRow dataRow in dataTable2.Rows) { this.EcotronRewards.Add(new EcotronReward((uint)dataRow["Id"], (uint)dataRow["display_id"], (uint)dataRow["item_id"], (uint)dataRow["reward_level"])); } } Logging.WriteLine("completed!"); }
public void LoadCategories(DatabaseClient dbClient) { Logging.Write("Loading Help Categories.."); this.Categories.Clear(); DataTable dataTable = dbClient.ReadDataTable("SELECT Id, caption FROM help_subjects"); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { this.Categories.Add((uint)dataRow["Id"], new HelpCategory((uint)dataRow["Id"], (string)dataRow["caption"])); } Logging.WriteLine("completed!"); } }
public static void LoadTexts(DatabaseClient dbClient) { Logging.Write("Loading external texts..."); ClearTexts(); DataTable table = dbClient.ReadDataTable("SELECT identifier, display_text FROM texts ORDER BY identifier ASC;"); if (table != null) { foreach (DataRow row in table.Rows) { Texts.Add(row["identifier"].ToString(), row["display_text"].ToString()); } } Logging.WriteLine("completed!"); }
public void LoadRoomAdvertisements(DatabaseClient dbClient) { Logging.Write("Loading Room Adverts.."); this.RoomAdvertisements.Clear(); DataTable dataTable = dbClient.ReadDataTable("SELECT * FROM room_ads WHERE enabled = '1'"); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { this.RoomAdvertisements.Add(new RoomAdvertisement((uint)dataRow["Id"], (string)dataRow["ad_image"], (string)dataRow["ad_link"], (int)dataRow["views"], (int)dataRow["views_limit"])); } Logging.WriteLine("completed!"); } }
public Group(int Id, DataRow Row, DatabaseClient adapter) { this.Id = Id; this.Name = (string)Row["name"]; this.Desc = (string)Row["desc"]; this.OwnerId = (int)Row["OwnerId"]; this.Badge = (string)Row["badge"]; this.RoomId = (uint)Row["roomid"]; this.Locked = (string)Row["locked"]; this.List = new List<int>(); DataTable dataTable = adapter.ReadDataTable("SELECT userid FROM group_memberships WHERE groupid = " + Id + ";"); foreach (DataRow dataRow in dataTable.Rows) { this.AddMember((int)dataRow["userid"]); } }
public void LoadBans(DatabaseClient dbClient) { Logging.Write("Loading bans.."); this.Bans.Clear(); DataTable dataTable = dbClient.ReadDataTable("SELECT bantype,value,reason,expire FROM bans WHERE expire > '" + PhoenixEnvironment.GetUnixTimestamp() + "'"); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { ModerationBanType iP = ModerationBanType.IP; if ((string)dataRow["bantype"] == "user") { iP = ModerationBanType.USERNAME; } this.Bans.Add(new ModerationBan(iP, (string)dataRow["value"], (string)dataRow["reason"], (double)dataRow["expire"])); } Logging.WriteLine("completed!"); } }
public static void UpdateGroup(DatabaseClient dbClient, int id) { Group group = GroupManager.GetGroup(id); if (group != null) { DataRow Row = dbClient.ReadDataRow("SELECT * FROM groups WHERE Id = " + id + " LIMIT 1"); group.Name = (string)Row["name"]; group.Badge = (string)Row["badge"]; group.RoomId = (uint)Row["roomid"]; group.Desc = (string)Row["desc"]; group.Locked = (string)Row["locked"]; group.List.Clear(); DataTable dataTable = dbClient.ReadDataTable("SELECT userid FROM group_memberships WHERE groupid = " + id + ";"); foreach (DataRow row2 in dataTable.Rows) { group.AddMember((int)row2["userid"]); } } }
public void LoadItems(DatabaseClient adapter) { Logging.Write("Loading Items.."); this.Item = new Dictionary<uint, Item>(); DataTable ItemData = adapter.ReadDataTable("SELECT * FROM furniture;"); if (ItemData != null) { foreach (DataRow dataRow in ItemData.Rows) { try { this.Item.Add((uint)dataRow["Id"], new Item((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"], PhoenixEnvironment.EnumToBool(dataRow["can_stack"].ToString()), PhoenixEnvironment.EnumToBool(dataRow["is_walkable"].ToString()), PhoenixEnvironment.EnumToBool(dataRow["can_sit"].ToString()), PhoenixEnvironment.EnumToBool(dataRow["allow_recycle"].ToString()), PhoenixEnvironment.EnumToBool(dataRow["allow_trade"].ToString()), PhoenixEnvironment.EnumToBool(dataRow["allow_marketplace_sell"].ToString()), PhoenixEnvironment.EnumToBool(dataRow["allow_gift"].ToString()), PhoenixEnvironment.EnumToBool(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"]))); } catch (Exception) { Logging.WriteLine("Could not load item #" + (uint)dataRow["Id"] + ", please verify the data is okay."); } } } Logging.WriteLine("completed!"); //Logging.Write("Loading Soundtracks.."); //this.Sound = new Dictionary<int, Soundtrack>(); //DataTable SoundData = adapter.ReadDataTable("SELECT * FROM soundtracks;"); //if (SoundData != null) //{ // foreach (DataRow dataRow in SoundData.Rows) // { // try // { // this.Sound.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!"); Logging.Write("Loading Soundtracks.."); SongManager.Initialize(); Logging.WriteLine("completed!"); }
public static void LoadAchievements(DatabaseClient dbClient) { Logging.Write("Loading Achievements.."); AchievementManager.Achievements.Clear(); DataTable dataTable = dbClient.ReadDataTable("SELECT * FROM achievements"); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { AchievementManager.Achievements.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"], PhoenixEnvironment.EnumToBool(dataRow["dynamic_badgelevel"].ToString()), (int)dataRow["score_base"])); } AchievementManager.Badges.Clear(); dataTable = dbClient.ReadDataTable("SELECT * FROM badges"); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { AchievementManager.Badges.Add((string)dataRow["badge"], (uint)dataRow["Id"]); } Logging.WriteLine("completed!"); } } }
public void LoadTopics(DatabaseClient dbClient) { Logging.Write("Loading Help Topics.."); this.Topics.Clear(); DataTable dataTable = dbClient.ReadDataTable("SELECT Id, title, body, subject, known_issue FROM help_topics"); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { HelpTopic topic = new HelpTopic((uint)dataRow["Id"], (string)dataRow["title"], (string)dataRow["body"], (uint)dataRow["subject"]); this.Topics.Add((uint)dataRow["Id"], topic); int num = int.Parse(dataRow["known_issue"].ToString()); if (num == 1) { this.KnownIssues.Add(topic); } else if (num == 2) { this.ImportantTopics.Add(topic); } } Logging.WriteLine("completed!"); } }
public void LoadRoles(DatabaseClient adapter) { Logging.Write(TextManager.GetText("emu_loadroles")); this.ClearPermissions(); DataTable table = adapter.ReadDataTable("SELECT * FROM ranks ORDER BY id ASC;"); if (table != null) { foreach (DataRow row in table.Rows) { RankBadge.Add((uint)row["id"], row["badgeid"].ToString()); } } table = adapter.ReadDataTable("SELECT * FROM permissions_users ORDER BY userid ASC;"); if (table != null) { foreach (DataRow Row in table.Rows) { List<string> Command = new List<string>(); if (PhoenixEnvironment.EnumToBool(Row["cmd_update_settings"].ToString())) { Command.Add("cmd_update_settings"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_bans"].ToString())) { Command.Add("cmd_update_bans"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_bots"].ToString())) { Command.Add("cmd_update_bots"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_catalogue"].ToString())) { Command.Add("cmd_update_catalogue"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_navigator"].ToString())) { Command.Add("cmd_update_navigator"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_items"].ToString())) { Command.Add("cmd_update_items"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_award"].ToString())) { Command.Add("cmd_award"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_coords"].ToString())) { Command.Add("cmd_coords"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_override"].ToString())) { Command.Add("cmd_override"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_coins"].ToString())) { Command.Add("cmd_coins"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_pixels"].ToString())) { Command.Add("cmd_pixels"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_ha"].ToString())) { Command.Add("cmd_ha"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_hal"].ToString())) { Command.Add("cmd_hal"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_freeze"].ToString())) { Command.Add("cmd_freeze"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_roommute"].ToString())) { Command.Add("cmd_roommute"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_setspeed"].ToString())) { Command.Add("cmd_setspeed"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_masscredits"].ToString())) { Command.Add("cmd_masscredits"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_globalcredits"].ToString())) { Command.Add("cmd_globalcredits"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_masspixels"].ToString())) { Command.Add("cmd_masspixels"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_globalpixels"].ToString())) { Command.Add("cmd_globalpixels"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_roombadge"].ToString())) { Command.Add("cmd_roombadge"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_massbadge"].ToString())) { Command.Add("cmd_massbadge"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_userinfo"].ToString())) { Command.Add("cmd_userinfo"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_userinfo_viewip"].ToString())) { Command.Add("cmd_userinfo_viewip"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_shutdown"].ToString())) { Command.Add("cmd_shutdown"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_givebadge"].ToString())) { Command.Add("cmd_givebadge"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_removebadge"].ToString())) { Command.Add("cmd_removebadge"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_summon"].ToString())) { Command.Add("cmd_summon"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_invisible"].ToString())) { Command.Add("cmd_invisible"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_ban"].ToString())) { Command.Add("cmd_ban"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_superban"].ToString())) { Command.Add("cmd_superban"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_roomkick"].ToString())) { Command.Add("cmd_roomkick"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_roomalert"].ToString())) { Command.Add("cmd_roomalert"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_mute"].ToString())) { Command.Add("cmd_mute"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_unmute"].ToString())) { Command.Add("cmd_unmute"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_alert"].ToString())) { Command.Add("cmd_alert"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_motd"].ToString())) { Command.Add("cmd_motd"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_kick"].ToString())) { Command.Add("cmd_kick"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_filter"].ToString())) { Command.Add("cmd_update_filter"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_permissions"].ToString())) { Command.Add("cmd_update_permissions"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_sa"].ToString())) { Command.Add("cmd_sa"); } if (PhoenixEnvironment.EnumToBool(Row["receive_sa"].ToString())) { Command.Add("receive_sa"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_ipban"].ToString())) { Command.Add("cmd_ipban"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_spull"].ToString())) { Command.Add("cmd_spull"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_disconnect"].ToString())) { Command.Add("cmd_disconnect"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_achievements"].ToString())) { Command.Add("cmd_update_achievements"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_texts"].ToString())) { Command.Add("cmd_update_texts"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_teleport"].ToString())) { Command.Add("cmd_teleport"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_points"].ToString())) { Command.Add("cmd_points"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_masspoints"].ToString())) { Command.Add("cmd_masspoints"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_globalpoints"].ToString())) { Command.Add("cmd_globalpoints"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_empty"].ToString())) { Command.Add("cmd_empty"); } if (PhoenixEnvironment.EnumToBool(Row["ignore_roommute"].ToString())) { Command.Add("ignore_roommute"); } if (PhoenixEnvironment.EnumToBool(Row["acc_anyroomrights"].ToString())) { Command.Add("acc_anyroomrights"); } if (PhoenixEnvironment.EnumToBool(Row["acc_anyroomowner"].ToString())) { Command.Add("acc_anyroomowner"); } if (PhoenixEnvironment.EnumToBool(Row["acc_supporttool"].ToString())) { Command.Add("acc_supporttool"); } if (PhoenixEnvironment.EnumToBool(Row["acc_chatlogs"].ToString())) { Command.Add("acc_chatlogs"); } if (PhoenixEnvironment.EnumToBool(Row["acc_enter_fullrooms"].ToString())) { Command.Add("acc_enter_fullrooms"); } if (PhoenixEnvironment.EnumToBool(Row["acc_enter_anyroom"].ToString())) { Command.Add("acc_enter_anyroom"); } if (PhoenixEnvironment.EnumToBool(Row["acc_restrictedrooms"].ToString())) { Command.Add("acc_restrictedrooms"); } if (PhoenixEnvironment.EnumToBool(Row["acc_unkickable"].ToString())) { Command.Add("acc_unkickable"); } if (PhoenixEnvironment.EnumToBool(Row["acc_unbannable"].ToString())) { Command.Add("acc_unbannable"); } if (PhoenixEnvironment.EnumToBool(Row["ignore_friendsettings"].ToString())) { Command.Add("ignore_friendsettings"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_sql"].ToString())) { Command.Add("wired_give_sql"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_badge"].ToString())) { Command.Add("wired_give_badge"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_effect"].ToString())) { Command.Add("wired_give_effect"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_award"].ToString())) { Command.Add("wired_give_award"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_dance"].ToString())) { Command.Add("wired_give_dance"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_send"].ToString())) { Command.Add("wired_give_send"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_credits"].ToString())) { Command.Add("wired_give_credits"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_pixels"].ToString())) { Command.Add("wired_give_pixels"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_points"].ToString())) { Command.Add("wired_give_points"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_rank"].ToString())) { Command.Add("wired_give_rank"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_respect"].ToString())) { Command.Add("wired_give_respect"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_handitem"].ToString())) { Command.Add("wired_give_handitem"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_alert"].ToString())) { Command.Add("wired_give_alert"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_roomusers"].ToString())) { Command.Add("wired_cnd_roomusers"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_userhasachievement"].ToString())) { Command.Add("wired_cnd_userhasachievement"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_userhasbadge"].ToString())) { Command.Add("wired_cnd_userhasbadge"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_userhasvip"].ToString())) { Command.Add("wired_cnd_userhasvip"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_userhaseffect"].ToString())) { Command.Add("wired_cnd_userhaseffect"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_userrank"].ToString())) { Command.Add("wired_cnd_userrank"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_usercredits"].ToString())) { Command.Add("wired_cnd_usercredits"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_userpixels"].ToString())) { Command.Add("wired_cnd_userpixels"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_userpoints"].ToString())) { Command.Add("wired_cnd_userpoints"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_usergroups"].ToString())) { Command.Add("wired_cnd_usergroups"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_wearing"].ToString())) { Command.Add("wired_cnd_wearing"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_carrying"].ToString())) { Command.Add("wired_cnd_carrying"); } this.UserPermissions.Add((uint)Row["userid"], Command); } } table = adapter.ReadDataTable("SELECT * FROM permissions_ranks ORDER BY rank ASC;"); if (table != null) { foreach (DataRow Row in table.Rows) { this.RankFlood.Add((uint)Row["rank"], (int)Row["floodtime"]); } foreach (DataRow Row in table.Rows) { List<string> list2 = new List<string>(); if (PhoenixEnvironment.EnumToBool(Row["cmd_update_settings"].ToString())) { list2.Add("cmd_update_settings"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_bans"].ToString())) { list2.Add("cmd_update_bans"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_bots"].ToString())) { list2.Add("cmd_update_bots"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_catalogue"].ToString())) { list2.Add("cmd_update_catalogue"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_navigator"].ToString())) { list2.Add("cmd_update_navigator"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_items"].ToString())) { list2.Add("cmd_update_items"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_award"].ToString())) { list2.Add("cmd_award"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_coords"].ToString())) { list2.Add("cmd_coords"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_override"].ToString())) { list2.Add("cmd_override"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_coins"].ToString())) { list2.Add("cmd_coins"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_pixels"].ToString())) { list2.Add("cmd_pixels"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_ha"].ToString())) { list2.Add("cmd_ha"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_hal"].ToString())) { list2.Add("cmd_hal"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_freeze"].ToString())) { list2.Add("cmd_freeze"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_roommute"].ToString())) { list2.Add("cmd_roommute"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_setspeed"].ToString())) { list2.Add("cmd_setspeed"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_masscredits"].ToString())) { list2.Add("cmd_masscredits"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_globalcredits"].ToString())) { list2.Add("cmd_globalcredits"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_masspixels"].ToString())) { list2.Add("cmd_masspixels"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_globalpixels"].ToString())) { list2.Add("cmd_globalpixels"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_roombadge"].ToString())) { list2.Add("cmd_roombadge"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_massbadge"].ToString())) { list2.Add("cmd_massbadge"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_userinfo"].ToString())) { list2.Add("cmd_userinfo"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_userinfo_viewip"].ToString())) { list2.Add("cmd_userinfo_viewip"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_shutdown"].ToString())) { list2.Add("cmd_shutdown"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_givebadge"].ToString())) { list2.Add("cmd_givebadge"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_removebadge"].ToString())) { list2.Add("cmd_removebadge"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_summon"].ToString())) { list2.Add("cmd_summon"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_invisible"].ToString())) { list2.Add("cmd_invisible"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_ban"].ToString())) { list2.Add("cmd_ban"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_superban"].ToString())) { list2.Add("cmd_superban"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_roomkick"].ToString())) { list2.Add("cmd_roomkick"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_roomalert"].ToString())) { list2.Add("cmd_roomalert"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_mute"].ToString())) { list2.Add("cmd_mute"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_unmute"].ToString())) { list2.Add("cmd_unmute"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_alert"].ToString())) { list2.Add("cmd_alert"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_motd"].ToString())) { list2.Add("cmd_motd"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_kick"].ToString())) { list2.Add("cmd_kick"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_filter"].ToString())) { list2.Add("cmd_update_filter"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_permissions"].ToString())) { list2.Add("cmd_update_permissions"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_sa"].ToString())) { list2.Add("cmd_sa"); } if (PhoenixEnvironment.EnumToBool(Row["receive_sa"].ToString())) { list2.Add("receive_sa"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_ipban"].ToString())) { list2.Add("cmd_ipban"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_spull"].ToString())) { list2.Add("cmd_spull"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_disconnect"].ToString())) { list2.Add("cmd_disconnect"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_achievements"].ToString())) { list2.Add("cmd_update_achievements"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_update_texts"].ToString())) { list2.Add("cmd_update_texts"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_teleport"].ToString())) { list2.Add("cmd_teleport"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_points"].ToString())) { list2.Add("cmd_points"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_masspoints"].ToString())) { list2.Add("cmd_masspoints"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_globalpoints"].ToString())) { list2.Add("cmd_globalpoints"); } if (PhoenixEnvironment.EnumToBool(Row["cmd_empty"].ToString())) { list2.Add("cmd_empty"); } if (PhoenixEnvironment.EnumToBool(Row["ignore_roommute"].ToString())) { list2.Add("ignore_roommute"); } if (PhoenixEnvironment.EnumToBool(Row["acc_anyroomrights"].ToString())) { list2.Add("acc_anyroomrights"); } if (PhoenixEnvironment.EnumToBool(Row["acc_anyroomowner"].ToString())) { list2.Add("acc_anyroomowner"); } if (PhoenixEnvironment.EnumToBool(Row["acc_supporttool"].ToString())) { list2.Add("acc_supporttool"); } if (PhoenixEnvironment.EnumToBool(Row["acc_chatlogs"].ToString())) { list2.Add("acc_chatlogs"); } if (PhoenixEnvironment.EnumToBool(Row["acc_enter_fullrooms"].ToString())) { list2.Add("acc_enter_fullrooms"); } if (PhoenixEnvironment.EnumToBool(Row["acc_enter_anyroom"].ToString())) { list2.Add("acc_enter_anyroom"); } if (PhoenixEnvironment.EnumToBool(Row["acc_restrictedrooms"].ToString())) { list2.Add("acc_restrictedrooms"); } if (PhoenixEnvironment.EnumToBool(Row["acc_unkickable"].ToString())) { list2.Add("acc_unkickable"); } if (PhoenixEnvironment.EnumToBool(Row["acc_unbannable"].ToString())) { list2.Add("acc_unbannable"); } if (PhoenixEnvironment.EnumToBool(Row["ignore_friendsettings"].ToString())) { list2.Add("ignore_friendsettings"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_sql"].ToString())) { list2.Add("wired_give_sql"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_badge"].ToString())) { list2.Add("wired_give_badge"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_effect"].ToString())) { list2.Add("wired_give_effect"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_award"].ToString())) { list2.Add("wired_give_award"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_dance"].ToString())) { list2.Add("wired_give_dance"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_send"].ToString())) { list2.Add("wired_give_send"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_credits"].ToString())) { list2.Add("wired_give_credits"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_pixels"].ToString())) { list2.Add("wired_give_pixels"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_points"].ToString())) { list2.Add("wired_give_points"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_rank"].ToString())) { list2.Add("wired_give_rank"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_respect"].ToString())) { list2.Add("wired_give_respect"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_handitem"].ToString())) { list2.Add("wired_give_handitem"); } if (PhoenixEnvironment.EnumToBool(Row["wired_give_alert"].ToString())) { list2.Add("wired_give_alert"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_roomusers"].ToString())) { list2.Add("wired_cnd_roomusers"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_userhasachievement"].ToString())) { list2.Add("wired_cnd_userhasachievement"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_userhasbadge"].ToString())) { list2.Add("wired_cnd_userhasbadge"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_userhasvip"].ToString())) { list2.Add("wired_cnd_userhasvip"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_userhaseffect"].ToString())) { list2.Add("wired_cnd_userhaseffect"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_userrank"].ToString())) { list2.Add("wired_cnd_userrank"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_usercredits"].ToString())) { list2.Add("wired_cnd_usercredits"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_userpixels"].ToString())) { list2.Add("wired_cnd_userpixels"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_userpoints"].ToString())) { list2.Add("wired_cnd_userpoints"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_usergroups"].ToString())) { list2.Add("wired_cnd_usergroups"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_wearing"].ToString())) { list2.Add("wired_cnd_wearing"); } if (PhoenixEnvironment.EnumToBool(Row["wired_cnd_carrying"].ToString())) { list2.Add("wired_cnd_carrying"); } this.RankPermissions.Add((uint)Row["rank"], list2); } } table = adapter.ReadDataTable("SELECT * FROM permissions_vip;"); if (table != null) { GlobalClass.cmdPushEnabled = false; GlobalClass.cmdPullEnabled = false; GlobalClass.cmdFlagmeEnabled = false; GlobalClass.cmdMimicEnabled = false; GlobalClass.cmdMoonwalkEnabled = false; GlobalClass.cmdFollowEnabled = false; GlobalClass.cmdFacelessEnabled = false; GlobalClass.cmdEnableEnabled = false; foreach (DataRow Row in table.Rows) { if (PhoenixEnvironment.EnumToBool(Row["cmdPush"].ToString())) { GlobalClass.cmdPushEnabled = true; } if (PhoenixEnvironment.EnumToBool(Row["cmdPull"].ToString())) { GlobalClass.cmdPullEnabled = true; } if (PhoenixEnvironment.EnumToBool(Row["cmdFlagme"].ToString())) { GlobalClass.cmdFlagmeEnabled = true; } if (PhoenixEnvironment.EnumToBool(Row["cmdMimic"].ToString())) { GlobalClass.cmdMimicEnabled = true; } if (PhoenixEnvironment.EnumToBool(Row["cmdMoonwalk"].ToString())) { GlobalClass.cmdMoonwalkEnabled = true; } if (PhoenixEnvironment.EnumToBool(Row["cmdFaceless"].ToString())) { GlobalClass.cmdFacelessEnabled = true; } if (PhoenixEnvironment.EnumToBool(Row["cmdEnable"].ToString())) { GlobalClass.cmdEnableEnabled = true; } if (PhoenixEnvironment.EnumToBool(Row["cmdFollow"].ToString())) { GlobalClass.cmdFollowEnabled = true; } } } this.PetCommandsList.Clear(); this.PetCommandsList.Add(TextManager.GetText("pet_cmd_sleep"), 1); this.PetCommandsList.Add(TextManager.GetText("pet_cmd_free"), 2); this.PetCommandsList.Add(TextManager.GetText("pet_cmd_sit"), 3); this.PetCommandsList.Add(TextManager.GetText("pet_cmd_lay"), 4); this.PetCommandsList.Add(TextManager.GetText("pet_cmd_stay"), 5); this.PetCommandsList.Add(TextManager.GetText("pet_cmd_here"), 6); this.PetCommandsList.Add(TextManager.GetText("pet_cmd_dead"), 7); this.PetCommandsList.Add(TextManager.GetText("pet_cmd_beg"), 8); this.PetCommandsList.Add(TextManager.GetText("pet_cmd_jump"), 9); this.PetCommandsList.Add(TextManager.GetText("pet_cmd_stfu"), 10); this.PetCommandsList.Add(TextManager.GetText("pet_cmd_talk"), 11); this.CommandsList.Clear(); this.CommandsList.Add(TextManager.GetText("cmd_about_name"), 1); this.CommandsList.Add(TextManager.GetText("cmd_alert_name"), 2); //Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_award_name"), 3);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_ban_name"), 4);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_buy_name"), 5);//------ Normal User this.CommandsList.Add(TextManager.GetText("cmd_coins_name"), 6);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_coords_name"), 7);//------ Normal/VIP User this.CommandsList.Add(TextManager.GetText("cmd_disablediagonal_name"), 8);//--------- Normal/VIP user this.CommandsList.Add(TextManager.GetText("cmd_emptyitems_name"), 9);//---------- Normal user this.CommandsList.Add(TextManager.GetText("cmd_empty_name"), 10);//---------- normal user this.CommandsList.Add(TextManager.GetText("cmd_enable_name"), 11);//------- VIP user this.CommandsList.Add(TextManager.GetText("cmd_flagme_name"), 12);//------- VIP user this.CommandsList.Add(TextManager.GetText("cmd_follow_name"), 13);//------- VIP user this.CommandsList.Add(TextManager.GetText("cmd_freeze_name"), 14);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_givebadge_name"), 15);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_globalcredits_name"), 16);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_globalpixels_name"), 17);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_globalpoints_name"), 18);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_hal_name"), 19);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_ha_name"), 20);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_invisible_name"), 21);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_ipban_name"), 22);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_kick_name"), 23);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_massbadge_name"), 24);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_masscredits_name"), 25);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_masspixels_name"), 26);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_masspoints_name"), 27);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_mimic_name"), 28);//VIP this.CommandsList.Add(TextManager.GetText("cmd_moonwalk_name"), 29);//VIP this.CommandsList.Add(TextManager.GetText("cmd_motd_name"), 30);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_mute_name"), 31);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_override_name"), 32);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_pickall_name"), 33);//normal user this.CommandsList.Add(TextManager.GetText("cmd_pixels_name"), 34);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_points_name"), 35);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_pull_name"), 36);//VIP this.CommandsList.Add(TextManager.GetText("cmd_push_name"), 37);//VIP this.CommandsList.Add(TextManager.GetText("cmd_redeemcreds_name"), 38); this.CommandsList.Add(TextManager.GetText("cmd_removebadge_name"), 39);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_ride_name"), 40); this.CommandsList.Add(TextManager.GetText("cmd_roomalert_name"), 41);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_roombadge_name"), 42);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_roomkick_name"), 43);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_roommute_name"), 44);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_sa_name"), 45);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_setmax_name"), 46); this.CommandsList.Add(TextManager.GetText("cmd_setspeed_name"), 47); this.CommandsList.Add(TextManager.GetText("cmd_shutdown_name"), 48);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_spull_name"), 49); this.CommandsList.Add(TextManager.GetText("cmd_summon_name"), 50);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_superban_name"), 51);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_teleport_name"), 52); this.CommandsList.Add(TextManager.GetText("cmd_unload_name"), 53); this.CommandsList.Add(TextManager.GetText("cmd_unmute_name"), 54); this.CommandsList.Add(TextManager.GetText("cmd_update_achievements_name"), 55);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_update_bans_name"), 56);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_update_bots_name"), 57);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_update_catalogue_name"), 58);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_update_filter_name"), 59);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_update_items_name"), 60);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_update_navigator_name"), 61);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_update_permissions_name"), 62);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_update_settings_name"), 63);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_userinfo_name"), 64);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_update_texts_name"), 65);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_disconnect_name"), 66);//Maked Command - Moderation ok this.CommandsList.Add(TextManager.GetText("cmd_commands_name"), 67); this.CommandsList.Add("about", 68); this.CommandsList.Add(TextManager.GetText("cmd_roominfo_name"), 69); this.CommandsList.Add("amiaaron", 70); //Developer command this.CommandsList.Add("dance", 71); //Developer command this.CommandsList.Add("rave", 72); //Developer command this.CommandsList.Add("roll", 73); //Developer command this.CommandsList.Add("control", 74); //Developer command this.CommandsList.Add("makesay", 75); //Developer command this.CommandsList.Add("sitdown", 76); //Developer command this.CommandsList.Add("exe", 77); //Developer command this.CommandsList.Add(TextManager.GetText("cmd_sit_name"), 79); //normal user this.CommandsList.Add(TextManager.GetText("cmd_dismount_name"), 80); //normal user this.CommandsList.Add(TextManager.GetText("cmd_emptypets_name"), 82); //normal user this.CommandsList.Add("getoff", 81); //Developer command this.CommandsList.Add(TextManager.GetText("cmd_giveitem_name"), 83); //Developer command this.CommandsList.Add("lay", 84); //normal user this.CommandsList.Add(TextManager.GetText("cmd_faceless_name"), 85); Logging.WriteLine("completed!"); try { if (int.Parse(PhoenixEnvironment.GetConfig().data["debug"]) == 1) { Logging.WriteLine("Commands loaded:" + this.CommandsList.Count.ToString()); } } catch { } }
public void DatabaseCleanup(DatabaseClient adapter, int serverStatus) { Logging.Write(TextManager.GetText("emu_cleandb")); bool debug = true; try { if (int.Parse(PhoenixEnvironment.GetConfig().data["debug"]) == 1) { debug = false; } } catch { } if (debug) { adapter.ExecuteQuery("UPDATE users SET online = '0' WHERE online != '0'"); adapter.ExecuteQuery("UPDATE rooms SET users_now = '0' WHERE users_now != '0'"); adapter.ExecuteQuery("UPDATE user_roomvisits SET exit_timestamp = UNIX_TIMESTAMP() WHERE exit_timestamp <= 0"); adapter.ExecuteQuery(string.Concat(new object[] { "UPDATE server_status SET status = '", serverStatus, "', users_online = '0', rooms_loaded = '0', server_ver = '", PhoenixEnvironment.PrettyVersion, "', stamp = UNIX_TIMESTAMP() LIMIT 1;" })); } Logging.WriteLine("completed!"); }
public void LoadMessagePresets(DatabaseClient adapter) { Logging.Write("Loading Pre-set Help Messages.."); this.UserMessagePresets.Clear(); this.RoomMessagePresets.Clear(); DataTable dataTable = adapter.ReadDataTable("SELECT type,message FROM moderation_presets WHERE enabled = '1'"); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { string item = (string)dataRow["message"]; string text = dataRow["type"].ToString().ToLower(); if (text != null) { if (!(text == "message")) { if (text == "roommessage") { this.RoomMessagePresets.Add(item); } } else { this.UserMessagePresets.Add(item); } } } Logging.WriteLine("completed!"); } }
public void LoadPendingTickets(DatabaseClient class6_0) { Logging.Write("Loading Current Help Tickets.."); DataTable dataTable = class6_0.ReadDataTable("SELECT Id,score,type,status,sender_id,reported_id,moderator_id,message,room_id,room_name,timestamp FROM moderation_tickets WHERE status = 'open' OR status = 'picked'"); if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { SupportTicket @class = new SupportTicket((uint)dataRow["Id"], (int)dataRow["score"], (int)dataRow["type"], (uint)dataRow["sender_id"], (uint)dataRow["reported_id"], (string)dataRow["message"], (uint)dataRow["room_id"], (string)dataRow["room_name"], (double)dataRow["timestamp"], (uint)dataRow["moderator_id"]); if (dataRow["status"].ToString().ToLower() == "picked") { @class.Pick((uint)dataRow["moderator_id"], false); } this.Tickets.Add(@class); } Logging.WriteLine("completed!"); } }
public void LoadModels(DatabaseClient class6_0) { 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"); 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"], PhoenixEnvironment.EnumToBool(dataRow["club_only"].ToString()))); } Logging.WriteLine("completed!"); } }
internal void RunDBUpdate(DatabaseClient queries, bool bool_0) { try { if (mRemovedItems.Count > 0 || mAddedItems.Count > 0 || InventoryPets.Count > 0) { StringBuilder stringBuilder = new StringBuilder(); foreach (Pet pet in this.InventoryPets.Values) { if (pet.DBState == DatabaseUpdateState.NeedsInsert) { queries.AddParamWithValue("petname" + pet.PetId, pet.Name); queries.AddParamWithValue("petcolor" + pet.PetId, pet.Color); queries.AddParamWithValue("petrace" + pet.PetId, pet.Race); stringBuilder.Append(string.Concat(new object[] { "INSERT INTO `user_pets` VALUES ('", pet.PetId, "', '", pet.OwnerId, "', '", pet.RoomId, "', @petname", pet.PetId, ", @petrace", pet.PetId, ", @petcolor", pet.PetId, ", '", pet.Type, "', '", pet.Expirience, "', '", pet.Energy, "', '", pet.Nutrition, "', '", pet.Respect, "', '", pet.CreationStamp, "', '", pet.X, "', '", pet.Y, "', '", pet.Z, "');" })); } else { if (pet.DBState == DatabaseUpdateState.NeedsUpdate) { stringBuilder.Append(string.Concat(new object[] { "UPDATE user_pets SET room_id = '", pet.RoomId, "', expirience = '", pet.Expirience, "', energy = '", pet.Energy, "', nutrition = '", pet.Nutrition, "', respect = '", pet.Respect, "', x = '", pet.X, "', y = '", pet.Y, "', z = '", pet.Z, "' WHERE Id = '", pet.PetId, "' LIMIT 1; " })); } } pet.DBState = DatabaseUpdateState.Updated; } if (stringBuilder.Length > 0) { queries.ExecuteQuery(stringBuilder.ToString()); } } if (bool_0) { Console.WriteLine("Inventory for user: "******" saved."); } } catch (Exception ex) { Logging.LogCacheError("FATAL ERROR DURING DB UPDATE: " + ex.ToString()); } }
public void UpdateGroups(DatabaseClient dbClient) { this.GroupMemberships = dbClient.ReadDataTable("SELECT * FROM group_memberships WHERE userid = " + Id); if (this.GroupMemberships != null) { foreach (DataRow dataRow in this.GroupMemberships.Rows) { Group group = GroupManager.GetGroup((int)dataRow["groupid"]); if (group == null) { DataTable dataTable = dbClient.ReadDataTable("SELECT * FROM groups WHERE Id = " + (int)dataRow["groupid"] + " LIMIT 1;"); IEnumerator enumerator2 = dataTable.Rows.GetEnumerator(); try { while (enumerator2.MoveNext()) { DataRow dataRow2 = (DataRow)enumerator2.Current; if (!GroupManager.GroupList.ContainsKey((int)dataRow2["Id"])) { GroupManager.GroupList.Add((int)dataRow2["Id"], new Group((int)dataRow2["Id"], dataRow2, dbClient)); } } continue; } finally { IDisposable disposable = enumerator2 as IDisposable; if (disposable != null) { disposable.Dispose(); } } } if (!group.List.Contains((int)this.Id)) { group.AddMember((int)this.Id); } } int num = dbClient.ReadInt32("SELECT groupid FROM user_stats WHERE Id = " + this.Id + " LIMIT 1"); Group class2 = GroupManager.GetGroup(num); if (class2 != null) { this.GroupID = num; } else { this.GroupID = 0; } } else { this.GroupID = 0; } }
internal void method_65(DatabaseClient class6_0) { try { Dictionary<uint, bool> dictionary = new Dictionary<uint, bool>(); StringBuilder stringBuilder = new StringBuilder(); if (this.WF_Triggers.Count > 0) { foreach (RoomItem @class in this.WF_Triggers) { if (@class.Extra1 != "" || @class.Extra2 != "" || @class.Extra3 != "" || @class.Extra4 != "" || @class.Extra5 != "") { try { if (!dictionary.ContainsKey(@class.Id)) { if (@class.Extra1 != "" || @class.Extra2 != "" || @class.Extra3 != "" || @class.Extra4 != "" || @class.Extra5 != "") { class6_0.AddParamWithValue(@class.Id + "Extra1", @class.Extra1); class6_0.AddParamWithValue(@class.Id + "Extra2", @class.Extra2); class6_0.AddParamWithValue(@class.Id + "Extra3", @class.Extra3); class6_0.AddParamWithValue(@class.Id + "Extra4", @class.Extra4); class6_0.AddParamWithValue(@class.Id + "Extra5", @class.Extra5); stringBuilder.Append(string.Concat(new object[] { "DELETE FROM wired_items WHERE item_id = '", @class.Id, "' LIMIT 1; INSERT INTO wired_items (item_id,extra1,extra2,extra3,extra4,extra5) VALUES ('", @class.Id, "',@", @class.Id, "Extra1,@", @class.Id, "Extra2,@", @class.Id, "Extra3,@", @class.Id, "Extra4,@", @class.Id, "Extra5); " })); } dictionary.Add(@class.Id, true); } } catch { } } } } if (this.WF_Effects.Count > 0) { foreach (RoomItem @class in this.WF_Effects) { if (@class.Extra1 != "" || @class.Extra2 != "" || @class.Extra3 != "" || @class.Extra4 != "" || @class.Extra5 != "") { try { if (!dictionary.ContainsKey(@class.Id)) { if (@class.Extra1 != "" || @class.Extra2 != "" || @class.Extra3 != "" || @class.Extra4 != "" || @class.Extra5 != "") { class6_0.AddParamWithValue(@class.Id + "Extra1", @class.Extra1); class6_0.AddParamWithValue(@class.Id + "Extra2", @class.Extra2); class6_0.AddParamWithValue(@class.Id + "Extra3", @class.Extra3); class6_0.AddParamWithValue(@class.Id + "Extra4", @class.Extra4); class6_0.AddParamWithValue(@class.Id + "Extra5", @class.Extra5); stringBuilder.Append(string.Concat(new object[] { "DELETE FROM wired_items WHERE item_id = '", @class.Id, "' LIMIT 1; INSERT INTO wired_items (item_id,extra1,extra2,extra3,extra4,extra5) VALUES ('", @class.Id, "',@", @class.Id, "Extra1,@", @class.Id, "Extra2,@", @class.Id, "Extra3,@", @class.Id, "Extra4,@", @class.Id, "Extra5); " })); } dictionary.Add(@class.Id, true); } } catch { } } } } if (this.WF_Conditions.Count > 0) { foreach (RoomItem @class in this.WF_Conditions) { if (@class.Extra1 != "" || @class.Extra2 != "" || @class.Extra3 != "" || @class.Extra4 != "" || @class.Extra5 != "") { try { if (!dictionary.ContainsKey(@class.Id)) { if (@class.Extra1 != "" || @class.Extra2 != "" || @class.Extra3 != "" || @class.Extra4 != "" || @class.Extra5 != "") { class6_0.AddParamWithValue(@class.Id + "Extra1", @class.Extra1); class6_0.AddParamWithValue(@class.Id + "Extra2", @class.Extra2); class6_0.AddParamWithValue(@class.Id + "Extra3", @class.Extra3); class6_0.AddParamWithValue(@class.Id + "Extra4", @class.Extra4); class6_0.AddParamWithValue(@class.Id + "Extra5", @class.Extra5); stringBuilder.Append(string.Concat(new object[] { "DELETE FROM wired_items WHERE item_id = '", @class.Id, "' LIMIT 1; INSERT INTO wired_items (item_id,extra1,extra2,extra3,extra4,extra5) VALUES ('", @class.Id, "',@", @class.Id, "Extra1,@", @class.Id, "Extra2,@", @class.Id, "Extra3,@", @class.Id, "Extra4,@", @class.Id, "Extra5); " })); } dictionary.Add(@class.Id, true); } } catch { } } } } dictionary.Clear(); if (this.mAddedItems.Count > 0 || this.mRemovedItems.Count > 0 || this.mMovedItems.Count > 0 || this.Boolean_4) { foreach (RoomItem @class in this.mRemovedItems.Values) { stringBuilder.Append(string.Concat(new object[] { "UPDATE items SET room_id = 0 WHERE Id = '", @class.Id, "' AND room_id = '", this.RoomId, "' LIMIT 1; " })); } this.mRemovedItems.Clear(); IEnumerator enumerator2; if (this.mAddedItems.Count > 0) { enumerator2 = this.mAddedItems.Values.GetEnumerator(); try { while (enumerator2.MoveNext()) { RoomItem @class = (RoomItem)enumerator2.Current; stringBuilder.Append("UPDATE items SET room_id = 0 WHERE Id = '" + @class.Id + "' LIMIT 1; "); } } finally { IDisposable disposable = enumerator2 as IDisposable; if (disposable != null) { disposable.Dispose(); } } int num = 0; int num2 = 0; enumerator2 = this.mAddedItems.Values.GetEnumerator(); try { while (enumerator2.MoveNext()) { RoomItem @class = (RoomItem)enumerator2.Current; if (@class.IsFloorItem) { num2++; } else { num++; } } } finally { IDisposable disposable = enumerator2 as IDisposable; if (disposable != null) { disposable.Dispose(); } } if (num2 > 0) { enumerator2 = this.mAddedItems.Values.GetEnumerator(); try { while (enumerator2.MoveNext()) { RoomItem @class = (RoomItem)enumerator2.Current; if (@class.IsFloorItem) { class6_0.AddParamWithValue("extra_data" + @class.Id, @class.ExtraData); stringBuilder.Append(string.Concat(new object[] { "UPDATE items SET room_id = '", this.RoomId, "', base_item = '", @class.BaseItem, "', extra_data = @extra_data", @class.Id, ", x = '", @class.GetX, "', y = '", @class.GetY, "', z = '", @class.GetZ, "', rot = '", @class.Rot, "', wall_pos = '' WHERE Id = '", @class.Id, "' LIMIT 1; " })); } } } finally { IDisposable disposable = enumerator2 as IDisposable; if (disposable != null) { disposable.Dispose(); } } } if (num > 0) { enumerator2 = this.mAddedItems.Values.GetEnumerator(); try { while (enumerator2.MoveNext()) { RoomItem @class = (RoomItem)enumerator2.Current; if (@class.IsWallItem) { class6_0.AddParamWithValue("extra_data" + @class.Id, @class.ExtraData); class6_0.AddParamWithValue("pos" + @class.Id, @class.string_7); stringBuilder.Append(string.Concat(new object[] { "UPDATE items SET room_id = '", this.RoomId, "', base_item = '", @class.BaseItem, "', extra_data = @extra_data", @class.Id, ", x = '0', y = '0', z = '0', rot = '0', wall_pos = @pos", @class.Id, " WHERE Id = '", @class.Id, "' LIMIT 1; " })); } } } finally { IDisposable disposable = enumerator2 as IDisposable; if (disposable != null) { disposable.Dispose(); } } } this.mAddedItems.Clear(); } enumerator2 = this.mMovedItems.Values.GetEnumerator(); try { while (enumerator2.MoveNext()) { RoomItem @class = (RoomItem)enumerator2.Current; stringBuilder.Append(string.Concat(new object[] { "UPDATE items SET x = '", @class.GetX, "', y = '", @class.GetY, "', z = '", @class.GetZ, "', rot = '", @class.Rot, "', wall_pos = '' WHERE Id = '", @class.Id, "' LIMIT 1; " })); } } finally { IDisposable disposable = enumerator2 as IDisposable; if (disposable != null) { disposable.Dispose(); } } this.mMovedItems.Clear(); foreach (Pet current in this.method_2()) { if (current.DBState == DatabaseUpdateState.NeedsInsert) { class6_0.AddParamWithValue("petname" + current.PetId, current.Name); class6_0.AddParamWithValue("petcolor" + current.PetId, current.Color); class6_0.AddParamWithValue("petrace" + current.PetId, current.Race); stringBuilder.Append(string.Concat(new object[] { "INSERT INTO `user_pets` VALUES ('", current.PetId, "', '", current.OwnerId, "', '", current.RoomId, "', @petname", current.PetId, ", @petrace", current.PetId, ", @petcolor", current.PetId, ", '", current.Type, "', '", current.Expirience, "', '", current.Energy, "', '", current.Nutrition, "', '", current.Respect, "', '", current.CreationStamp, "', '", current.X, "', '", current.Y, "', '", current.Z, "');" })); } else { if (current.DBState == DatabaseUpdateState.NeedsUpdate) { stringBuilder.Append(string.Concat(new object[] { "UPDATE user_pets SET room_id = '", current.RoomId, "', expirience = '", current.Expirience, "', energy = '", current.Energy, "', nutrition = '", current.Nutrition, "', respect = '", current.Respect, "', x = '", current.X, "', y = '", current.Y, "', z = '", current.Z, "' WHERE Id = '", current.PetId, "' LIMIT 1; " })); } } current.DBState = DatabaseUpdateState.Updated; } } if (stringBuilder.Length > 0) { class6_0.ExecuteQuery(stringBuilder.ToString()); } } catch (Exception ex) { Logging.LogCriticalException(string.Concat(new object[] { "Error during saving furniture for room ", this.RoomId, ". Stack: ", ex.ToString() })); } }
public void LoadSettings(DatabaseClient adapter) { Logging.Write("Loading your settings.."); DataRow Row = adapter.ReadDataRow("SELECT * FROM server_settings LIMIT 1"); GlobalClass.MaxRoomsPerUser = (int)Row["MaxRoomsPerUser"]; GlobalClass.Motd = (string)Row["motd"]; GlobalClass.Timer = (int)Row["timer"]; GlobalClass.Credits = (int)Row["credits"]; GlobalClass.Pixels = (int)Row["pixels"]; GlobalClass.Points = (int)Row["points"]; GlobalClass.pixels_max = (int)Row["pixels_max"]; GlobalClass.credits_max = (int)Row["credits_max"]; GlobalClass.points_max = (int)Row["points_max"]; GlobalClass.MaxPetsPerRoom = (int)Row["MaxPetsPerRoom"]; GlobalClass.MaxMarketPlacePrice = (int)Row["MaxMarketPlacePrice"]; GlobalClass.MarketPlaceTax = (int)Row["MarketPlaceTax"]; GlobalClass.AntiDDoSEnabled = PhoenixEnvironment.EnumToBool(Row["enable_antiddos"].ToString()); GlobalClass.VIPclothesforHCusers = PhoenixEnvironment.EnumToBool(Row["vipclothesforhcusers"].ToString()); GlobalClass.RecordChatlogs = PhoenixEnvironment.EnumToBool(Row["enable_chatlogs"].ToString()); GlobalClass.RecordCmdlogs = PhoenixEnvironment.EnumToBool(Row["enable_cmdlogs"].ToString()); GlobalClass.RecordRoomVisits = PhoenixEnvironment.EnumToBool(Row["enable_roomlogs"].ToString()); GlobalClass.ExternalLinkMode = (string)Row["enable_externalchatlinks"]; GlobalClass.SecureSessions = PhoenixEnvironment.EnumToBool(Row["enable_securesessions"].ToString()); GlobalClass.AllowFriendlyFurni = PhoenixEnvironment.EnumToBool(Row["allow_friendfurnidrops"].ToString()); GlobalClass.cmdRedeemCredits = PhoenixEnvironment.EnumToBool(Row["enable_cmd_redeemcredits"].ToString()); GlobalClass.UnloadCrashedRooms = PhoenixEnvironment.EnumToBool(Row["unload_crashedrooms"].ToString()); GlobalClass.ShowUsersAndRoomsInAbout = PhoenixEnvironment.EnumToBool(Row["ShowUsersAndRoomsInAbout"].ToString()); GlobalClass.IdleSleep = (int)Row["idlesleep"]; GlobalClass.IdleKick = (int)Row["idlekick"]; GlobalClass.UseIP_Last = PhoenixEnvironment.EnumToBool(Row["ip_lastforbans"].ToString()); Logging.WriteLine("completed!"); }
internal void UpdateRooms(DatabaseClient dbClient) { this.UsersRooms.Clear(); dbClient.AddParamWithValue("name", Username); DataTable dataTable = dbClient.ReadDataTable("SELECT * FROM rooms WHERE owner = @name ORDER BY Id ASC"); foreach (DataRow dataRow in dataTable.Rows) { this.UsersRooms.Add(PhoenixEnvironment.GetGame().GetRoomManager().FetchRoomData((uint)dataRow["Id"], dataRow)); } }