diff --git a/src/game/server/score.cpp b/src/game/server/score.cpp index 222f0416c..408ab6263 100644 --- a/src/game/server/score.cpp +++ b/src/game/server/score.cpp @@ -112,7 +112,7 @@ void CScore::LoadBestTime() auto LoadBestTimeResult = std::make_shared(); m_pGameServer->m_pController->m_pLoadBestTimeResult = LoadBestTimeResult; - auto Tmp = std::make_unique(LoadBestTimeResult); + auto Tmp = std::make_unique(LoadBestTimeResult); str_copy(Tmp->m_aMap, Server()->GetMapName(), sizeof(Tmp->m_aMap)); m_pPool->Execute(CScoreWorker::LoadBestTime, std::move(Tmp), "load best time"); } @@ -308,7 +308,7 @@ void CScore::SaveTeam(int ClientId, const char *pCode, const char *pServer) return; pController->Teams().SetSaving(Team, SaveResult); - auto Tmp = std::make_unique(SaveResult); + auto Tmp = std::make_unique(SaveResult); str_copy(Tmp->m_aCode, pCode, sizeof(Tmp->m_aCode)); str_copy(Tmp->m_aMap, Server()->GetMapName(), sizeof(Tmp->m_aMap)); str_copy(Tmp->m_aServer, pServer, sizeof(Tmp->m_aServer)); @@ -370,7 +370,7 @@ void CScore::LoadTeam(const char *pCode, int ClientId) auto SaveResult = std::make_shared(ClientId); SaveResult->m_Status = CScoreSaveResult::LOAD_FAILED; pController->Teams().SetSaving(Team, SaveResult); - auto Tmp = std::make_unique(SaveResult); + auto Tmp = std::make_unique(SaveResult); str_copy(Tmp->m_aCode, pCode, sizeof(Tmp->m_aCode)); str_copy(Tmp->m_aMap, Server()->GetMapName(), sizeof(Tmp->m_aMap)); str_copy(Tmp->m_aRequestingPlayer, Server()->ClientName(ClientId), sizeof(Tmp->m_aRequestingPlayer)); diff --git a/src/game/server/scoreworker.cpp b/src/game/server/scoreworker.cpp index aa2b14314..76d85f5a5 100644 --- a/src/game/server/scoreworker.cpp +++ b/src/game/server/scoreworker.cpp @@ -101,7 +101,7 @@ bool CTeamrank::SamePlayers(const std::vector *pvSortedNames) bool CScoreWorker::LoadBestTime(IDbConnection *pSqlServer, const ISqlData *pGameData, char *pError, int ErrorSize) { - const auto *pData = dynamic_cast(pGameData); + const auto *pData = dynamic_cast(pGameData); auto *pResult = dynamic_cast(pGameData->m_pResult.get()); char aBuf[512]; @@ -1568,7 +1568,7 @@ bool CScoreWorker::RandomUnfinishedMap(IDbConnection *pSqlServer, const ISqlData bool CScoreWorker::SaveTeam(IDbConnection *pSqlServer, const ISqlData *pGameData, Write w, char *pError, int ErrorSize) { - const auto *pData = dynamic_cast(pGameData); + const auto *pData = dynamic_cast(pGameData); auto *pResult = dynamic_cast(pGameData->m_pResult.get()); if(w == Write::NORMAL_SUCCEEDED) @@ -1715,7 +1715,7 @@ bool CScoreWorker::LoadTeam(IDbConnection *pSqlServer, const ISqlData *pGameData { if(w == Write::NORMAL_SUCCEEDED || w == Write::BACKUP_FIRST) return false; - const auto *pData = dynamic_cast(pGameData); + const auto *pData = dynamic_cast(pGameData); auto *pResult = dynamic_cast(pGameData->m_pResult.get()); pResult->m_Status = CScoreSaveResult::LOAD_FAILED; diff --git a/src/game/server/scoreworker.h b/src/game/server/scoreworker.h index 4cbf26d36..3001bad23 100644 --- a/src/game/server/scoreworker.h +++ b/src/game/server/scoreworker.h @@ -72,9 +72,9 @@ struct CScoreLoadBestTimeResult : ISqlResult float m_CurrentRecord; }; -struct CSqlLoadBestTimeData : ISqlData +struct CSqlLoadBestTimeRequest : ISqlData { - CSqlLoadBestTimeData(std::shared_ptr pResult) : + CSqlLoadBestTimeRequest(std::shared_ptr pResult) : ISqlData(std::move(pResult)) { } @@ -188,13 +188,13 @@ struct CSqlTeamScoreData : ISqlData CUuid m_TeamrankUuid; }; -struct CSqlTeamSave : ISqlData +struct CSqlTeamSaveData : ISqlData { - CSqlTeamSave(std::shared_ptr pResult) : + CSqlTeamSaveData(std::shared_ptr pResult) : ISqlData(std::move(pResult)) { } - virtual ~CSqlTeamSave(){}; + virtual ~CSqlTeamSaveData(){}; char m_aClientName[MAX_NAME_LENGTH]; char m_aMap[MAX_MAP_LENGTH]; @@ -203,13 +203,13 @@ struct CSqlTeamSave : ISqlData char m_aServer[5]; }; -struct CSqlTeamLoad : ISqlData +struct CSqlTeamLoadRequest : ISqlData { - CSqlTeamLoad(std::shared_ptr pResult) : + CSqlTeamLoadRequest(std::shared_ptr pResult) : ISqlData(std::move(pResult)) { } - virtual ~CSqlTeamLoad(){}; + virtual ~CSqlTeamLoadRequest(){}; char m_aCode[128]; char m_aMap[MAX_MAP_LENGTH]; diff --git a/src/test/score.cpp b/src/test/score.cpp index c9c9e190e..4bd3dcdec 100644 --- a/src/test/score.cpp +++ b/src/test/score.cpp @@ -70,9 +70,9 @@ struct Score : public testing::TestWithParam void LoadBestTime() { - CSqlLoadBestTimeData loadBestTimeData(std::make_shared()); - str_copy(loadBestTimeData.m_aMap, "Kobra 3", sizeof(loadBestTimeData.m_aMap)); - ASSERT_FALSE(CScoreWorker::LoadBestTime(m_pConn, &loadBestTimeData, m_aError, sizeof(m_aError))) << m_aError; + CSqlLoadBestTimeRequest loadBestTimeReq(std::make_shared()); + str_copy(loadBestTimeReq.m_aMap, "Kobra 3", sizeof(loadBestTimeReq.m_aMap)); + ASSERT_FALSE(CScoreWorker::LoadBestTime(m_pConn, &loadBestTimeReq, m_aError, sizeof(m_aError))) << m_aError; } void InsertMap()