Ejemplo n.º 1
0
        public void Start()
        {
            var watch = new Stopwatch();

            watch.Start();

            LoggerConsole.Initialize("Auth");

            var databaseConfig = _configuration.GetSection("DatabaseConfiguration").Get <DatabaseConfiguration>();

            _frameManager
            .InitializeTypes(typeof(RoleEnum).Assembly)
            .InitializeMessages(typeof(RoleEnum).Assembly, typeof(AuthServer).Assembly);

            _consoleCommandsManager.Initialize(typeof(AuthServer).Assembly);

            _database
            .InitializeDatabase(databaseConfig, typeof(DatabaseManager).Assembly)
            // TODO : Inused for moment but is fonctionally
            //.InitializeBackup("Backups")
            .InitializeAutoSave(databaseConfig.SaveConfiguration)
            .RegisterTable <AccountRecord>()
            .RegisterTable <BannedIPRecord>()
            .RegisterTable <WorldCharactersRecord>()
            .RegisterTable <WorldRecord>()
            .Set()
            .LoadTables();

            watch.Stop();
            _logger.LogInformation($"AuthServer load elapsed in {watch.ElapsedMilliseconds}");
            _authServer.Run();

            _consoleCommandsManager.ReadCommand();
        }