| 332 | |
| 333 | |
| 334 | bool 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 |
no test coverage detected