public static void UpdateGroup(DatabaseClient class6_0, int int_0) { GroupsManager @class = Groups.GetGroupById(int_0); if (@class != null) { DataRow Row = class6_0.ReadDataRow("SELECT * FROM groups WHERE Id = " + int_0 + " LIMIT 1"); @class.Name = (string)Row["name"]; @class.Badge = (string)Row["badge"]; @class.RoomId = (uint)Row["roomid"]; @class.Description = (string)Row["desc"]; @class.Locked = (string)Row["locked"]; @class.ColorOne = (string)Row["color_one"]; @class.ColorTwo = (string)Row["color_two"]; @class.Created = Essential.TimestampToDate(double.Parse((string)Row["created"])).ToShortDateString(); @class.Members.Clear(); DataTable dataTable = class6_0.ReadDataTable("SELECT userid FROM group_memberships WHERE groupid = " + int_0 + ";"); foreach (DataRow dataRow2 in dataTable.Rows) { @class.JoinGroup((int)dataRow2["userid"]); } } }
public void Initialize(DatabaseClient class6_0) { if (!isLoading) { isLoading = true; Logging.Write("Loading Catalogue.."); this.dictionary_0 = new Dictionary<int, CatalogPage>(); this.list_0 = new List<EcotronReward>(); DataTable dataTable = class6_0.ReadDataTable("SELECT * FROM catalog_pages WHERE order_num >= '0' ORDER BY order_num ASC"); DataTable dataTable2 = class6_0.ReadDataTable("SELECT * FROM ecotron_rewards ORDER BY item_id"); DataTable dataTable4 = class6_0.ReadDataTable("SELECT * FROM catalog_pages WHERE order_num = '-1' ORDER BY caption ASC"); try { this.uint_0 = (uint)class6_0.ReadDataRow("SELECT ID FROM items ORDER BY ID DESC LIMIT 1")[0]; } catch { this.uint_0 = 0u; } this.uint_0 += 1u; this.spbmanager = new SurpriseBoxManager(class6_0); Hashtable hashtable = new Hashtable(); DataTable dataTable3 = class6_0.ReadDataTable("SELECT * FROM catalog_items"); if (dataTable3 != null) { foreach (DataRow dataRow in dataTable3.Rows) { try { 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.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"], Essential.StringToInt(dataRow["vip"].ToString()), (uint)dataRow["achievement"], (int)dataRow["song_id"], BadgeID, (int)dataRow["limited_sold"], (int)dataRow["limited_count"], int.Parse(dataRow["have_offer"].ToString()) == 1, (int)dataRow["poster_id"], (string)dataRow["extradata"])); } } catch { Console.WriteLine("Error loading Item #" + dataRow["Id"].ToString()); } } } if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { bool bool_ = false; bool bool_2 = false; if (dataRow["visible"].ToString() == "1") { bool_ = true; } if (dataRow["enabled"].ToString() == "1") { bool_2 = true; } this.dictionary_0.Add((int)dataRow["Id"], new CatalogPage((int)dataRow["Id"], (string)dataRow["link_name"], (int)dataRow["parent_id"], (string)dataRow["caption"], bool_, bool_2, (uint)dataRow["min_rank"], Essential.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)); } } if (dataTable4 != null) { foreach (DataRow dataRow in dataTable4.Rows) { bool bool_ = false; bool bool_2 = false; if (dataRow["visible"].ToString() == "1") { bool_ = true; } if (dataRow["enabled"].ToString() == "1") { bool_2 = true; } this.dictionary_0.Add((int)dataRow["Id"], new CatalogPage((int)dataRow["Id"], (string)dataRow["link_name"], (int)dataRow["parent_id"], (string)dataRow["caption"], bool_, bool_2, (uint)dataRow["min_rank"], Essential.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)); } } if (dataTable2 != null) { foreach (DataRow dataRow in dataTable2.Rows) { this.list_0.Add(new EcotronReward((uint)dataRow["Id"], (uint)dataRow["display_id"], (uint)dataRow["item_id"], (uint)dataRow["reward_level"])); } } this.groupsDataMessage = GetGuildPage(); Logging.WriteLine("completed!", ConsoleColor.Green); isLoading = false; } }