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

Method Tick

src/game/server/gamecontroller.cpp:558–596  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

556}
557
558void IGameController::Tick()
559{
560 // do warmup
561 if(m_Warmup)
562 {
563 m_Warmup--;
564 if(!m_Warmup)
565 StartRound();
566 }
567
568 if(m_GameOverTick != -1)
569 {
570 // game over.. wait for restart
571 if(Server()->Tick() > m_GameOverTick + Server()->TickSpeed() * 10)
572 {
573 StartRound();
574 m_RoundCount++;
575 }
576 }
577
578 if(m_pLoadBestTimeResult != nullptr && m_pLoadBestTimeResult->m_Completed)
579 {
580 if(m_pLoadBestTimeResult->m_Success)
581 {
582 m_CurrentRecord = m_pLoadBestTimeResult->m_CurrentRecord;
583
584 for(int i = 0; i < MAX_CLIENTS; i++)
585 {
586 if(GameServer()->m_apPlayers[i] && GameServer()->m_apPlayers[i]->GetClientVersion() >= VERSION_DDRACE)
587 {
588 GameServer()->SendRecord(i);
589 }
590 }
591 }
592 m_pLoadBestTimeResult = nullptr;
593 }
594
595 DoActivityCheck();
596}
597
598void IGameController::Snap(int SnappingClient)
599{

Callers 4

IGameControllerMethod · 0.45
DoActivityCheckMethod · 0.45
EndRoundMethod · 0.45
StartRoundMethod · 0.45

Calls 4

TickSpeedMethod · 0.80
SendRecordMethod · 0.80
ServerClass · 0.50
GetClientVersionMethod · 0.45

Tested by

no test coverage detected