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

Method Unban

engine/Poseidon/Network/NetworkServerMission.cpp:1510–1527  ·  view source on GitHub ↗

Remove a player id (decimal) or IPv4 from the dynamic ban lists and rewrite the corresponding file. An argument that parses as a dotted quad is treated as an IP, otherwise as a decimal player id.

Source from the content-addressed store, hash-verified

1508 case KORKick:
1509 format = LocalizeString(IDS_MP_KICKED);
1510 break;
1511 case KORBan:
1512 format = LocalizeString(IDS_MP_BANNED);
1513 break;
1514 }
1515 PlayerIdentity* id = FindIdentity(dpnid);
1516 if (id)
1517 {
1518 if (id->destroy)
1519 {
1520 LOG_DEBUG(Network, "{}: KickOff in progress, new request ignored", (const char*)id->name);
1521 return;
1522 }
1523 if (format.GetLength() > 0)
1524 {
1525 RString message = Format(format, (const char*)id->name);
1526 RefArray<NetworkObject> dummy;
1527 // GNetworkManager.Chat() relays via the local client (listen server);
1528 // a dedicated server has none, so it also pushes the notice directly.
1529 GNetworkManager.Chat(CCGlobal, nullptr, dummy, message);
1530 if (_dedicated)

Callers

nothing calls this directly

Calls 6

ParseIPv4Function · 0.85
SaveIpBanListFunction · 0.85
GetUserDirectoryFunction · 0.85
SaveBanListFunction · 0.85
RStringClass · 0.50
DeleteMethod · 0.45

Tested by

no test coverage detected