Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
        public static void Initialize(bool autoRetry = true)
        {
            var config = ConfigManager.Config.MySql;

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

            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;

            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;
        }
 public CachingWorldDatabase(WorldDatabase wrappedDatabase)
 {
     _wrappedDatabase = wrappedDatabase;
 }