Пример #1
0
 private void BootTaskRunInstaller()
 {
     if (CoreManager.InstallerCore.Run())
     {
         StandardOut.Notice("Install", StringLocale.GetString("CORE:BOOT_INSTALL_SAVING"));
         SaveConfigInstallation();
     }
 }
Пример #2
0
        public ServerCore()
        {
            EventManager      = new EventManager();
            OfficalEventFirer = new EventFirer(null);

            StringLocale       = new StringLocale();
            PluginManager      = new PluginManager();
            GameSocketManagers = new Dictionary <string, GameSocketManager>();
        }
Пример #3
0
        public ServerCore()
        {
            EventManager = new EventManager();
            OfficalEventFirer = new EventFirer(null);

            StringLocale = new StringLocale();
            PluginManager = new PluginManager();
            GameSocketManagers = new Dictionary<string, GameSocketManager>();
        }
Пример #4
0
 private void BootTaskStartPlugins()
 {
     ConsoleManager.Notice("Plugin Manager", StringLocale.GetString("CORE:BOOT_PLUGINS_STARTING"));
     foreach (Plugin plugin in PluginManager.GetLoadedPlugins())
     {
         PluginManager.StartPlugin(plugin);
     }
     ConsoleManager.Notice("Plugin Manager", StringLocale.GetString("CORE:BOOT_PLUGINS_STARTED"));
 }
Пример #5
0
 private void BootTaskLoadPlugins()
 {
     ConsoleManager.Notice("Plugin Manager", StringLocale.GetString("CORE:BOOT_PLUGINS_LOADING"));
     foreach (string path in PluginManager.GetAllPotentialPluginPaths())
     {
         PluginManager.LoadPluginAtPath(path);
     }
     ConsoleManager.Notice("Plugin Manager", StringLocale.GetString("CORE:BOOT_PLUGINS_LOADED"));
 }
Пример #6
0
        private void BootTaskLoadConfig()
        {
            string configPath = Environment.GetEnvironmentVariable("IHI_CONFIG_PATH");

            ConsoleManager.Notice("Boot", StringLocale.GetString("CORE:BOOT_LOADING_CONFIG_AT") + configPath);
            Config = new XmlConfig(configPath);

            ConsoleManager.Notice("Boot", StringLocale.GetString("CORE:BOOT_INSTALL_CHECKING"));
            PrepareInstall();
        }
Пример #7
0
        private void BootTaskLoadConfig()
        {
            string configPath = Environment.GetEnvironmentVariable("BLUEDOT_CONFIG_PATH");

            StandardOut.Notice("Boot", StringLocale.GetString("CORE:BOOT_LOADING_CONFIG_AT") + configPath);
            Config = new XmlConfig(configPath);

            StandardOut.Notice("Boot", StringLocale.GetString("CORE:BOOT_INSTALL_CHECKING"));
            bool mainInstallRequired = PrepareInstall(); // Register the main installation if required.
        }
Пример #8
0
        private void BootTaskLoadPlugins()
        {
            List <Task> taskList = new List <Task>();

            StandardOut.Notice("Plugin Manager", StringLocale.GetString("CORE:BOOT_PLUGINS_LOADING"));
            foreach (string path in PluginManager.GetAllPotentialPluginPaths())
            {
                taskList.Add(Task.Factory.StartNew(() => { PluginManager.LoadPluginAtPath(path); }));
            }
            Task.WaitAll(taskList.ToArray());
            StandardOut.Notice("Plugin Manager", StringLocale.GetString("CORE:BOOT_PLUGINS_LOADED"));
        }
Пример #9
0
        private void BootTaskStartPlugins()
        {
            List <Task> taskList = new List <Task>();

            StandardOut.Notice("Plugin Manager", StringLocale.GetString("CORE:BOOT_PLUGINS_STARTING"));
            foreach (Plugin plugin in PluginManager.GetLoadedPlugins())
            {
                taskList.Add(Task.Factory.StartNew(() => { PluginManager.StartPlugin(plugin); }));
            }
            Task.WaitAll(taskList.ToArray());
            StandardOut.Notice("Plugin Manager", StringLocale.GetString("CORE:BOOT_PLUGINS_STARTED"));
        }
