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

Method SetTimerType

src/game/server/player.cpp:678–722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

676}
677
678bool CPlayer::SetTimerType(int TimerType)
679{
680 if(TimerType == TIMERTYPE_DEFAULT)
681 {
682 if(Server()->IsSixup(m_ClientId))
683 m_TimerType = TIMERTYPE_SIXUP;
684 else
685 SetTimerType(g_Config.m_SvDefaultTimerType);
686
687 return true;
688 }
689
690 if(Server()->IsSixup(m_ClientId))
691 {
692 if(TimerType == TIMERTYPE_SIXUP || TimerType == TIMERTYPE_NONE)
693 {
694 m_TimerType = TimerType;
695 return true;
696 }
697 else
698 return false;
699 }
700
701 if(TimerType == TIMERTYPE_GAMETIMER)
702 {
703 if(GetClientVersion() >= VERSION_DDNET_GAMETICK)
704 m_TimerType = TimerType;
705 else
706 return false;
707 }
708 else if(TimerType == TIMERTYPE_GAMETIMER_AND_BROADCAST)
709 {
710 if(GetClientVersion() >= VERSION_DDNET_GAMETICK)
711 m_TimerType = TimerType;
712 else
713 {
714 m_TimerType = TIMERTYPE_BROADCAST;
715 return false;
716 }
717 }
718 else
719 m_TimerType = TimerType;
720
721 return true;
722}
723
724void CPlayer::TryRespawn()
725{

Callers 1

ConSetTimerTypeMethod · 0.80

Calls 2

ServerClass · 0.50
IsSixupMethod · 0.45

Tested by

no test coverage detected