MCPcopy Create free account
hub / github.com/cuberite/cuberite / Tick

Method Tick

src/Server.cpp:334–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332
333
334bool cServer::Tick(float a_Dt)
335{
336 // Apply the queued playercount adjustments (postponed to avoid deadlocks)
337 int PlayerCountDiff = 0;
338 {
339 cCSLock Lock(m_CSPlayerCountDiff);
340 std::swap(PlayerCountDiff, m_PlayerCountDiff);
341 }
342 {
343 cCSLock Lock(m_CSPlayerCount);
344 m_PlayerCount += PlayerCountDiff;
345 }
346
347 // Send the tick to the plugins, as well as let the plugin manager reload, if asked to (issue #102):
348 cPluginManager::Get()->Tick(a_Dt);
349
350 // Let the Root process all the queued commands:
351 cRoot::Get()->TickCommands();
352
353 // Tick all clients not yet assigned to a world:
354 TickClients(a_Dt);
355
356 if (!m_bRestarting)
357 {
358 return true;
359 }
360 else
361 {
362 m_bRestarting = false;
363 m_RestartEvent.Set();
364 return false;
365 }
366}
367
368
369

Callers 1

ExecuteMethod · 0.45

Calls 2

TickCommandsMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected