public void LoadOther() { DataTable table; int i = 0; // Hotkeys Hotkeys = new CharacterHotkey[Global.MAX_HOTKEYS]; table = Core.Database.Query("SELECT * FROM `char_hotkey` WHERE `charID` = {0}", ID); if (table != null && table.Rows.Count > 0) { foreach (DataRow row in table.Rows) { CharacterHotkey key = CharacterHotkey.Load(row); if (key == null) { ServerConsole.ErrorLine("Failed to load hotkey #{0}", row.Field <int>("index")); continue; } Hotkeys[i++] = key; } } // Fill up until max for (; i < Hotkeys.Length; i++) { Hotkeys[i] = new CharacterHotkey(); } }
public static CharacterHotkey Load(DataRow row) { CharacterHotkey key = new CharacterHotkey(); if (key.LoadFromDatabase(row) == false) { return null; } return key; }
public static CharacterHotkey Load(DataRow row) { CharacterHotkey key = new CharacterHotkey(); if (key.LoadFromDatabase(row) == false) { return(null); } return(key); }
public CharacterDatabaseData(DataRow row) : base() { Skills = new CharacterSkillTree(); Storage = new ItemStorage(); Inventory = new ItemInventory(); Cart = new ItemInventoryCart(); Hotkeys = new CharacterHotkey[Global.MAX_HOTKEYS]; Friends = new CharacterFriendList(); if (row != null) { LoadFromDatabase(row); } }
public void LoadOther() { DataTable table; int i = 0; // Hotkeys Hotkeys = new CharacterHotkey[Global.MAX_HOTKEYS]; table = Core.Database.Query("SELECT * FROM `char_hotkey` WHERE `charID` = {0}", ID); if (table != null && table.Rows.Count > 0) { foreach (DataRow row in table.Rows) { CharacterHotkey key = CharacterHotkey.Load(row); if (key == null) { ServerConsole.ErrorLine("Failed to load hotkey #{0}", row.Field<int>("index")); continue; } Hotkeys[i++] = key; } } // Fill up until max for (; i < Hotkeys.Length; i++) { Hotkeys[i] = new CharacterHotkey(); } }