Clean up thread safe SQL refactor

This commit is contained in:
Zwelf 2020-06-17 21:15:07 +02:00
parent 9f15acdbee
commit f1b2ff086c
4 changed files with 7 additions and 25 deletions

View file

@ -32,7 +32,7 @@ public:
const char* Str() const { return m_aString; }
const char* ClrStr() const { return m_aClearString; }
CSqlString& operator = (const char *pStr)
CSqlString& operator=(const char *pStr)
{
str_copy(m_aString, pStr, size);
str_copy(m_aClearString, pStr, size);
@ -40,7 +40,7 @@ public:
return *this;
}
bool operator < (const CSqlString& other) const
bool operator<(const CSqlString& other) const
{
return strcmp(m_aString, other.m_aString) < 0;
}

View file

@ -919,23 +919,6 @@ void CGameContext::OnTick()
}
}
/*
if(m_pMapVoteResult && m_pMapVoteResult->m_Done)
{
m_VoteKick = false;
m_VoteSpec = false;
m_LastMapVote = time_get();
char aCmd[256];
str_format(aCmd, sizeof(aCmd), "sv_reset_file types/%s/flexreset.cfg; change_map \"%s\"", m_pMapVoteResult->m_aServer, m_pMapVoteResult->m_aMap);
char aChatmsg[512];
str_format(aChatmsg, sizeof(aChatmsg), "'%s' called vote to change server option '%s' (%s)", Server()->ClientName(m_pMapVoteResult->m_ClientID), m_pMapVoteResult->m_aMap, "/map");
CallVote(m_pMapVoteResult->m_ClientID, m_pMapVoteResult->m_aMap, aCmd, "/map", aChatmsg);
}
*/
#ifdef CONF_DEBUG
if(g_Config.m_DbgDummies)
{

View file

@ -853,6 +853,11 @@ void CPlayer::ProcessSqlResult(CSqlPlayerResult &Result)
);
m_Score = Result.m_Data.m_Info.m_Score;
m_HasFinishScore = Result.m_Data.m_Info.m_HasFinishScore;
// -9999 stands for no time and isn't displayed in scoreboard, so
// shift the time by a second if the player actually took 9999
// seconds to finish the map.
if(m_HasFinishScore && m_Score == -9999)
m_Score = -10000;
Server()->ExpireServerInfo();
int Birthday = Result.m_Data.m_Info.m_Birthday;
if(Birthday != 0)

View file

@ -285,11 +285,6 @@ bool CSqlScore::LoadPlayerDataThread(CSqlServer* pSqlServer, const CSqlData<CSql
pData->m_pResult->m_Data.m_Info.m_Time = Time;
pData->m_pResult->m_Data.m_Info.m_Score = -Time;
pData->m_pResult->m_Data.m_Info.m_HasFinishScore = true;
// -9999 stands for no time and isn't displayed in scoreboard, so
// shift the time by a second if the player actually took 9999
// seconds to finish the map.
if(pData->m_pResult->m_Data.m_Info.m_Score == -9999)
pData->m_pResult->m_Data.m_Info.m_Score = -10000;
char aColumn[8];
if(g_Config.m_SvCheckpointSave)
@ -1067,7 +1062,6 @@ bool CSqlScore::ShowTeamTop5Thread(CSqlServer* pSqlServer, const CSqlData<CSqlPl
// check sort method
char aBuf[512];
pSqlServer->executeSql("SET @pos := 0;");
str_format(aBuf, sizeof(aBuf),
"SELECT Name, Time, Rank, TeamSize "
"FROM (" // limit to 5