MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / ~NetClient

Method ~NetClient

engine/Poseidon/Network/NetTransportNet.cpp:838–894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

836 desc.actualVersion = s->actualVersion;
837 desc.requiredVersion = s->requiredVersion;
838 strncpy(desc.mission, s->mission, LEN_MISSION_NAME);
839 desc.mission[LEN_MISSION_NAME - 1] = (char)0;
840 strncpy(desc.mod, mod, MOD_LENGTH);
841 desc.mod[MOD_LENGTH - 1] = (char)0;
842 strncpy(desc.versionTag, versionTag, VERSION_TAG_LENGTH);
843 desc.versionTag[VERSION_TAG_LENGTH - 1] = (char)0;
844 desc.equalModRequired = equalModRequired ? 1 : 0;
845 desc.gameState = s->gameState;
846 desc.maxPlayers = s->maxPlayers;
847 desc.numPlayers = s->numPlayers;
848 desc.password = s->password;
849 desc.lastTime = (unsigned32)(getSystemTime() / 1000);
850 desc.pingTime = (3 * desc.pingTime + pingTime + 2) >> 2;
851
852 _enum->leave();
853 }
854 }
855 break;
856 }
857
858 return nsNoMoreCallbacks;
859}
860
861NetClient::NetClient() : LockInit(sndCs, "NetClient::sndCs", true), LockInit(rcvCs, "NetClient::rcvCs", true)
862{
863 // Message times:
864 lastMsgReported = getSystemTime();
865 // NetChannel: not set yet
866 channel = nullptr;
867 // to be sure:
868 received = nullptr;
869 split = lastSplit = nullptr;
870 splitUrgent = lastSplitUrgent = nullptr;
871 sent = nullptr;
872 rawMagicSerial = 0x70000000;
873 sessionTerminated = false;
874 whySessionTerminated = NTROther;
875 magicApp = 0;
876#ifdef NET_LOG_INFO
877 oldLatency = -1;
878 oldThroughput = -1;
879 printAge = false;
880#endif
881#ifdef NET_LOG_TRANSP_STAT
882 nextStatLog = lastMsgReported;
883#endif
884 setClient(this);
885#ifdef NET_LOG_CLIENT
886#ifdef NET_LOG_BRIEF
887 NetLog("Pe(%u):cli", getClientPeer()->getPeerId());
888#else
889 NetLog("Peer(%u): creating NetClient instance", getClientPeer()->getPeerId());
890#endif
891#endif
892}
893
894NetClient::~NetClient()
895{

Callers

nothing calls this directly

Calls 11

setClientFunction · 0.85
getPoolFunction · 0.85
checkPoolFunction · 0.85
setFlagsMethod · 0.80
setDataMethod · 0.80
clearMethod · 0.80
shutdownMethod · 0.80
getChannelIdMethod · 0.80
deleteChannelMethod · 0.80
sendMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected