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

Method FormatClientId

src/game/client/gameclient.cpp:975–999  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

973}
974
975void CGameClient::FormatClientId(int ClientId, char (&aClientId)[16], EClientIdFormat Format) const
976{
977 if(Format == EClientIdFormat::NO_INDENT)
978 {
979 str_format(aClientId, sizeof(aClientId), "%d", ClientId);
980 }
981 else
982 {
983 const int HighestClientId = Format == EClientIdFormat::INDENT_AUTO ? m_Snap.m_HighestClientId : 64;
984 const char *pFigureSpace = " ";
985 char aNumber[8];
986 str_format(aNumber, sizeof(aNumber), "%d", ClientId);
987 aClientId[0] = '\0';
988 if(ClientId < 100 && HighestClientId >= 100)
989 {
990 str_append(aClientId, pFigureSpace);
991 }
992 if(ClientId < 10 && HighestClientId >= 10)
993 {
994 str_append(aClientId, pFigureSpace);
995 }
996 str_append(aClientId, aNumber);
997 }
998 str_append(aClientId, ": ");
999}
1000
1001void CGameClient::OnRelease()
1002{

Callers 5

RenderSpectatorsMethod · 0.80
RenderScoreboardMethod · 0.80
OnRenderMethod · 0.80
OnPrepareLinesMethod · 0.80

Calls 2

str_formatFunction · 0.85
str_appendFunction · 0.50

Tested by 1

OnRenderMethod · 0.64