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

Function destroyPlayerCallback

engine/Poseidon/Network/NetTransportNet.cpp:2037–2047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2035 do
2036 {
2037 destroyPlayer(ch, NTRDisconnected);
2038 } while (users.getNext(it, ch));
2039 }
2040 leaveUsr();
2041 SLEEP_MS(DESTRUCT_WAIT); // waits till all players are gone..
2042
2043 // Now stop UDP threads and clean up the serverPeer.
2044 // The serverPeer is global/static, so we need to explicitly clean it up
2045 // to prevent threads from running after this NetServer instance is destroyed.
2046 poolLock.enter();
2047 if (serverPeer)
2048 {
2049 serverPeer->close(); // Stops UDP listener/sender threads via poThreadJoin
2050 if (pool)

Callers

nothing calls this directly

Calls 3

finishDestroyPlayerMethod · 0.80
enterMethod · 0.45
leaveMethod · 0.45

Tested by

no test coverage detected