本文整理汇总了C++中ZSList::FindByID方法的典型用法代码示例。如果您正苦于以下问题:C++ ZSList::FindByID方法的具体用法?C++ ZSList::FindByID怎么用?C++ ZSList::FindByID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZSList
的用法示例。
在下文中一共展示了ZSList::FindByID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: handle_rc_get_zone_info
void handle_rc_get_zone_info(const std::string &method, const std::string &connection_id, const std::string &request_id, const std::vector<std::string> ¶ms) {
std::string error;
std::map<std::string, std::string> res;
if(params.size() != 1) {
error = "Expected only one zone_id.";
RemoteCallResponse(connection_id, request_id, res, error);
return;
}
ZoneServer *zs = zoneserver_list.FindByID(atoi(params[0].c_str()));
if(zs == nullptr) {
error = "Invalid zone";
RemoteCallResponse(connection_id, request_id, res, error);
return;
}
res["type"] = zs->IsStaticZone() ? "static" : "dynamic";
res["zone_id"] = itoa(zs->GetZoneID());
res["instance_id"] = itoa(zs->GetInstanceID());
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());
RemoteCallResponse(connection_id, request_id, res, error);
}
示例3: Process
//.........这里部分代码省略.........
break;
const LaunchName_Struct* ln = (const LaunchName_Struct*)pack->pBuffer;
launcher_name = ln->launcher_name;
launched_name = ln->zone_name;
zlog(WORLD__ZONE, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str());
break;
}
case ServerOP_ShutdownAll: {
if(pack->size==0){
zoneserver_list.SendPacket(pack);
zoneserver_list.Process();
CatchSignal(2);
}
else{
WorldShutDown_Struct* wsd=(WorldShutDown_Struct*)pack->pBuffer;
if(wsd->time==0 && wsd->interval==0 && zoneserver_list.shutdowntimer->Enabled()){
zoneserver_list.shutdowntimer->Disable();
zoneserver_list.reminder->Disable();
}
else{
zoneserver_list.shutdowntimer->SetTimer(wsd->time);
zoneserver_list.reminder->SetTimer(wsd->interval-1000);
zoneserver_list.reminder->SetAtTrigger(wsd->interval);
zoneserver_list.shutdowntimer->Start();
zoneserver_list.reminder->Start();
}
}
break;
}
case ServerOP_ZoneShutdown: {
ServerZoneStateChange_struct* s = (ServerZoneStateChange_struct *) pack->pBuffer;
ZoneServer* zs = 0;
if (s->ZoneServerID != 0)
zs = zoneserver_list.FindByID(s->ZoneServerID);
else if (s->zoneid != 0)
zs = zoneserver_list.FindByName(database.GetZoneName(s->zoneid));
else
zoneserver_list.SendEmoteMessage(s->adminname, 0, 0, 0, "Error: SOP_ZoneShutdown: neither ID nor name specified");
if (zs == 0)
zoneserver_list.SendEmoteMessage(s->adminname, 0, 0, 0, "Error: SOP_ZoneShutdown: zoneserver not found");
else
zs->SendPacket(pack);
break;
}
case ServerOP_ZoneBootup: {
ServerZoneStateChange_struct* s = (ServerZoneStateChange_struct *) pack->pBuffer;
zoneserver_list.SOPZoneBootup(s->adminname, s->ZoneServerID, database.GetZoneName(s->zoneid), s->makestatic);
break;
}
case ServerOP_ZoneStatus: {
if (pack->size >= 1)
zoneserver_list.SendZoneStatus((char *) &pack->pBuffer[1], (uint8) pack->pBuffer[0], this);
break;
}
case ServerOP_AcceptWorldEntrance: {
if(pack->size != sizeof(WorldToZone_Struct))
break;
WorldToZone_Struct* wtz = (WorldToZone_Struct*) pack->pBuffer;
Client* client = 0;
client = client_list.FindByAccountID(wtz->account_id);
if(client != 0)
client->Clearance(wtz->response);
}