コード例 #1
0
        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);
        }