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