mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
Merge #6195
6195: Add more debug info to teamrace to figure out how duplicate ranks occur r=def- a=Zwelf Should help with #6194. I don't have my mysql setup with me right now, so I can't check if I can find out what is going wrong. I'll see if I can do that tomorrow :) ## Checklist - [ ] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test (especially base/) or added coverage to integration test - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Zwelf <zwelf@strct.cc>
This commit is contained in:
commit
50f83a6de6
|
@ -414,8 +414,12 @@ bool CScoreWorker::SaveScore(IDbConnection *pSqlServer, const ISqlData *pGameDat
|
||||||
pSqlServer->BindString(2, pData->m_aName);
|
pSqlServer->BindString(2, pData->m_aName);
|
||||||
pSqlServer->BindString(3, pData->m_aTimestamp);
|
pSqlServer->BindString(3, pData->m_aTimestamp);
|
||||||
pSqlServer->Print();
|
pSqlServer->Print();
|
||||||
int NumInserted;
|
int NumDeleted;
|
||||||
pSqlServer->ExecuteUpdate(&NumInserted, pError, ErrorSize);
|
pSqlServer->ExecuteUpdate(&NumDeleted, pError, ErrorSize);
|
||||||
|
if(NumDeleted == 0)
|
||||||
|
{
|
||||||
|
dbg_msg("sql", "Warning: Rank got moved out of backup database, will show up as duplicate rank in MySQL");
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(w == Write::NORMAL_FAILED)
|
if(w == Write::NORMAL_FAILED)
|
||||||
|
@ -554,8 +558,17 @@ bool CScoreWorker::SaveTeamScore(IDbConnection *pSqlServer, const ISqlData *pGam
|
||||||
// copy uuid, because mysql BindBlob doesn't support const buffers
|
// copy uuid, because mysql BindBlob doesn't support const buffers
|
||||||
CUuid TeamrankId = pData->m_TeamrankUuid;
|
CUuid TeamrankId = pData->m_TeamrankUuid;
|
||||||
pSqlServer->BindBlob(1, TeamrankId.m_aData, sizeof(TeamrankId.m_aData));
|
pSqlServer->BindBlob(1, TeamrankId.m_aData, sizeof(TeamrankId.m_aData));
|
||||||
int NumInserted;
|
pSqlServer->Print();
|
||||||
return pSqlServer->ExecuteUpdate(&NumInserted, pError, ErrorSize);
|
int NumDeleted;
|
||||||
|
if(pSqlServer->ExecuteUpdate(&NumDeleted, pError, ErrorSize))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(NumDeleted == 0)
|
||||||
|
{
|
||||||
|
dbg_msg("sql", "Warning: Teamrank got moved out of backup database, will show up as duplicate teamrank in MySQL");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
if(w == Write::NORMAL_FAILED)
|
if(w == Write::NORMAL_FAILED)
|
||||||
{
|
{
|
||||||
|
@ -570,6 +583,7 @@ bool CScoreWorker::SaveTeamScore(IDbConnection *pSqlServer, const ISqlData *pGam
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
pSqlServer->BindBlob(1, TeamrankId.m_aData, sizeof(TeamrankId.m_aData));
|
pSqlServer->BindBlob(1, TeamrankId.m_aData, sizeof(TeamrankId.m_aData));
|
||||||
|
pSqlServer->Print();
|
||||||
if(pSqlServer->ExecuteUpdate(&NumInserted, pError, ErrorSize))
|
if(pSqlServer->ExecuteUpdate(&NumInserted, pError, ErrorSize))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -583,6 +597,7 @@ bool CScoreWorker::SaveTeamScore(IDbConnection *pSqlServer, const ISqlData *pGam
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
pSqlServer->BindBlob(1, TeamrankId.m_aData, sizeof(TeamrankId.m_aData));
|
pSqlServer->BindBlob(1, TeamrankId.m_aData, sizeof(TeamrankId.m_aData));
|
||||||
|
pSqlServer->Print();
|
||||||
return pSqlServer->ExecuteUpdate(&NumInserted, pError, ErrorSize);
|
return pSqlServer->ExecuteUpdate(&NumInserted, pError, ErrorSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue