Пример #1
0
void CChat::WhereIs(CChatChanMember * pBy, lpctstr pszName ) const
{
	ADDTOCALLSTACK("CChat::WhereIs");
	
	ClientIterator it;
	for (CClient* pClient = it.next(); pClient != nullptr; pClient = it.next())
	{
		if ( ! strcmp( pClient->GetChatName(), pszName))
			continue;

		tchar *pszMsg = Str_GetTemp();
		if (! pClient->IsChatActive() || !pClient->GetChannel())
			sprintf(pszMsg, "%s is not currently in a conference.", pszName);
		else
			sprintf(pszMsg, "%s is in conference '%s'.", pszName, pClient->GetChannel()->GetName());
		CSString sFrom;
		DecorateName(sFrom, nullptr, true);
		pBy->SendChatMsg(CHATMSG_PlayerTalk, sFrom, pszMsg);
		return;
	}

	pBy->SendChatMsg(CHATMSG_NoPlayer, pszName);
}
Пример #2
0
void CChat::WhereIs(CChatChanMember * pBy, LPCTSTR pszName ) const
{
	ADDTOCALLSTACK("CChat::WhereIs");
	
	ClientIterator it;
	for (CClient* pClient = it.next(); pClient != NULL; pClient = it.next())
	{
		if ( ! strcmp( pClient->GetChatName(), pszName))
			continue;

		TCHAR *pszMsg = Str_GetTemp();
		if (! pClient->IsChatActive() || !pClient->GetChannel())
			sprintf(pszMsg, "%s is not currently in a conference.", pszName);
		else
			sprintf(pszMsg, "%s is in conference '%s'.", static_cast<LPCTSTR>(pszName), static_cast<LPCTSTR>(pClient->GetChannel()->GetName()));
		CGString sFrom;
		DecorateName(sFrom, NULL, true);
		pBy->SendChatMsg(CHATMSG_PlayerTalk, sFrom, pszMsg);
		return;
	}

	pBy->SendChatMsg(CHATMSG_NoPlayer, pszName);
}