redirect messages to teamchat when a tournament is running

This commit is contained in:
xushTW 2015-10-13 15:47:36 +02:00 committed by oy
parent e7534094ab
commit 10a19ba7f9
2 changed files with 8 additions and 0 deletions

View file

@ -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)

View file

@ -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; }