示例#1
0
        /// <summary>
        /// Reload Config File <type>
        /// </summary>
        /// <param name="args"></param>
        private void CommandIReload(CommandArgs args)
        {
            if (NPCManager.CustomNPCInvasion.invasionStarted)
            {
                NPCManager.CustomNPCInvasion.StopInvasion();
            }

            try
            {
                if (File.Exists(filepath))
                {
                    ConfigObj = new CustomNPCConfig();
                    ConfigObj = CustomNPCConfig.Read(filepath);
                    return;
                }
                else
                {
                    TShock.Log.ConsoleError("Config not found. Creating new one");
                    ConfigObj.Write(filepath);
                    return;
                }
            }
            catch (Exception ex)
            {
                TShock.Log.ConsoleError(ex.Message);
                return;
            }
        }
示例#2
0
 /// <summary>
 /// Config for Custom Mob Invasions
 /// </summary>
 private void SetupConfig()
 {
     try
     {
         if (File.Exists(filepath))
         {
             ConfigObj = new CustomNPCConfig();
             ConfigObj = CustomNPCConfig.Read(filepath);
             return;
         }
         else
         {
             TShock.Log.ConsoleError("Config not found. Creating new one");
             ConfigObj.Write(filepath);
             return;
         }
     }
     catch (Exception ex)
     {
         TShock.Log.ConsoleError(ex.Message);
         return;
     }
 }