MCPcopy Create free account
hub / github.com/ddnet/ddnet / SendRecord

Method SendRecord

src/game/server/gamecontext.cpp:4794–4808  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4792}
4793
4794void 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
4810void CGameContext::SendFinish(int ClientId, float Time, std::optional<float> PreviousBestTime)
4811{

Callers 3

OnFinishMethod · 0.80
TickMethod · 0.80
ProcessScoreResultMethod · 0.80

Calls 6

round_to_intFunction · 0.85
ScoreClass · 0.85
PlayerDataMethod · 0.80
ServerClass · 0.50
IsSixupMethod · 0.45
SendPackMsgMethod · 0.45

Tested by

no test coverage detected