Пример #10
0
 private void BootTaskConnectMySql()
 {
     StandardOut.Notice("MySQL", StringLocale.GetString("CORE:BOOT_MYSQL_PREPARE"));
     MySqlConnectionProvider = new MySqlConnectionProvider
     {
         Host     = Config.ValueAsString("/config/mysql/host"),
         Port     = Config.ValueAsUshort("/config/mysql/port", 3306),
         User     = Config.ValueAsString("/config/mysql/user"),
         Password = Config.ValueAsString("/config/mysql/password"),
         Database = Config.ValueAsString("/config/mysql/database")
     };
     StandardOut.Notice("MySQL", StringLocale.GetString("CORE:BOOT_MYSQL_READY"));
 }
Пример #11
0
        private bool BootTaskConnectMySql()
        {
            ConsoleManager.Notice("MySQL", StringLocale.GetString("CORE:BOOT_MYSQL_PREPARE"));
            MySqlConnectionProvider = new MySqlConnectionProvider
            {
                Host            = Config.GetValue("mysql:host", "localhost").Value,
                Port            = Config.GetValue <ushort>("mysql:port", 3306).Value,
                User            = Config.GetValue("mysql:username", "ihi").Value,
                Password        = Config.GetValue("mysql:password", "").Value,
                Database        = Config.GetValue("mysql:database", "ihi").Value,
                MinimumPoolSize = Config.GetValue <uint>("mysql:minpoolsize", 1).Value,
                MaximumPoolSize = Config.GetValue <uint>("mysql:maxpoolsize", 5).Value
            };
            MySqlConnectionProvider.HelperGetAction <int>("SELECT 1", null); // Testing the connection to the MySQL server

            ConsoleManager.Notice("MySQL", StringLocale.GetString("CORE:BOOT_MYSQL_READY"));
            return(true);
        }
Пример #12
0
        internal void Boot()
        {
            lock (_bootInProgressLocker)
            {
                ConsoleManager = new ConsoleManager();

                StringLocale.SetDefaults();

                #region Ensure Directory Structure
                new DirectoryInfo(Path.Combine(Environment.CurrentDirectory, "dumps")).EnsureExists();
                new DirectoryInfo(Path.Combine(Environment.CurrentDirectory, "plugins")).EnsureExists();
                new DirectoryInfo(Path.Combine(Environment.CurrentDirectory, "libs")).EnsureExists();
                #endregion

                Installer = new Installer();

                BootTaskLoadConfig();
                BootTaskLoadPlugins();

                BootTaskRunInstaller();

                if (!BootTaskConnectMySql())
                {
                    return;
                }

                BootTaskPreparePermissions();
                BootTaskPrepareFigures();
                BootTaskPrepareHabbos();
                BootTaskPrepareRooms();

                BootTaskStartWebAdmin();

                BootTaskStartPlugins();

                ConsoleManager.Important("Core", StringLocale.GetString("CORE:BOOT_COMPLETE"));

                EventManager.WeakBind <ConsoleInputEventArgs>("stdin:after", ProcessTempInput);

                System.Console.Beep(500, 250);
            }
        }
Пример #13
0
        internal void Boot()
        {
            lock (_bootInProgressLocker)
            {
                StandardOut = new LoggingManager();
                StringLocale.SetDefaults();

                #region Ensure Directory Structure
                XmlConfig.EnsureDirectory(new DirectoryInfo(Path.Combine(Environment.CurrentDirectory, "dumps")));
                XmlConfig.EnsureDirectory(new DirectoryInfo(Path.Combine(Environment.CurrentDirectory, "plugins")));
                XmlConfig.EnsureDirectory(new DirectoryInfo(Path.Combine(Environment.CurrentDirectory, "libs")));
                #endregion

                BootTaskLoadConfig();
                BootTaskLoadPlugins();

                BootTaskRunInstaller();

                BootTaskConnectMySql();

                Task.WaitAll(new[]
                {
                    Task.Factory.StartNew(BootTaskPreparePermissions),
                    Task.Factory.StartNew(BootTaskPrepareFigures),
                    Task.Factory.StartNew(BootTaskPrepareHabbos),
                    Task.Factory.StartNew(BootTaskPrepareRooms)
                });

                Task.Factory.StartNew(BootTaskStartWebAdmin);

                BootTaskStartPlugins();

                StandardOut.Notice("Core", StringLocale.GetString("CORE:BOOT_COMPLETE"));

                Console.Beep(500, 250);
            }
        }
