mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
reset preferred sql-server to the first specified
on map load
This commit is contained in:
parent
2bd6d0c381
commit
53a004fa74
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue