MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / GetIdentityText

Function GetIdentityText

engine/Poseidon/Network/NetworkClientActions.cpp:1092–1111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1090 {
1091 return identities[i].dpnid;
1092 }
1093 }
1094 return AI_PLAYER; // not found
1095}
1096RString GetIdentityText(const PlayerIdentity& identity)
1097{
1098 RString spec = Format("%d ms", identity._avgPing);
1099 if (identity._rights & PRServer)
1100 {
1101 spec = LocalizeString(IDS_MP_SERVER);
1102 }
1103 else if (identity._rights & (PRAdmin | PRVotedAdmin))
1104 {
1105 if (identity._rights & PRVotedAdmin)
1106 {
1107 spec = spec + RString(", ") + LocalizeString(IDS_MP_MASTER);
1108 }
1109 else
1110 {
1111 spec = spec + RString(", *") + LocalizeString(IDS_MP_MASTER) + RString("*");
1112 }
1113 }
1114 return Format("%s (%s)", (const char*)identity.name, (const char*)spec);

Callers 5

ProcessCommandMethod · 0.85
UpdateMethod · 0.85
OnSimulateMethod · 0.85
OnSimulateMethod · 0.85
OnSimulateMethod · 0.85

Calls 3

LocalizeStringFunction · 0.85
FormatFunction · 0.50
RStringClass · 0.50

Tested by

no test coverage detected