Пример #1
0
void CChat::KillChannels()
{
	ADDTOCALLSTACK("CChat::KillChannels");
	CChatChannel * pChannel = GetFirstChannel();
	// First /kick everyone
	for ( ; pChannel != NULL; pChannel = pChannel->GetNext())
		pChannel->KickAll();
	m_Channels.Empty();
}
Пример #2
0
CChatChannel * CChat::FindChannel(lpctstr pszChannel) const
{
	CChatChannel * pChannel = GetFirstChannel();
	for ( ; pChannel != nullptr; pChannel = pChannel->GetNext())
	{
		if (strcmp(pChannel->GetName(), pszChannel) == 0)
			break;
	}
	return pChannel;
}
Пример #3
0
CChatChannel *CChat::FindChannel(LPCTSTR pszChannel) const
{
	ADDTOCALLSTACK("CChat::FindChannel");
	for ( CChatChannel *pChannel = static_cast<CChatChannel *>(m_Channels.GetHead()); pChannel != NULL; pChannel = pChannel->GetNext() )
	{
		if ( strcmpi(static_cast<LPCTSTR>(pChannel->m_sName), pszChannel) == 0 )
			return pChannel;
	}
	return NULL;
};
Пример #4
0
void CChatMember::addChatWindow()
{
	ADDTOCALLSTACK("CChatMember::addChatWindow");
	// Called from Event_ChatButton

	CClient *pClient = GetClient();
	if ( !pClient || (!pClient->m_UseNewChatSystem && m_bChatActive) )
		return;

	// Open chat window (old chat system only)
	// On new chat system this is not needed because the chat button is hardcoded on client-side, and
	// PacketChatButton packet is sent by client after login complete only to get initial channel list
	if ( !pClient->m_UseNewChatSystem )
		pClient->addChatSystemMessage(CHATCMD_OpenChatWindow, GetChatName());

	// Send channel names
	for ( CChatChannel *pChannel = static_cast<CChatChannel *>(g_Serv.m_Chats.m_Channels.GetHead()); pChannel != NULL; pChannel = pChannel->GetNext() )
	{
		pClient->addChatSystemMessage(CHATCMD_AddChannel, pChannel->m_sName, pClient->m_UseNewChatSystem ? NULL : pChannel->GetPasswordString());
		if ( (g_Cfg.m_iChatFlags & CHATF_AUTOJOIN) && pChannel->m_bStatic && !GetChannel() )
			g_Serv.m_Chats.JoinChannel(pChannel->m_sName, NULL, this);
	}
}