Пример #14
0
 public void BootTaskPrepareRooms()
 {
     StandardOut.Notice("Room Distributor", StringLocale.GetString("CORE:BOOT_ROOMDISTRIBUTOR_PREPARE"));
     RoomDistributor = new RoomDistributor();
     StandardOut.Notice("Room Distributor", StringLocale.GetString("CORE:BOOT_ROOMDISTRIBUTOR_READY"));
 }
Пример #15
0
 public void BootTaskStartWebAdmin()
 {
     StandardOut.Notice("Web Admin", StringLocale.GetString("CORE:BOOT_WEBADMIN_PREPARE"));
     WebAdminManager = new WebAdminManager(Config.ValueAsUshort("/config/webadmin/port", 14480));
     StandardOut.Notice("Web Admin", StringLocale.GetString("CORE:BOOT_WEBADMIN_READY"));
 }
Пример #16
0
 public void BootTaskPreparePermissions()
 {
     StandardOut.Notice("Permission Distributor", StringLocale.GetString("CORE:BOOT_PERMISSIONS_PREPARE"));
     PermissionDistributor = new PermissionDistributor();
     StandardOut.Notice("Permission Distributor", StringLocale.GetString("CORE:BOOT_PERMISSIONS_READY"));
 }
Пример #17
0
 public void BootTaskPrepareHabbos()
 {
     StandardOut.Notice("Habbo Distributor", StringLocale.GetString("CORE:BOOT_HABBODISTRIBUTOR_PREPARE"));
     HabboDistributor = new HabboDistributor();
     StandardOut.Notice("Habbo Distributor", StringLocale.GetString("CORE:BOOT_HABBODISTRIBUTOR_READY"));
 }
Пример #18
0
 public void BootTaskPrepareFigures()
 {
     StandardOut.Notice("Habbo Figure Factory", StringLocale.GetString("CORE:BOOT_FIGURES_PREPARE"));
     HabboFigureFactory = new HabboFigureFactory();
     StandardOut.Notice("Habbo Figure Factory", StringLocale.GetString("CORE:BOOT_FIGURES_READY"));
 }
Пример #19
0
 public void BootTaskPrepareFigures()
 {
     ConsoleManager.Notice("Habbo Figure Factory", StringLocale.GetString("CORE:BOOT_FIGURES_PREPARE"));
     HabboFigureFactory = new HabboFigureFactory();
     ConsoleManager.Notice("Habbo Figure Factory", StringLocale.GetString("CORE:BOOT_FIGURES_READY"));
 }
Пример #20
0
 public void BootTaskPrepareHabbos()
 {
     ConsoleManager.Notice("Habbo Distributor", StringLocale.GetString("CORE:BOOT_HABBODISTRIBUTOR_PREPARE"));
     HabboDistributor = new HabboDistributor();
     ConsoleManager.Notice("Habbo Distributor", StringLocale.GetString("CORE:BOOT_HABBODISTRIBUTOR_READY"));
 }
Пример #21
0
 public void BootTaskPrepareRooms()
 {
     ConsoleManager.Notice("Room Distributor", StringLocale.GetString("CORE:BOOT_ROOMDISTRIBUTOR_PREPARE"));
     RoomDistributor = new RoomDistributor();
     ConsoleManager.Notice("Room Distributor", StringLocale.GetString("CORE:BOOT_ROOMDISTRIBUTOR_READY"));
 }
Пример #22
0
 public void BootTaskStartWebAdmin()
 {
     ConsoleManager.Notice("Web Admin", StringLocale.GetString("CORE:BOOT_WEBADMIN_PREPARE"));
     WebAdminManager = new WebAdminManager(Config.GetValue <ushort>("webadmin:port", 14480).Value);
     ConsoleManager.Notice("Web Admin", StringLocale.GetString("CORE:BOOT_WEBADMIN_READY"));
 }