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


C++ LLAvatarName::getLegacyName方法代码示例

本文整理汇总了C++中LLAvatarName::getLegacyName方法的典型用法代码示例。如果您正苦于以下问题:C++ LLAvatarName::getLegacyName方法的具体用法?C++ LLAvatarName::getLegacyName怎么用?C++ LLAvatarName::getLegacyName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLAvatarName的用法示例。


在下文中一共展示了LLAvatarName::getLegacyName方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: onAvatarNameLookup

//static 
// [Ansariel/Henri: Display name support]
void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const LLAvatarName& avatar_name, void* user_data)
// [/Ansariel/Henri: Display name support]
{
	LLSpeaker* speaker_ptr = ((LLHandle<LLSpeaker>*)user_data)->get();
	delete (LLHandle<LLSpeaker>*)user_data;

	if (speaker_ptr)
	{
        // [Ansariel/Henri: Display name support]
		static S32* sPhoenixNameSystem = rebind_llcontrol<S32>("PhoenixNameSystem", &gSavedSettings, true);
		switch (*sPhoenixNameSystem)
		{
			case 0 : speaker_ptr->mDisplayName = avatar_name.getLegacyName(); break;
			case 1 : speaker_ptr->mDisplayName = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break;
			case 2 : speaker_ptr->mDisplayName = avatar_name.mDisplayName; break;
			default : speaker_ptr->mDisplayName = avatar_name.getLegacyName(); break;
		}
		
		// Also set the legacy name. We will need it to initiate a new
		// IM session.
		speaker_ptr->mLegacyName = avatar_name.getLegacyName();
	    // [/Ansariel/Henri: Display name support]
		
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-1.0.0g
		// TODO-RLVa: this seems to get called per frame which is very likely an LL bug that will eventuall get fixed
		if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
			speaker_ptr->mDisplayName = RlvStrings::getAnonym(speaker_ptr->mDisplayName);
// [/RLVa:KB]
	}
}
开发者ID:Xara,项目名称:Immortality,代码行数:32,代码来源:llfloateractivespeakers.cpp

示例2: getPNSName

// get() with callback compatible version of getPNSName
void LLAvatarNameCache::getPNSName(const LLAvatarName& avatar_name, std::string& name, const S32& name_system)
{
	switch (name_system)
	{
		case 0 : name = avatar_name.getLegacyName(); break;
		case 1 : name = avatar_name.getCompleteName(); break;
		case 2 : name = avatar_name.mDisplayName; break;
		case 3 : name = avatar_name.getLegacyName() + (avatar_name.mIsDisplayNameDefault ? "" : " (" + avatar_name.mDisplayName + ")"); break;
		default : name = avatar_name.getLegacyName(); break;
	}
}
开发者ID:ArxNet,项目名称:SingularityViewer,代码行数:12,代码来源:llavatarnamecache.cpp

示例3: getPNSName

// get() with callback compatible version of getPNSName
void LLAvatarNameCache::getPNSName(const LLAvatarName& avatar_name, std::string& name)
{
	static LLCachedControl<S32> phoenix_name_system("PhoenixNameSystem", 0);
	switch (phoenix_name_system)
	{
		case 0 : name = avatar_name.getLegacyName(); break;
		case 1 : name = avatar_name.getCompleteName(); break;
		case 2 : name = avatar_name.mDisplayName; break;
		default : name = avatar_name.getLegacyName(); break;
	}
}
开发者ID:ap0110,项目名称:SingularityViewer,代码行数:12,代码来源:llavatarnamecache.cpp

示例4: on_avatar_name_cache_start_im

static void on_avatar_name_cache_start_im(const LLUUID& agent_id, const LLAvatarName& av_name)
{
	static LLCachedControl<bool> tear_off("OtherChatsTornOff");
	if (!tear_off) gIMMgr->setFloaterOpen(true);
	gIMMgr->addSession(LLCacheName::cleanFullName(av_name.getLegacyName()), IM_NOTHING_SPECIAL, agent_id);
	make_ui_sound("UISndStartIM");
}
开发者ID:Ratany,项目名称:SingularityViewer,代码行数:7,代码来源:llavataractions.cpp

示例5: filterNames

