using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; namespace Blizzard { class CatalogData { internal int Id; internal int CategoryId; internal string Name; internal bool OpenPage; internal bool ClubPage; internal int MinRank; internal int IconImage; internal int IconColor; internal string Extra; internal string Layout; internal string HeadLine; internal bool EnabledPage; internal string Text; internal string AnotherText; internal string TextDetails; internal string TextSpecial; internal string TextTeaser; internal string PageTeaser; internal int PageQuest; public static List Categories; public static List Pages; public static Dictionary Page; public static void InitCatalogPages() { Categories = new List(); Pages = new List(); Page = new Dictionary(); DataRow Pag = BlizzardSystem.MySQL.ReadDataRow("SELECT * FROM catalog_pages ORDER BY order_num ASC"); foreach (DataRow Row in Pag.Table.Rows) { CatalogData C = new CatalogData(); C.Id = (int)Row["id"]; C.CategoryId = (int)Row["categoryid"]; C.Name = (string)Row["name"]; C.OpenPage = BlizzardSystem.ConvertEnumToBool(Row["page_open"].ToString()); C.EnabledPage = BlizzardSystem.ConvertEnumToBool(Row["page_enabled"].ToString()); C.ClubPage = BlizzardSystem.ConvertEnumToBool(Row["club_page"].ToString()); C.MinRank = (int)Row["min_rank"]; C.IconColor = (int)Row["icon_color"]; C.IconImage = (int)Row["icon_image"]; C.Extra = Row["page_extra"].ToString(); C.HeadLine = (string)Row["page_headline"]; C.PageTeaser = (string)Row["page_teaser"]; C.Text = (string)Row["page_text"]; C.AnotherText = (string)Row["page_othertext"]; C.TextDetails = (string)Row["page_text_details"]; C.TextSpecial = (string)Row["page_special"]; C.TextTeaser = (string)Row["page_text_teaser"]; C.PageQuest = int.Parse(Row["questid"].ToString()); if (C.CategoryId > -1) Pages.Add(C); else Categories.Add(C); Page.Add(C.Id, C); } BlizzardSystem.WriteLine("@Server >> Added " + Page.Count + " catalog pages"); } public static List GetPagesForId(int Id) { List L = new List(); foreach (CatalogData Data in Pages) { if (Data.CategoryId == Id) L.Add(Data); } return L; } } class VoucherData { internal string Code; internal int Credits; public static List Voucher; public static void InitVouchers() { Voucher = new List(); DataRow Data = BlizzardSystem.MySQL.ReadDataRow("SELECT * FROM system_vouchers"); foreach (DataRow Row in Data.Table.Rows) { VoucherData V = new VoucherData(); V.Code = (string)Row["code"]; V.Credits = (int)Row["credits"]; Voucher.Add(V); } } } }