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

Method NetworkServer

engine/Poseidon/Network/NetworkServer.cpp:274–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272 for (int i = 0; i < GFileBanks.Size(); i++)
273 {
274 QFBank& bank = GFileBanks[i];
275 if (strnicmp(bank.GetPrefix(), normalized.c_str(), prefixLen) == 0)
276 {
277 return &bank;
278 }
279 }
280 return nullptr;
281}
282
283NetworkServer::NetworkServer(NetworkManager* parent, int port, RString password) : NetworkComponent(parent)
284{
285 _botClient = 0xFFFFFFFF;
286 _state = NGSCreate;
287 _stateEnteredTime = GlobalTickCount();
288 _password = password.GetLength() > 0;
289
290 _nextPlayerId = 1;
291
292 Verify(Init(port, password));
293
294 _param1 = FLT_MAX;
295 _param2 = FLT_MAX;
296
297 _kickDuplicate = false;
298 _dedicated = false;
299 _cadetMode = false;
300 _missionIndex = -1;
301
302 _gameMaster = AI_PLAYER;
303 _admin = false;
304 _restart = false;
305 _reassign = false;
306
307 Monitor(0);
308 _debugNext = INT_MAX;
309 _debugInterval = 0;
310
311 _pingUpdateNext = GlobalTickCount() + 5000;
312
313 _sessionLocked = false;
314
315 _equalModRequired = false;
316
317 // ensure no content remain
318 if (_server)
319 {
320 Poseidon::DeleteDirectoryStructure(GetServerTmpDir(), false);
321 }
322

Callers

nothing calls this directly

Calls 10

GlobalTickCountFunction · 0.85
DeleteDirectoryStructureFunction · 0.85
GetServerTmpDirFunction · 0.85
IsDedicatedServerFunction · 0.85
LoadBanListFunction · 0.85
GetUserDirectoryFunction · 0.85
LoadIpBanListFunction · 0.85
InitFunction · 0.50
RStringClass · 0.50
GetLengthMethod · 0.45

Tested by

no test coverage detected