| 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 | |
| 861 | NetClient::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 | |
| 894 | NetClient::~NetClient() |
| 895 | { |
nothing calls this directly
no test coverage detected