Exemplo n.º 1
0
        internal void Hook()
        {
            m_launchedTime = DateTime.Now;
            try
            {
                Program.SetTitle(true);

                m_handlerManager = new HandlerManager(m_assembly, m_frameworkAssembly);

                WaitForHandlers();

                Game.Server.ControllerManager controllerManager = m_handlerManager.ControllerManager;

                // Intercept events to copy and invoke
                EventManager.Instance.Intercept(controllerManager);

                // command loader
                mainLog.Info("IRSE: Loading Game Console Commands..");
                // soon

                ConsoleCommandManager.InitCommands(controllerManager);



                // start gamelogic coroutine
                Program.ConsoleCoroutine = CommandSystem.Singleton.Logic(controllerManager, Game.Configuration.Globals.NoConsoleAutoComplete);


                SendKeys.SendWait("{ENTER}"); // activates the game console commands

                // plugin loader
                mainLog.Info("IRSE: Initializing Plugins...");
                m_pluginManager = new PluginManager();
                m_pluginManager.InitializeAllPlugins();

                // Wait 5 seconds before activating ServerInstance.Instance.IsRunning

                mainLog.Info("IRSE: Startup Procedure Complete!");
                IsRunning = true; // Server is running by now
            }
            catch (Exception ex)
            {
                mainLog.Info("IRSE: Startup Procedure FAILED!");
                mainLog.Info("IRSE: Haulting Server.. Major problem detected!!!!!!!! - Exception:");
                mainLog.Error(ex.ToString());

                Console.ReadLine();
                Stop();
            }
        }