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

Method Ban

engine/Poseidon/Network/NetworkServerMission.cpp:1476–1505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1474 float errorNoCoef;
1475 // Critical update
1476 bool criticalUpdate;
1477};
1478
1479// Compare player object infos by error
1480int CmpPlayerObjects(const UpdateObjectInfo* info1, const UpdateObjectInfo* info2)
1481{
1482 float diff = info2->error - info1->error;
1483 return sign(diff);
1484}
1485
1486void NetworkServer::KickOff(int dpnid, KickOffReason reason)
1487{
1488 RString format;
1489 switch (reason)
1490 {
1491 case KORKick:
1492 format = LocalizeString(IDS_MP_KICKED);
1493 break;
1494 case KORBan:
1495 format = LocalizeString(IDS_MP_BANNED);
1496 break;
1497 }
1498 PlayerIdentity* id = FindIdentity(dpnid);
1499 if (id)
1500 {
1501 if (id->destroy)
1502 {
1503 LOG_DEBUG(Network, "{}: KickOff in progress, new request ignored", (const char*)id->name);
1504 return;
1505 }
1506 if (format.GetLength() > 0)
1507 {
1508 RString message = Format(format, (const char*)id->name);

Callers

nothing calls this directly

Calls 10

FindIdentityFunction · 0.85
SaveBanListFunction · 0.85
GetUserDirectoryFunction · 0.85
ParseIPv4Function · 0.85
SaveIpBanListFunction · 0.85
RStringClass · 0.50
AddUniqueMethod · 0.45
GetPlayerHostIPMethod · 0.45
GetLengthMethod · 0.45
KickOffMethod · 0.45

Tested by

no test coverage detected