コード例 #1
0
        public static void Initialise()
        {
            var config = ConfigManager.Config.MySql;

            var authDb = new AuthenticationDatabase();

            authDb.Initialise(config.Authentication.Host, config.Authentication.Port, config.Authentication.Username, config.Authentication.Password, config.Authentication.Database);
            Authentication = authDb;

            var charDb = new CharacterDatabase();

            charDb.Initialise(config.Character.Host, config.Character.Port, config.Character.Username, config.Character.Password, config.Character.Database);
            Character = charDb;

            var worldDb = new WorldDatabase();

            worldDb.Initialise(config.World.Host, config.World.Port, config.World.Username, config.World.Password, config.World.Database);
            World = worldDb;
        }
コード例 #2
0
        public static void Initialize(bool autoRetry = true)
        {
            var config = ConfigManager.Config.MySql;

            var authDb = new AuthenticationDatabase();

            authDb.Initialize(config.Authentication.Host, config.Authentication.Port, config.Authentication.Username, config.Authentication.Password, config.Authentication.Database, autoRetry);
            Authentication = authDb;

            var shardDb = new ShardDatabase();

            shardDb.Initialize(config.Shard.Host, config.Shard.Port, config.Shard.Username, config.Shard.Password, config.Shard.Database, autoRetry);
            serializedShardDb = new SerializedShardDatabase(shardDb);
            Shard             = serializedShardDb;

            var worldDb = new WorldDatabase();

            worldDb.Initialize(config.World.Host, config.World.Port, config.World.Username, config.World.Password, config.World.Database, autoRetry);

            var cachingWorldDb = new CachingWorldDatabase(worldDb);

            World = cachingWorldDb;
        }