mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
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:
commit
925a4f70aa
|
@ -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)
|
||||
|
|
|
@ -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 "
|
||||
|
|
Loading…
Reference in a new issue