mirror of
https://github.com/ACEmulator/ACE
synced 2026-08-17 12:26:06 -04:00
Previously, PropertyManager used SerializedShardDatabase to wrap it's database calls. This didn't make much sense because SerializedShardDatabase was basically just a wrapper that serialized calls to ShardDatabase. So, instead, we now have a ShardConfigDatabase class as well that is held by DatabaseManager. This holds the property/config specific funcitons for the shard. In addition, there were a couple bugs fixed in PropertyManager where a function migt have been GetLong() when it should have been GetDouble(), etc...
47 lines
1.4 KiB
C#
47 lines
1.4 KiB
C#
|
|
using log4net;
|
|
|
|
namespace ACE.Database
|
|
{
|
|
public static class DatabaseManager
|
|
{
|
|
private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
|
|
|
public static AuthenticationDatabase Authentication { get; } = new AuthenticationDatabase();
|
|
|
|
public static WorldDatabase World { get; } = new WorldDatabase();
|
|
|
|
private static SerializedShardDatabase serializedShardDb;
|
|
|
|
public static SerializedShardDatabase Shard { get; private set; }
|
|
|
|
public static ShardConfigDatabase ShardConfig { get; } = new ShardConfigDatabase();
|
|
|
|
public static void Initialize(bool autoRetry = true)
|
|
{
|
|
Authentication.Exists(true);
|
|
|
|
World.Exists(true);
|
|
|
|
var playerWeenieLoadTest = World.GetCachedWeenie("human");
|
|
if (playerWeenieLoadTest == null)
|
|
log.Fatal("Database does not contain the weenie for human (1). Characters cannot be created or logged into until the missing weenie is restored.");
|
|
|
|
var shardDb = new ShardDatabase();
|
|
serializedShardDb = new SerializedShardDatabase(shardDb);
|
|
Shard = serializedShardDb;
|
|
|
|
shardDb.Exists(true);
|
|
}
|
|
|
|
public static void Start()
|
|
{
|
|
serializedShardDb.Start();
|
|
}
|
|
|
|
public static void Stop()
|
|
{
|
|
serializedShardDb.Stop();
|
|
}
|
|
}
|
|
}
|