本文整理汇总了C++中CClientChatManager::tell方法的典型用法代码示例。如果您正苦于以下问题:C++ CClientChatManager::tell方法的具体用法?C++ CClientChatManager::tell怎么用?C++ CClientChatManager::tell使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CClientChatManager
的用法示例。
在下文中一共展示了CClientChatManager::tell方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: msgEntered
//=============================================================================================================
void CChatTargetFilter::msgEntered(const ucstring &msg, CChatWindow *chatWindow)
{
// Special case for yubo chat
if(_TargetGroup==CChatGroup::yubo_chat)
{
CInterfaceManager *pIM= CInterfaceManager::getInstance();
pIM->sendStringToYuboChat(msg);
return;
}
// Common Target case
if (ClientCfg.Local)
{
chatWindow->displayMessage(msg, CRGBA::White, _TargetGroup, _TargetDynamicChannelDbIndex);
return;
}
// forward to the target
if (_TargetPartyChat && _TargetPartyChat->getListener())
{
_TargetPartyChat->getListener()->msgEntered(msg, chatWindow);
}
else if (!_TargetPlayer.empty())
{
// the target must be a player, make a tell on him
// TODO: adapt this to unicode when this is OK on server side
ChatMngr.tell(_TargetPlayer.toString(), msg.toString());
// direct output in the chat
chatWindow->displayLocalPlayerTell(msg);
}
else
{
// chat to a chat group (say, shout, universe) also for team (with special case in setChatMode)
// this mode is cached so this should be ok
ChatMngr.setChatMode(_TargetGroup, ChatMngr.getDynamicChannelIdFromDbIndex(_TargetDynamicChannelDbIndex));
// send the string
ChatMngr.chat(msg, _TargetGroup == CChatGroup::team);
}
}
示例2: execute
void execute (CCtrlBase *pCaller, const std::string &sParams)
{
string receiver = getParam (sParams, "player");
ucstring message;
message.fromUtf8(getParam (sParams, "text"));
// message = getParam (sParams, "text");
if (receiver.empty() || message.empty())
return;
// Get the chat window (if any)
CChatWindow *cw = NULL;
CGroupEditBox *eb = pCaller?dynamic_cast<CGroupEditBox *>(pCaller):NULL;
if (eb)
cw = getChatWndMgr().getChatWindowFromCaller(eb);
// Send the message.
ChatMngr.tell(receiver, message);
// display in the good window
CInterfaceProperty prop;
prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," ");
ucstring finalMsg;
CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, false);
ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : "");
finalMsg += csr + CI18N::get("youTell") + ": ";
prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," ");
CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, true);
finalMsg += message;
// display msg with good color
// TDataSetIndex dsi; // not used ....
PeopleInterraction.ChatInput.Tell.displayTellMessage(/*dsi, */finalMsg, receiver, prop.getRGBA());
ucstring s = CI18N::get("youTellPlayer");
strFindReplace(s, "%name", receiver);
strFindReplace(finalMsg, CI18N::get("youTell"), s);
CInterfaceManager::getInstance()->log(finalMsg);
}