// Checked: 2010-12-08 (RLVa-1.2.2c) | Modified: RLVa-1.2.2c
void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy)
{
	uuid_vec_t idAgents;
	LLWorld::getInstance()->getAvatars(&idAgents, NULL);
	for (int idxAgent = 0, cntAgent = idAgents.size(); idxAgent < cntAgent; idxAgent++)
	{
		LLAvatarName avName;
		if (LLAvatarNameCache::get(idAgents[idxAgent], &avName))
		{
			const std::string& strDisplayName = escape_for_regex(avName.getDisplayName());
			bool fFilterDisplay = (strDisplayName.length() > 2);
			const std::string& strLegacyName = avName.getLegacyName();
			fFilterLegacy &= (strLegacyName.length() > 2);
			const std::string& strAnonym = RlvStrings::getAnonym(avName);

			// If the display name is a subset of the legacy name we need to filter that first, otherwise it's the other way around
			if (boost::icontains(strLegacyName, strDisplayName))
			{
				if (fFilterLegacy)
					boost::replace_all_regex(strUTF8Text, boost::regex("\\b" + strLegacyName + "\\b", boost::regex::icase), strAnonym);
				if (fFilterDisplay)
					boost::replace_all_regex(strUTF8Text, boost::regex("\\b" + strDisplayName + "\\b", boost::regex::icase), strAnonym);
			}
			else
			{
				if (fFilterDisplay)
					boost::replace_all_regex(strUTF8Text, boost::regex("\\b" + strDisplayName + "\\b", boost::regex::icase), strAnonym);
				if (fFilterLegacy)
					boost::replace_all_regex(strUTF8Text, boost::regex("\\b" + strLegacyName + "\\b", boost::regex::icase), strAnonym);
			}
		}
	}
}
开发者ID:hades187,项目名称:singu,代码行数:34,代码来源:rlvcommon.cpp

示例6: filterNames

// Checked: 2010-12-08 (RLVa-1.2.2c) | Modified: RLVa-1.2.2c
void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy)
{
	std::vector<LLUUID> idAgents;
	LLWorld::getInstance()->getAvatars(&idAgents, NULL);

	for (int idxAgent = 0, cntAgent = idAgents.size(); idxAgent < cntAgent; idxAgent++)
	{
		LLAvatarName avName;
		if (LLAvatarNameCache::get(idAgents[idxAgent], &avName))
		{
			const std::string& strAnonym = RlvStrings::getAnonym(avName.mDisplayName);

			// NOTE: if the legacy first and last name are empty we get a legacy name of " " which would replace all spaces in the string
			std::string strLegacyName;
			if ( (fFilterLegacy) && (!avName.mIsDisplayNameDefault) && (!avName.mLegacyFirstName.empty()) )
				strLegacyName = avName.getLegacyName();

			// If the display name is a subset of the legacy name we need to filter that first, otherwise it's the other way around
			if (std::string::npos != strLegacyName.find(avName.mDisplayName))
			{
				if (!strLegacyName.empty())
					rlvStringReplace(strUTF8Text, strLegacyName, strAnonym);
				rlvStringReplace(strUTF8Text, avName.mDisplayName, strAnonym);
			}
			else
			{
				rlvStringReplace(strUTF8Text, avName.mDisplayName, strAnonym);
				if (!strLegacyName.empty())
					rlvStringReplace(strUTF8Text, strLegacyName, strAnonym);
			}
		}
	}
}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:34,代码来源:rlvcommon.cpp

示例7: on_avatar_name_cache_notify

static void on_avatar_name_cache_notify(const LLUUID& agent_id,
										const LLAvatarName& av_name,
										bool online,
										LLSD payload)
{
	// Popup a notify box with online status of this agent
	// Use display name only because this user is your friend
	LLSD args;
	switch (gSavedSettings.getS32("PhoenixNameSystem"))
	{
		case 0 : args["NAME"] = av_name.getLegacyName(); break;
		case 1 : args["NAME"] = (av_name.mIsDisplayNameDefault ? av_name.mDisplayName : av_name.getCompleteName()); break;
		case 2 : args["NAME"] = av_name.mDisplayName; break;
		default : args["NAME"] = av_name.getCompleteName(); break;
	}
	
	// Popup a notify box with online status of this agent
	LLNotificationPtr notification = LLNotificationsUtil::add(online ? "FriendOnline" : "FriendOffline", args, payload);

	// If there's an open IM session with this agent, send a notification there too.
	LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id);
	LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id);
	if (floater)
	{
		std::string notifyMsg = notification->getMessage();
		if (!notifyMsg.empty())
			floater->addHistoryLine(notifyMsg,gSavedSettings.getColor4("SystemChatColor"));
	}
}
开发者ID:Logear,项目名称:PartyHatViewer,代码行数:29,代码来源:llcallingcard.cpp

