当前位置: 首页>>代码示例>>C++>>正文


C++ CClientChatManager::tell方法代码示例

本文整理汇总了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);
	}
}
开发者ID:mixxit,项目名称:solinia,代码行数:40,代码来源:chat_filter.cpp

示例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);
	}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:38,代码来源:client_chat_manager.cpp


注:本文中的CClientChatManager::tell方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。