Merge pull request #7000 from Robyt3/Server-Score-Reset-Fix

Fix scoreboard time being reset when using `/timecp`, fix SQL query buffer sizes being too small
This commit is contained in:
Dennis Felsing 2023-08-11 21:08:54 +00:00 committed by GitHub
commit 925a4f70aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -905,8 +905,10 @@ void CPlayer::ProcessScoreResult(CScorePlayerResult &Result)
break;
case CScorePlayerResult::PLAYER_INFO:
if(Result.m_Data.m_Info.m_Time.has_value())
{
GameServer()->Score()->PlayerData(m_ClientID)->Set(Result.m_Data.m_Info.m_Time.value(), Result.m_Data.m_Info.m_aTimeCp);
m_Score = Result.m_Data.m_Info.m_Time;
m_Score = Result.m_Data.m_Info.m_Time;
}
Server()->ExpireServerInfo();
int Birthday = Result.m_Data.m_Info.m_Birthday;
if(Birthday != 0 && !m_BirthdayAnnounced)

View file

@ -128,7 +128,7 @@ bool CScoreWorker::LoadPlayerData(IDbConnection *pSqlServer, const ISqlData *pGa
auto *pResult = dynamic_cast<CScorePlayerResult *>(pGameData->m_pResult.get());
pResult->SetVariant(CScorePlayerResult::PLAYER_INFO);
char aBuf[512];
char aBuf[1024];
// get best race time
str_format(aBuf, sizeof(aBuf),
"SELECT"
@ -1002,7 +1002,7 @@ bool CScoreWorker::ShowTeamTop5(IDbConnection *pSqlServer, const ISqlData *pGame
const char *pOrder = pData->m_Offset >= 0 ? "ASC" : "DESC";
// check sort method
char aBuf[512];
char aBuf[1024];
str_format(aBuf, sizeof(aBuf),
"SELECT Name, Time, Ranking, TeamSize "