mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
redirect messages to teamchat when a tournament is running
This commit is contained in:
parent
e7534094ab
commit
10a19ba7f9
|
@ -745,6 +745,13 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
|||
|
||||
pPlayer->m_LastChat = Server()->Tick();
|
||||
|
||||
// don't allow spectators to disturb players during a running game in tournament mode
|
||||
if(g_Config.m_SvTournamentMode &&
|
||||
pPlayer->GetTeam() == TEAM_SPECTATORS &&
|
||||
m_pController->IsGameRunning() &&
|
||||
!Server()->IsAuthed(ClientID))
|
||||
Team = TEAM_SPECTATORS;
|
||||
|
||||
SendChat(ClientID, Team, pMsg->m_pMessage);
|
||||
}
|
||||
else if(MsgID == NETMSGTYPE_CL_CALLVOTE)
|
||||
|
|
|
@ -188,6 +188,7 @@ public:
|
|||
// info
|
||||
bool IsFriendlyFire(int ClientID1, int ClientID2) const;
|
||||
bool IsGamePaused() const { return m_GameState == IGS_GAME_PAUSED || m_GameState == IGS_START_COUNTDOWN; }
|
||||
bool IsGameRunning() const { return m_GameState == IGS_GAME_RUNNING; }
|
||||
bool IsPlayerReadyMode() const;
|
||||
bool IsTeamChangeAllowed() const;
|
||||
bool IsTeamplay() const { return m_GameFlags&GAMEFLAG_TEAMS; }
|
||||
|
|
Loading…
Reference in a new issue