本文整理汇总了C++中ZoneServer::IncommingClient方法的典型用法代码示例。如果您正苦于以下问题:C++ ZoneServer::IncommingClient方法的具体用法?C++ ZoneServer::IncommingClient怎么用?C++ ZoneServer::IncommingClient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZoneServer
的用法示例。
在下文中一共展示了ZoneServer::IncommingClient方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnterWorld
void Client::EnterWorld(bool TryBootup) {
if (zoneID == 0)
return;
ZoneServer* zs = nullptr;
if(instanceID > 0)
{
if(database.VerifyInstanceAlive(instanceID, GetCharID()))
{
if(database.VerifyZoneInstance(zoneID, instanceID))
{
zs = zoneserver_list.FindByInstanceID(instanceID);
}
else
{
instanceID = 0;
zs = nullptr;
database.MoveCharacterToBind(GetCharID());
ZoneUnavail();
return;
}
}
else
{
instanceID = 0;
zs = nullptr;
database.MoveCharacterToBind(GetCharID());
ZoneUnavail();
return;
}
}
else
zs = zoneserver_list.FindByZoneID(zoneID);
const char *zone_name=database.GetZoneName(zoneID, true);
if (zs) {
// warn the world we're comming, so it knows not to shutdown
zs->IncommingClient(this);
}
else {
if (TryBootup) {
clog(WORLD__CLIENT,"Attempting autobootup of %s (%d:%d)",zone_name,zoneID,instanceID);
autobootup_timeout.Start();
pwaitingforbootup = zoneserver_list.TriggerBootup(zoneID, instanceID);
if (pwaitingforbootup == 0) {
clog(WORLD__CLIENT_ERR,"No zoneserver available to boot up.");
ZoneUnavail();
}
return;
}
else {
clog(WORLD__CLIENT_ERR,"Requested zone %s is no running.",zone_name);
ZoneUnavail();
return;
}
}
pwaitingforbootup = 0;
cle->SetChar(charid, char_name);
database.UpdateLiveChar(char_name, GetAccountID());
clog(WORLD__CLIENT,"%s %s (%d:%d)",seencharsel ? "Entering zone" : "Zoning to",zone_name,zoneID,instanceID);
// database.SetAuthentication(account_id, char_name, zone_name, ip);
if (seencharsel) {
if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zoneID)) {
clog(WORLD__CLIENT_ERR,"Enter world failed. Zone is locked.");
ZoneUnavail();
return;
}
ServerPacket* pack = new ServerPacket;
pack->opcode = ServerOP_AcceptWorldEntrance;
pack->size = sizeof(WorldToZone_Struct);
pack->pBuffer = new uchar[pack->size];
memset(pack->pBuffer, 0, pack->size);
WorldToZone_Struct* wtz = (WorldToZone_Struct*) pack->pBuffer;
wtz->account_id = GetAccountID();
wtz->response = 0;
zs->SendPacket(pack);
delete pack;
}
else { // if they havent seen character select screen, we can assume this is a zone
// to zone movement, which should be preauthorized before they leave the previous zone
Clearance(1);
}
}