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


C++ HippoGridInfo::setFirstName方法代码示例

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


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

示例1: parseData

void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
{
	if (mergeIfNewer) {
		LLSD::array_const_iterator it, end = gridInfo.endArray();
		for (it = gridInfo.beginArray(); it != end; ++it) {
			LLSD gridMap = *it;
			if (gridMap.has("default_grids_version")) {
				int version = gridMap["default_grids_version"];
				if (version <= mDefaultGridsVersion) return;
				else break;
			}
		}
		if (it == end) {
			llwarns << "Grid data has no version number." << llendl;
			return;
		}
	}

	llinfos << "Loading grid data." << llendl;

	LLSD::array_const_iterator it, end = gridInfo.endArray();
	for (it = gridInfo.beginArray(); it != end; ++it) {
		LLSD gridMap = *it;
		if (gridMap.has("default_grids_version")) {
			mDefaultGridsVersion = gridMap["default_grids_version"];
		} else if (gridMap.has("gridnick") && gridMap.has("loginuri")) {
			std::string gridnick = gridMap["gridnick"];
			HippoGridInfo *grid;
			GridIterator it = mGridInfo.find(gridnick);
			bool newGrid = (it == mGridInfo.end());
			if (newGrid) {
				// create new grid info
				grid = new HippoGridInfo(gridnick);
			} else {
				// update existing grid info
				grid = it->second;
			}
			grid->setLoginUri(gridMap["loginuri"]);
			if (gridMap.has("platform")) grid->setPlatform(gridMap["platform"]);
			if (gridMap.has("gridname")) grid->setGridName(gridMap["gridname"]);
			if (gridMap.has("loginpage")) grid->setLoginPage(gridMap["loginpage"]);
			if (gridMap.has("helperuri")) grid->setHelperUri(gridMap["helperuri"]);
			if (gridMap.has("website")) grid->setWebSite(gridMap["website"]);
			if (gridMap.has("support")) grid->setSupportUrl(gridMap["support"]);
			if (gridMap.has("register")) grid->setRegisterUrl(gridMap["register"]);
			if (gridMap.has("password")) grid->setPasswordUrl(gridMap["password"]);
			//if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]);
			if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]);
			if (gridMap.has("firstname")) grid->setFirstName(gridMap["firstname"]);
			if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]);
			if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]);
			if (newGrid) addGrid(grid);
		}
	}
}
开发者ID:AGoodPerson,项目名称:Ascent,代码行数:55,代码来源:hippogridmanager.cpp

示例2: applyChanges

void FloaterGridManager::applyChanges()
{ 
	HippoGridInfo* gridInfo = gHippoGridManager->getGrid(mCurGrid);
	if (gridInfo) 
	{
		if (gridInfo->getGridNick() == childGetValue("gridnick").asString()) 
		{
			gridInfo->setGridName(childGetValue("gridname"));
			gridInfo->setLoginUri(childGetValue("loginuri"));
			gridInfo->setLoginPage(childGetValue("loginpage"));
			gridInfo->setHelperUri(childGetValue("helperuri"));
			gridInfo->setWebSite(childGetValue("website"));
			gridInfo->setSupportUrl(childGetValue("support"));
			gridInfo->setRegisterUrl(childGetValue("register"));
			gridInfo->setPasswordUrl(childGetValue("password"));
			gridInfo->setSearchUrl(childGetValue("search"));
			gridInfo->setRenderCompat(childGetValue("render_compat"));
			
			gridInfo->setFirstName(childGetValue("first_name"));
			gridInfo->setLastName(childGetValue("last_name"));
			if(childGetValue("avatar_password").asString().empty())
				gridInfo->setAvatarPassword(std::string(""));
			else if(childGetValue("avatar_password").asString() != std::string(PASSWORD_FILLER))
			{
				// store account authentication data
				std::string auth_password = childGetValue("avatar_password");
				std::string hashed_password;
				hashPassword(auth_password, hashed_password);
				gridInfo->setAvatarPassword(hashed_password);
			}

			//this bug was a feature -Patrick Sapinski (Friday, August 21, 2009)
			//LLPanelLogin::setFields(gridInfo->getFirstName(), gridInfo->getLastName(),
			//						gridInfo->getAvatarPassword(), true);
		} 
		else 
		{
			llwarns << "Grid nickname mismatch, ignoring changes." << llendl;
		}
	}
}
开发者ID:kow,项目名称:pleiaviewer,代码行数:41,代码来源:floatergridmanager.cpp

示例3: createNewGrid

bool FloaterGridManager::createNewGrid()
{
	// check nickname
	std::string gridnick = childGetValue("gridnick");
	if (gridnick == "<required>") 
	{
		gridnick = "";
	}

	if (gridnick.empty()) 
	{
		LLNotifications::instance().add("GridsNoNick");
		return false;
	}

	if (gHippoGridManager->getGrid(gridnick)) 
	{
		LLSD args;
		args["[NAME]"] = gridnick;
		LLNotifications::instance().add("GridExists", args);
		return false;
	}

	// check login URI
	std::string loginuri = childGetValue("loginuri");
	if ((loginuri.empty()) || (loginuri == "<required>")) 
	{
		LLSD args;
		args["[NAME]"] = gridnick;
		LLNotifications::instance().add("GridsNoLoginUri", args);
		return false;
	}

	// create new grid
	HippoGridInfo* grid = new HippoGridInfo(gridnick);
	grid->setGridName(childGetValue("gridname"));
	grid->setLoginUri(loginuri);
	grid->setLoginPage(childGetValue("loginpage"));
	grid->setHelperUri(childGetValue("helperuri"));
	grid->setWebSite(childGetValue("website"));
	grid->setSupportUrl(childGetValue("support"));
	grid->setRegisterUrl(childGetValue("register"));
	grid->setPasswordUrl(childGetValue("password"));
	grid->setSearchUrl(childGetValue("search"));
	grid->setRenderCompat(childGetValue("render_compat"));
	gHippoGridManager->addGrid(grid);
	
	grid->setFirstName(childGetValue("first_name"));
	grid->setLastName(childGetValue("last_name"));
	if(childGetValue("avatar_password").asString().empty())
		grid->setAvatarPassword(std::string(""));
	else
	{
		std::string hashed_password;
		hashPassword(childGetValue("avatar_password"), hashed_password);
		grid->setAvatarPassword(hashed_password);
	}
	
	setCurGrid(gridnick);
	return true;
}
开发者ID:kow,项目名称:pleiaviewer,代码行数:61,代码来源:floatergridmanager.cpp


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