3641: Fix errors introduced by the MySQL C API pull request r=Learath2 a=heinrich5991

For the first one, I'm not sure how this ever worked (the ranks did end up in the DB though). The other one was introduced by a rebase.

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] 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: heinrich5991 <heinrich5991@gmail.com>
This commit is contained in:
bors[bot] 2021-02-24 19:48:15 +00:00 committed by GitHub
commit f006eee821
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -618,7 +618,8 @@ bool CScore::SaveScoreThread(IDbConnection *pSqlServer, const ISqlData *pGameDat
pSqlServer->BindString(4, g_Config.m_SvSqlServerName);
pSqlServer->BindString(5, pData->m_GameUuid);
pSqlServer->Print();
if(pSqlServer->Step(&End, pError, ErrorSize))
int NumInserted;
if(pSqlServer->ExecuteUpdate(&NumInserted, pError, ErrorSize))
{
return true;
}
@ -743,7 +744,8 @@ bool CScore::SaveTeamScoreThread(IDbConnection *pSqlServer, const ISqlData *pGam
pSqlServer->BindBlob(4, GameID.m_aData, sizeof(GameID.m_aData));
pSqlServer->BindString(5, pData->m_GameUuid);
pSqlServer->Print();
if(pSqlServer->Step(&End, pError, ErrorSize))
int NumInserted;
if(pSqlServer->ExecuteUpdate(&NumInserted, pError, ErrorSize))
{
return true;
}
@ -1778,7 +1780,7 @@ bool CScore::LoadTeamThread(IDbConnection *pSqlServer, const ISqlData *pGameData
if(!Found)
{
str_copy(pResult->m_aMessage, "You don't belong to this team", sizeof(pResult->m_aMessage));
return true;
return false;
}
int Since = pSqlServer->GetInt(2);
@ -1787,7 +1789,7 @@ bool CScore::LoadTeamThread(IDbConnection *pSqlServer, const ISqlData *pGameData
str_format(pResult->m_aMessage, sizeof(pResult->m_aMessage),
"You have to wait %d seconds until you can load this savegame",
g_Config.m_SvSaveGamesDelay - Since);
return true;
return false;
}
bool CanLoad = pResult->m_SavedTeam.MatchPlayers(