示例8: on_avatar_name_cache_start_call

static void on_avatar_name_cache_start_call(const LLUUID& agent_id,
											const LLAvatarName& av_name)
{
	LLUUID session_id = gIMMgr->addSession(LLCacheName::cleanFullName(av_name.getLegacyName()), IM_NOTHING_SPECIAL, agent_id);
	if (session_id.notNull())
	{
		gIMMgr->startCall(session_id);
	}
	make_ui_sound("UISndStartIM");
}
开发者ID:Ratany,项目名称:SingularityViewer,代码行数:10,代码来源:llavataractions.cpp

示例9: onAvatarNameLookup

// Ansariel: Name lookup callback for chat console output
// FS:LO FIRE-5230 - Chat Console Improvement: Replacing the "IM" in front of group chat messages with the actual group name
//void LLIMHandler::onAvatarNameLookup(const LLUUID& agent_id, const LLAvatarName& av_name, const std::string& message_str)
void LLIMHandler::onAvatarNameLookup(const LLUUID& agent_id, const LLAvatarName& av_name, const std::string& message_str, const std::string& group)
{
	std::string senderName;
	std::string message(message_str);
	std::string delimiter = ": ";
	std::string prefix = message.substr(0, 4);
	LLStringUtil::toLower(prefix);

	// irc styled messages
	if (prefix == "/me " || prefix == "/me'")
	{
		delimiter = LLStringUtil::null;
		message = message.substr(3);
	}

	static LLCachedControl<bool> nameTagShowUsernames(gSavedSettings, "NameTagShowUsernames");
	static LLCachedControl<bool> useDisplayNames(gSavedSettings, "UseDisplayNames");
	if (nameTagShowUsernames && useDisplayNames)
	{
		senderName = av_name.getCompleteName();
	}
	else if (useDisplayNames)
	{
		senderName = av_name.mDisplayName;
	}
	else
	{
		senderName = av_name.getLegacyName();
	}

	if (rlv_handler_t::isEnabled() && gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
	{
		senderName = RlvStrings::getAnonym(senderName);
	}

	// FS:LO FIRE-5230 - Chat Console Improvement: Replacing the "IM" in front of group chat messages with the actual group name
	if(group != "")
	{
		senderName = "[" + group + "] " + senderName;
	}
	// FS:LO FIRE-5230 - Chat Console Improvement: Replacing the "IM" in front of group chat messages with the actual group name

	LLColor4 textColor = LLUIColorTable::instance().getColor("AgentChatColor");
	//color based on contact sets prefs
	if(LGGContactSets::getInstance()->hasFriendColorThatShouldShow(agent_id,TRUE))
	{
		textColor = LGGContactSets::getInstance()->getFriendColor(agent_id);
	}
	gConsole->addConsoleLine("IM: " + senderName + delimiter + message, textColor);

	LLFloaterNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLFloaterNearbyChat>("nearby_chat", LLSD());
	gConsole->setVisible(!nearby_chat->getVisible());
}
开发者ID:wish-ds,项目名称:firestorm-ds,代码行数:56,代码来源:llimhandler.cpp

示例10: on_avatar_name_cache_teleport_request

// static
void LLAvatarActions::on_avatar_name_cache_teleport_request(const LLUUID& id, const LLAvatarName& av_name)
{
	LLSD notification;
	notification["uuid"] = id;
	std::string name;
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
	if (!RlvActions::canShowName(RlvActions::SNC_TELEPORTREQUEST))
		name = RlvStrings::getAnonym(av_name.getLegacyName());
	else
// [RLVa:KB]
		name = av_name.getNSName();
	notification["NAME"] = name;
	LLSD payload;

	LLNotificationsUtil::add("TeleportRequestPrompt", notification, payload, teleport_request_callback);
}
开发者ID:Ratany,项目名称:SingularityViewer,代码行数:17,代码来源:llavataractions.cpp

示例11: getName

std::string LLUrlEntryAgentUserName::getName(const LLAvatarName& avatar_name)
{
	return avatar_name.mUsername.empty() ? avatar_name.getLegacyName() : avatar_name.mUsername;
}
开发者ID:DarkSpyro003,项目名称:DarkSpyros_Viewer,代码行数:4,代码来源:llurlentry.cpp


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