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

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