@@ -1848,7 +1848,11 @@ void CBNET :: ProcessChatEvent( CIncomingChatEvent *chatEvent )
1848
1848
boost::mutex::scoped_lock lock ( m_GHost->m_GamesMutex );
1849
1849
1850
1850
if ( m_GHost->m_CurrentGame )
1851
- m_GHost->m_CurrentGame ->SendAllChat ( Payload );
1851
+ {
1852
+ boost::mutex::scoped_lock sayLock ( m_GHost->m_CurrentGame ->m_SayGamesMutex );
1853
+ m_GHost->m_CurrentGame ->m_DoSayGames .push_back ( Payload );
1854
+ sayLock.unlock ( );
1855
+ }
1852
1856
1853
1857
for ( vector<CBaseGame *> :: iterator i = m_GHost->m_Games .begin ( ); i != m_GHost->m_Games .end ( ); ++i )
1854
1858
{
@@ -1997,18 +2001,27 @@ void CBNET :: ProcessChatEvent( CIncomingChatEvent *chatEvent )
1997
2001
1998
2002
if ( m_GHost->m_CurrentGame && m_GHost->m_CurrentGame ->GetPlayerFromName ( UserName, true ) )
1999
2003
{
2004
+ string FailMessage;
2005
+
2000
2006
if ( Message.find ( " is away" ) != string :: npos )
2001
- m_GHost-> m_CurrentGame -> SendAllChat ( m_GHost->m_Language ->SpoofPossibleIsAway ( UserName ) );
2007
+ FailMessage = m_GHost->m_Language ->SpoofPossibleIsAway ( UserName );
2002
2008
else if ( Message.find ( " is unavailable" ) != string :: npos )
2003
- m_GHost-> m_CurrentGame -> SendAllChat ( m_GHost->m_Language ->SpoofPossibleIsUnavailable ( UserName ) );
2009
+ FailMessage = m_GHost->m_Language ->SpoofPossibleIsUnavailable ( UserName );
2004
2010
else if ( Message.find ( " is refusing messages" ) != string :: npos )
2005
- m_GHost-> m_CurrentGame -> SendAllChat ( m_GHost->m_Language ->SpoofPossibleIsRefusingMessages ( UserName ) );
2011
+ FailMessage = m_GHost->m_Language ->SpoofPossibleIsRefusingMessages ( UserName );
2006
2012
else if ( Message.find ( " is using Warcraft III The Frozen Throne in the channel" ) != string :: npos )
2007
- m_GHost-> m_CurrentGame -> SendAllChat ( m_GHost->m_Language ->SpoofDetectedIsNotInGame ( UserName ) );
2013
+ FailMessage = m_GHost->m_Language ->SpoofDetectedIsNotInGame ( UserName );
2008
2014
else if ( Message.find ( " is using Warcraft III The Frozen Throne in channel" ) != string :: npos )
2009
- m_GHost-> m_CurrentGame -> SendAllChat ( m_GHost->m_Language ->SpoofDetectedIsNotInGame ( UserName ) );
2015
+ FailMessage = m_GHost->m_Language ->SpoofDetectedIsNotInGame ( UserName );
2010
2016
else if ( Message.find ( " is using Warcraft III The Frozen Throne in a private channel" ) != string :: npos )
2011
- m_GHost->m_CurrentGame ->SendAllChat ( m_GHost->m_Language ->SpoofDetectedIsInPrivateChannel ( UserName ) );
2017
+ FailMessage = m_GHost->m_Language ->SpoofDetectedIsInPrivateChannel ( UserName );
2018
+
2019
+ if ( !FailMessage.empty ( ) )
2020
+ {
2021
+ boost::mutex::scoped_lock sayLock ( m_GHost->m_CurrentGame ->m_SayGamesMutex );
2022
+ m_GHost->m_CurrentGame ->m_DoSayGames .push_back ( FailMessage );
2023
+ sayLock.unlock ( );
2024
+ }
2012
2025
2013
2026
if ( Message.find ( " is using Warcraft III The Frozen Throne in game" ) != string :: npos || Message.find ( " is using Warcraft III Frozen Throne and is currently in game" ) != string :: npos )
2014
2027
{
0 commit comments