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


C++ LauncherLink::GetName方法代码示例

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


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

示例1: Process

void LauncherList::Process() {
	//process pending launchers..
	std::vector<LauncherLink *>::iterator cur, end;
	cur = m_pendingLaunchers.begin();
	while(cur != m_pendingLaunchers.end()) {
		LauncherLink *l = *cur;
//printf("ProcP %d: %p\n", l->GetID(), l);
		if(!l->Process()) {
			//launcher has died before it identified itself.
			_log(WORLD__LAUNCH, "Removing pending launcher %d", l->GetID());
			cur = m_pendingLaunchers.erase(cur);
			delete l;
		} else if(l->HasName()) {
			//launcher has identified itself now.
			//remove ourself from the pending list
			cur = m_pendingLaunchers.erase(cur);
			std::string name = l->GetName();
			//kill off anybody else using our name.
			std::map<std::string, LauncherLink *>::iterator res;
			res = m_launchers.find(name);
			if(res != m_launchers.end()) {
				_log(WORLD__LAUNCH, "Ghosting launcher %s", name.c_str());
				delete res->second;
			}
			_log(WORLD__LAUNCH, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str());
			//put the launcher in the list.
			m_launchers[name] = l;
		} else {
			cur++;
		}
	}

	//process active launchers.
	std::map<std::string, LauncherLink *>::iterator curl, tmp;
	curl = m_launchers.begin();
	while(curl != m_launchers.end()) {
		LauncherLink *l = curl->second;
//printf("Proc %s(%d): %p\n", l->GetName(), l->GetID(), l);
		if(!l->Process()) {
			//launcher has died before it identified itself.
			_log(WORLD__LAUNCH, "Removing launcher %s (%d)", l->GetName(), l->GetID());
			tmp = curl;
			curl++;
			m_launchers.erase(tmp);
			delete l;
		} else {
			curl++;
		}
	}
}
开发者ID:Derision,项目名称:Server,代码行数:50,代码来源:LauncherList.cpp

示例2: itoa

map<string,string> EQW::GetZoneDetails(Const_char *zone_ref) {
	map<string,string> res;
	
	ZoneServer *zs = zoneserver_list.FindByID(atoi(zone_ref));
	if(zs == NULL) {
		res["error"] = "Invalid zone.";
		return(res);
	}
	
	res["type"] = zs->IsStaticZone()?"static":"dynamic";
	res["zone_id"] = itoa(zs->GetZoneID());
	res["launch_name"] = zs->GetLaunchName();
	res["launched_name"] = zs->GetLaunchedName();
	res["short_name"] = zs->GetZoneName();
	res["long_name"] = zs->GetZoneLongName();
	res["port"] = itoa(zs->GetCPort());
	res["player_count"] = itoa(zs->NumPlayers());
	
	//this isnt gunna work for dynamic zones...
	res["launcher"] = "";
	if(zs->GetZoneID() != 0) {
		LauncherLink *ll = launcher_list.FindByZone(zs->GetLaunchName());
		if(ll != NULL)
			res["launcher"] = ll->GetName();
	}
	
	return(res);
}
开发者ID:Xackery,项目名称:provztz,代码行数:28,代码来源:EQW.cpp


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