本文整理汇总了C++中ZSList::GetAvailableZonePort方法的典型用法代码示例。如果您正苦于以下问题:C++ ZSList::GetAvailableZonePort方法的具体用法?C++ ZSList::GetAvailableZonePort怎么用?C++ ZSList::GetAvailableZonePort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZSList
的用法示例。
在下文中一共展示了ZSList::GetAvailableZonePort方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Process
//.........这里部分代码省略.........
{
char *Recipient = (char *)pack->pBuffer;
client_list.SendPacket(Recipient, pack);
break;
}
case ServerOP_MultiLineMsg: {
ServerMultiLineMsg_Struct* mlm = (ServerMultiLineMsg_Struct*) pack->pBuffer;
client_list.SendPacket(mlm->to, pack);
break;
}
case ServerOP_SetZone: {
if(pack->size != sizeof(SetZone_Struct))
break;
SetZone_Struct* szs = (SetZone_Struct*) pack->pBuffer;
if (szs->zoneid != 0) {
if(database.GetZoneName(szs->zoneid))
SetZone(szs->zoneid, szs->instanceid, szs->staticzone);
else
SetZone(0);
}
else
SetZone(0);
break;
}
case ServerOP_SetConnectInfo: {
if (pack->size != sizeof(ServerConnectInfo))
break;
ServerConnectInfo* sci = (ServerConnectInfo*) pack->pBuffer;
if (!sci->port) {
clientport=zoneserver_list.GetAvailableZonePort();
ServerPacket p(ServerOP_SetConnectInfo, sizeof(ServerConnectInfo));
memset(p.pBuffer,0,sizeof(ServerConnectInfo));
ServerConnectInfo* sci = (ServerConnectInfo*) p.pBuffer;
sci->port = clientport;
SendPacket(&p);
zlog(WORLD__ZONE,"Auto zone port configuration. Telling zone to use port %d",clientport);
} else {
clientport=sci->port;
zlog(WORLD__ZONE,"Zone specified port %d, must be a previously allocated zone reconnecting.",clientport);
}
}
case ServerOP_SetLaunchName: {
if(pack->size != sizeof(LaunchName_Struct))
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();