本文整理汇总了C++中CChatChannel::SetModerator方法的典型用法代码示例。如果您正苦于以下问题:C++ CChatChannel::SetModerator方法的具体用法?C++ CChatChannel::SetModerator怎么用?C++ CChatChannel::SetModerator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChatChannel
的用法示例。
在下文中一共展示了CChatChannel::SetModerator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateChannel
bool CChat::CreateChannel(LPCTSTR pszName, LPCTSTR pszPassword, CChatMember *pMember)
{
ADDTOCALLSTACK("CChat::CreateChannel");
if ( pMember )
{
CClient *pClient = pMember->GetClient();
if ( pClient && !pClient->IsPriv(PRIV_GM) && !(g_Cfg.m_iChatFlags & CHATF_CHANNELCREATION) )
{
CGString sName;
FormatName(sName, NULL, true);
pMember->SendChatMsg(CHATMSG_PlayerMessage, sName, " Channel creation is disabled.");
return false;
}
}
if ( !IsValidName(pszName, false) )
{
if ( pMember )
pMember->SendChatMsg(CHATMSG_InvalidConferenceName);
return false;
}
else if ( FindChannel(pszName) )
{
if ( pMember )
pMember->SendChatMsg(CHATMSG_DuplicatedConferenceName);
return false;
}
CChatChannel *pChannel = new CChatChannel(pszName, pszPassword, !pMember);
m_Channels.InsertTail(pChannel);
BroadcastAddChannel(pChannel);
if ( pMember && (g_Cfg.m_iChatFlags & CHATF_CHANNELMODERATION) )
pChannel->SetModerator(pMember->GetChatName());
return true;
}
示例2: CreateChannel
bool CChat::CreateChannel(LPCTSTR pszName, LPCTSTR pszPassword, CChatChanMember * pMember)
{
ADDTOCALLSTACK("CChat::CreateChannel");
if (!m_fChatsOK)
{
CGString sName;
DecorateName(sName, NULL, true);
pMember->SendChatMsg(CHATMSG_PlayerTalk, sName, "Conference creation is disabled.");
return false;
}
CChatChannel * pChannel = new CChatChannel( pszName, pszPassword );
m_Channels.InsertTail( pChannel );
pChannel->SetModerator(pMember->GetChatName());
// Send all clients with an open chat window the new channel name
SendNewChannel(pChannel);
return true;
}