Beispiel #1
0
void CChat::Broadcast(CChatMember *pFrom, LPCTSTR pszText, CLanguageID lang, bool bOverride)
{
	ADDTOCALLSTACK("CChat::Broadcast");
	CGString sName;
	FormatName(sName, pFrom, bOverride);

	ClientIterator it;
	for ( CClient *pClient = it.next(); pClient != NULL; pClient = it.next() )
	{
		if ( !pClient->m_bChatActive )
			continue;
		if ( bOverride || pClient->m_bReceiving )
			pClient->SendChatMsg(CHATMSG_PlayerMessage, sName, pszText, lang);
	}
}
Beispiel #2
0
void CChat::Broadcast(CChatChanMember *pFrom, LPCTSTR pszText, CLanguageID lang, bool fOverride)
{
	ADDTOCALLSTACK("CChat::Broadcast");
	ClientIterator it;
	for (CClient *pClient = it.next(); pClient != NULL; pClient = it.next())
	{
		if (!pClient->IsChatActive())
			continue;
		if (fOverride || pClient->IsReceivingAllowed())
		{
			CGString sName;
			DecorateName(sName, pFrom, fOverride);
			pClient->SendChatMsg(CHATMSG_PlayerTalk, sName, pszText, lang);
		}
	}
}