コード例 #1
0
        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();
            }
        }
コード例 #2
0
ファイル: CharacterHotkey.cs プロジェクト: GodLesZ/svn-dump
		public static CharacterHotkey Load(DataRow row) {
			CharacterHotkey key = new CharacterHotkey();
			if (key.LoadFromDatabase(row) == false) {
				return null;
			}

			return key;
		}
コード例 #3
0
        public static CharacterHotkey Load(DataRow row)
        {
            CharacterHotkey key = new CharacterHotkey();

            if (key.LoadFromDatabase(row) == false)
            {
                return(null);
            }

            return(key);
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
		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();
			}

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