本文整理汇总了C++中NetConnection::GetZoneAddress方法的典型用法代码示例。如果您正苦于以下问题:C++ NetConnection::GetZoneAddress方法的具体用法?C++ NetConnection::GetZoneAddress怎么用?C++ NetConnection::GetZoneAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetConnection
的用法示例。
在下文中一共展示了NetConnection::GetZoneAddress方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetConnectInfo
void WorldServer::SetConnectInfo()
{
ServerPacket* pack = new ServerPacket(ServerOP_SetConnectInfo, sizeof(ServerConnectInfo));
pack->pBuffer = new uchar[pack->size];
memset(pack->pBuffer, 0, pack->size);
ServerConnectInfo* sci = (ServerConnectInfo*) pack->pBuffer;
sci->port = net.GetZonePort();
strcpy(sci->address, net.GetZoneAddress());
SendPacket(pack);
safe_delete(pack);//delete pack;
}
示例2: Process
//.........这里部分代码省略.........
worldserver.SendEmoteMessage(0, 0, 15, "Zone shutdown: %s", zone->GetLongName());
ServerZoneStateChange_struct* zst = (ServerZoneStateChange_struct *) pack->pBuffer;
cout << "Zone shutdown by " << zst->adminname << endl;
Zone::Shutdown();
}
break;
}
case ServerOP_ZoneBootup:
{
ServerZoneStateChange_struct* zst = (ServerZoneStateChange_struct *) pack->pBuffer;
if (ZoneLoaded)
{
SetZone(zone->GetShortName());
if (strcasecmp(Database::Instance()->GetZoneName(zst->zoneid), zone->GetShortName()) == 0)
{
// This packet also doubles as "incomming client" notification, lets not shut down before they get here
zone->StartShutdownTimer(AUTHENTICATION_TIMEOUT * 1000);
}
else
{
worldserver.SendEmoteMessage(zst->adminname, 0, 0, "Zone bootup failed: Already running '%s'", zone->GetShortName());
}
break;
}
if (zst->adminname[0] != 0)
{
cout << "Zone bootup by " << zst->adminname << endl;
}
if (!(Zone::Bootup(Database::Instance()->GetZoneName(zst->zoneid))))
{
worldserver.SendChannelMessage(0, 0, 10, 0, 0, "%s:%i Zone::Bootup failed: %s", net.GetZoneAddress(), net.GetZonePort(), Database::Instance()->GetZoneName(zst->zoneid));
}
break;
}
case ServerOP_ZonePlayer:
{
ServerZonePlayer_Struct* szp = (ServerZonePlayer_Struct*) pack->pBuffer;
Client* client = entity_list.GetClientByName(szp->name);
if (client != 0)
{
if (strcasecmp(szp->adminname, szp->name) == 0)
{
client->Message(BLACK, "Zoning to: %s", szp->zone);
}
else if (client->GetAnon() == 1 && client->Admin() > szp->adminrank)
{
break;
}
else
{
worldserver.SendEmoteMessage(szp->adminname, 0, 0, "Summoning %s to %s %1.1f, %1.1f, %1.1f", szp->name, szp->zone, szp->x_pos, szp->y_pos, szp->z_pos);
}
client->SetIsZoning(true);
client->SetUsingSoftCodedZoneLine(true);
client->SetZoningHeading(client->GetHeading());
client->SetZoningX(szp->x_pos);
client->SetZoningY(szp->y_pos);
client->SetZoningZ(szp->z_pos);
client->ZonePC(szp->zone, szp->x_pos, szp->y_pos, szp->z_pos);
}
break;
}
// Cofruben: used to send a packet directly to a client.