Beispiel #1
0
        /// <summary>
        /// Loads world data for the specified path &amp; settings file
        /// </summary>
        /// <param name="dataPath">The path to the World directory</param>
        /// <param name="settings">The settings filename</param>
        public bool LoadWorld(string dataPath, string settings)
        {
            HasLoaded = false;
            if (string.IsNullOrEmpty(dataPath) || !Directory.Exists(dataPath))
            {
                return(false);
            }

            Structure = new InternalStructure();
            Structure.SetPath(dataPath);

            Structure.LoadCurrentAndPreviousTwSnapshot(out _villages, out _players, out _tribes);

            if (_villageTypes != null)
            {
                _villageTypes.Close();
            }
            _villageTypes = Structure.CurrentVillageTypes;

            bool settingLoadSuccess = LoadSettingsCore(settings, false);

            if (!settingLoadSuccess)
            {
                return(false);
            }

            Cache = new AutoCompleteCache(_players, _tribes);

            HasLoaded = true;

            EventPublisher.InformLoaded(this, EventArgs.Empty);
            EventPublisher.InformSettingsLoaded(this, EventArgs.Empty);

            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Loads world data for the specified path &amp; settings file
        /// </summary>
        /// <param name="dataPath">The path to the World directory</param>
        /// <param name="settings">The settings filename</param>
        public bool LoadWorld(string dataPath, string settings)
        {
            HasLoaded = false;
            if (string.IsNullOrEmpty(dataPath) || !Directory.Exists(dataPath))
                return false;

            Structure = new InternalStructure();
            Structure.SetPath(dataPath);

            Structure.LoadCurrentAndPreviousTwSnapshot(out _villages, out _players, out _tribes);

            if (_villageTypes != null) _villageTypes.Close();
            _villageTypes = Structure.CurrentVillageTypes;

            bool settingLoadSuccess = LoadSettingsCore(settings, false);
            if (!settingLoadSuccess)
                return false;

            Cache = new AutoCompleteCache(_players, _tribes);

            HasLoaded = true;

            EventPublisher.InformLoaded(this, EventArgs.Empty);
            EventPublisher.InformSettingsLoaded(this, EventArgs.Empty);

            return true;
        }
Beispiel #3
0
 public static void CreateNewWorld(string path, InternalStructure.ServerInfo server)
 {
     InternalStructure.CreateWorld(path, server);
 }
Beispiel #4
0
 public static void CreateNewWorld(string path, InternalStructure.ServerInfo server)
 {
     InternalStructure.CreateWorld(path, server);
 }
Beispiel #5
0
 /// <summary>
 /// Downloads available worlds on the server
 /// </summary>
 public static IEnumerable <string> GetAllWorlds(string serverName)
 {
     return(InternalStructure.GetWorlds(serverName));
 }