Explain why the randomly generated save code is used

to the player when the database connection failed
This commit is contained in:
Zwelf 2020-06-25 20:43:54 +02:00
parent d169bb1b52
commit 0d887e8b37

View file

@ -1573,9 +1573,18 @@ bool CSqlScore::SaveTeamThread(CSqlServer* pSqlServer, const CSqlData<CScoreSave
pData->m_pResult->m_Status = CScoreSaveResult::SAVE_SUCCESS; pData->m_pResult->m_Status = CScoreSaveResult::SAVE_SUCCESS;
strcpy(pData->m_pResult->m_aBroadcast, strcpy(pData->m_pResult->m_aBroadcast,
"Database connection failed, teamsave written to a file instead. Admins will add it manually in a few days."); "Database connection failed, teamsave written to a file instead. Admins will add it manually in a few days.");
str_format(pData->m_pResult->m_aMessage, sizeof(pData->m_pResult->m_aMessage), if(str_comp(pData->m_Server, g_Config.m_SvSqlServerName) == 0)
"Team successfully saved by %s. Use '/load %s' to continue", {
pData->m_ClientName, Code.Str()); str_format(pData->m_pResult->m_aMessage, sizeof(pData->m_pResult->m_aMessage),
"Team successfully saved by %s. The database connection failed, using generated save code instead to avoid collisions. Use '/load %s' to continue",
pData->m_ClientName, Code.ClrStr());
}
else
{
str_format(pData->m_pResult->m_aMessage, sizeof(pData->m_pResult->m_aMessage),
"Team successfully saved by %s. The database connection failed, using generated save code instead to avoid collisions. Use '/load %s' on %s to continue",
pData->m_ClientName, Code.ClrStr(), pData->m_Server);
}
return true; return true;
} }
lock_unlock(ms_FailureFileLock); lock_unlock(ms_FailureFileLock);