mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-13 03:28:19 +00:00
Save fixes
This commit is contained in:
parent
1b2a85af58
commit
1f86e6c8df
|
@ -1496,9 +1496,10 @@ bool CSqlScore::LoadTeamThread(CSqlServer* pSqlServer, const CSqlData *pGameData
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pSqlServer->executeSql("start transaction;");
|
|
||||||
char aBuf[768];
|
char aBuf[768];
|
||||||
str_format(aBuf, sizeof(aBuf), "select Savegame, Server, UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-UNIX_TIMESTAMP(Timestamp) as Ago from %s_saves where Code = '%s' and Map = '%s';", pSqlServer->GetPrefix(), pData->m_Code.ClrStr(), pData->m_Map.ClrStr());
|
str_format(aBuf, sizeof(aBuf), "lock tables %s_saves write;", pSqlServer->GetPrefix());
|
||||||
|
pSqlServer->executeSql("lock tables %s_saves;");
|
||||||
|
str_format(aBuf, sizeof(aBuf), "select Savegame, Server, UNIX_TIMESTAMP(CURRENT_TIMESTAMP)-UNIX_TIMESTAMP(Timestamp) as Ago from %s_saves where Code = '%s' and Map = '%s';", pSqlServer->GetPrefix(), pData->m_Code.ClrStr(), pData->m_Map.ClrStr());
|
||||||
pSqlServer->executeSqlQuery(aBuf);
|
pSqlServer->executeSqlQuery(aBuf);
|
||||||
|
|
||||||
if (pSqlServer->GetResults()->rowsCount() > 0)
|
if (pSqlServer->GetResults()->rowsCount() > 0)
|
||||||
|
@ -1591,7 +1592,7 @@ bool CSqlScore::LoadTeamThread(CSqlServer* pSqlServer, const CSqlData *pGameData
|
||||||
pData->GameServer()->SendChatTarget(pData->m_ClientID, "No such savegame for this map");
|
pData->GameServer()->SendChatTarget(pData->m_ClientID, "No such savegame for this map");
|
||||||
|
|
||||||
end:
|
end:
|
||||||
pSqlServer->executeSql("commit;");
|
pSqlServer->executeSql("unlock tables;");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (sql::SQLException &e)
|
catch (sql::SQLException &e)
|
||||||
|
|
Loading…
Reference in a new issue