reset preferred sql-server to the first specified

on map load
This commit is contained in:
H-M-H 2016-01-28 23:13:31 +01:00
parent 2bd6d0c381
commit 53a004fa74
2 changed files with 5 additions and 1 deletions

View file

@ -22,10 +22,12 @@ public:
static void SetReadServers(CSqlServer** ppReadServers) { ms_ppSqlReadServers = ppReadServers; }
static void SetWriteServers(CSqlServer** ppWriteServers) { ms_ppSqlWriteServers = ppWriteServers; }
static void ResetReachable() { ms_ReachableReadServer = 0; ms_ReachableWriteServer = 0; }
bool ConnectSqlServer(bool ReadOnly = true);
bool MaxTriesReached(bool ReadOnly = true) { return ReadOnly ? m_NumReadRetries >= CSqlServer::ms_NumReadServer : m_NumWriteRetries >= CSqlServer::ms_NumWriteServer; }
private:
CSqlServer *m_pSqlServer;

View file

@ -32,6 +32,8 @@ m_pServer(pGameServer->Server())
CSqlData::ms_pPlayerData = PlayerData(0);
CSqlData::ms_pMap = m_aMap;
CSqlConnector::ResetReachable();
void* InitThread = thread_init(ExecSqlFunc, new CSqlExecData(Init, new CSqlData()));
thread_detach(InitThread);
}