You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
681 B

1 month ago
using Sog;
namespace PlayerOp
{
public static class DBServerSelect
{
private static uint DBServerID = 0;
public static void Init(ServerApp app)
{
// 主备模式下cluster有独立的2套服务器, 每套服务器根据instId连接自己的DBServer
int instId = (int)ServerIDUtils.GetInstanceID(app.ServerID);
DBServerID = ServerIDUtils.GetLevel0ServerIDByType((int)ServerType.Db, instId);
TraceLog.Debug("DBServerSelect.Init DBServerID {0}", ServerIDUtils.IDToString(DBServerID));
}
public static uint GetDBServerID()
{
return DBServerID;
}
}
}