Notify about possible save codes right away

This commit is contained in:
Zwelf 2022-09-16 00:50:47 +02:00 committed by Dennis Felsing
parent 00392c7ee6
commit f847215fd0

View file

@ -292,7 +292,24 @@ void CScore::SaveTeam(int ClientID, const char *pCode, const char *pServer)
Tmp->m_aGeneratedCode[0] = '\0'; Tmp->m_aGeneratedCode[0] = '\0';
GeneratePassphrase(Tmp->m_aGeneratedCode, sizeof(Tmp->m_aGeneratedCode)); GeneratePassphrase(Tmp->m_aGeneratedCode, sizeof(Tmp->m_aGeneratedCode));
char aBuf[512];
if(Tmp->m_aCode[0] == '\0')
{
str_format(aBuf,
sizeof(aBuf),
"Team save in progress. You'll be able to load with '/load %s'",
Tmp->m_aGeneratedCode);
}
else
{
str_format(aBuf,
sizeof(aBuf),
"Team save in progress. You'll be able to load with '/load %s' if save is successful or with '/load %s' if it fails",
Tmp->m_aCode,
Tmp->m_aGeneratedCode);
}
pController->m_Teams.KillSavedTeam(ClientID, Team); pController->m_Teams.KillSavedTeam(ClientID, Team);
GameServer()->SendChatTeam(Team, aBuf);
m_pPool->ExecuteWrite(CScoreWorker::SaveTeam, std::move(Tmp), "save team"); m_pPool->ExecuteWrite(CScoreWorker::SaveTeam, std::move(Tmp), "save team");
} }