Пример #1
0
        public Program()
        {
            TitleArt();
            SetupCommands();
            LoadConfigurations();

#if DEBUG
            scriptController = new ScriptController("../../Util/Extending/Scripts/");
#else
            scriptController = new ScriptController("scripts/");
#endif
            scriptController.LoadScripts();
            scriptController.Scripts.ForEach(t => t.Load());

            StartServers();

            while (true)
            {
                Thread.Sleep(1);
                string input = Console.ReadLine();
                if (input.Equals("exit"))
                {
                    break;
                }
            }

            scriptController.Scripts.ForEach(t => t.Unload());
            scriptController.UnloadScripts();

            Config.SaveConfiguration();
            Logger.Log("Configuration", "Successfully saved {0} configurations.", Logger.LogLevel.Config, Config.Count);

            Console.Read();
        }
Пример #2
0
        private void reloadScriptsCallback(Command command)
        {
            if (scriptController == null)
            {
                return;
            }

            scriptController.Scripts.ForEach(t => t.Unload());
            scriptController.LoadScripts();
            scriptController.Scripts.ForEach(t => t.Load());

            if (MainContext.IsPlayerIngame)
            {
                WorldProcessor.CreateWorldNotice("[ScriptController] Scripts have been reloaded.");
            }
        }