| 4792 | } |
| 4793 | |
| 4794 | void CGameContext::SendRecord(int ClientId) |
| 4795 | { |
| 4796 | if(Server()->IsSixup(ClientId) || GetClientVersion(ClientId) >= VERSION_DDNET_MAP_BESTTIME) |
| 4797 | return; |
| 4798 | |
| 4799 | CNetMsg_Sv_Record Msg; |
| 4800 | CNetMsg_Sv_RecordLegacy MsgLegacy; |
| 4801 | MsgLegacy.m_PlayerTimeBest = Msg.m_PlayerTimeBest = round_to_int(Score()->PlayerData(ClientId)->m_BestTime.value_or(0.0f) * 100.0f); |
| 4802 | MsgLegacy.m_ServerTimeBest = Msg.m_ServerTimeBest = m_pController->m_CurrentRecord.has_value() && !g_Config.m_SvHideScore ? round_to_int(m_pController->m_CurrentRecord.value() * 100.0f) : 0; |
| 4803 | Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientId); |
| 4804 | if(GetClientVersion(ClientId) < VERSION_DDNET_MSG_LEGACY) |
| 4805 | { |
| 4806 | Server()->SendPackMsg(&MsgLegacy, MSGFLAG_VITAL, ClientId); |
| 4807 | } |
| 4808 | } |
| 4809 | |
| 4810 | void CGameContext::SendFinish(int ClientId, float Time, std::optional<float> PreviousBestTime) |
| 4811 | { |
no test coverage detected