| 188 | } |
| 189 | |
| 190 | void CScore::SaveTeamScore(int Team, int *pClientIds, unsigned int Size, int TimeTicks, const char *pTimestamp) |
| 191 | { |
| 192 | CConsole *pCon = (CConsole *)GameServer()->Console(); |
| 193 | if(pCon->Cheated()) |
| 194 | return; |
| 195 | for(unsigned int i = 0; i < Size; i++) |
| 196 | { |
| 197 | if(GameServer()->m_apPlayers[pClientIds[i]]->m_NotEligibleForFinish) |
| 198 | return; |
| 199 | } |
| 200 | |
| 201 | GameServer()->TeehistorianRecordTeamFinish(Team, TimeTicks); |
| 202 | |
| 203 | auto Tmp = std::make_unique<CSqlTeamScoreData>(); |
| 204 | for(unsigned int i = 0; i < Size; i++) |
| 205 | str_copy(Tmp->m_aaNames[i], Server()->ClientName(pClientIds[i]), sizeof(Tmp->m_aaNames[i])); |
| 206 | Tmp->m_Size = Size; |
| 207 | Tmp->m_Time = (float)TimeTicks / (float)Server()->TickSpeed(); |
| 208 | str_copy(Tmp->m_aTimestamp, pTimestamp, sizeof(Tmp->m_aTimestamp)); |
| 209 | FormatUuid(GameServer()->GameUuid(), Tmp->m_aGameUuid, sizeof(Tmp->m_aGameUuid)); |
| 210 | str_copy(Tmp->m_aMap, GameServer()->Map()->BaseName(), sizeof(Tmp->m_aMap)); |
| 211 | Tmp->m_TeamrankUuid = RandomUuid(); |
| 212 | |
| 213 | m_pPool->ExecuteWrite(CScoreWorker::SaveTeamScore, std::move(Tmp), "save team score"); |
| 214 | } |
| 215 | |
| 216 | void CScore::ShowRank(int ClientId, const char *pName) |
| 217 | { |
no test coverage detected