/// <summary> /// Loads the dungeons table and initializes all cached information /// </summary> public void LoadTable() { logger.Info("Loading Worlds Table"); try { this.Worlds = WorldsTable.LoadTable(); } catch (Exception ex) { logger.Error(ex); logger.Info("Error loading Worlds Table, re-creating table"); WorldsTable.CreateTable(); this.Worlds = WorldsTable.LoadTable(); } logger.Info("Loading Objectives Table"); try { this.ObjectivesTable = WvWObjectivesTable.LoadTable(); } catch (Exception ex) { logger.Error(ex); logger.Info("Error loading Objectives Table, re-creating table"); WvWObjectivesTable.CreateTable(); this.ObjectivesTable = WvWObjectivesTable.LoadTable(); } }
/// <summary> /// Loads the WvW objects and initializes all cached information /// </summary> public void LoadData() { try { logger.Info("Loading worlds via API"); this.Worlds = new List <World>(); var worldRepository = GW2.V2.Worlds.ForCurrentUICulture(); var worlds = worldRepository.FindAll(); foreach (var world in worlds.Values) { this.Worlds.Add(new World() { ID = world.WorldId, Name = world.Name }); } } catch (Exception ex) { logger.Error("Failed to load worlds data: "); logger.Error(ex); } logger.Info("Loading Objectives Table"); try { this.ObjectivesTable = WvWObjectivesTable.LoadTable(); } catch (Exception ex) { logger.Error(ex); logger.Info("Error loading Objectives Table, re-creating table"); WvWObjectivesTable.CreateTable(); this.ObjectivesTable = WvWObjectivesTable.LoadTable(); } }