Some changes to ordering of login authorization for world<->zone

This commit is contained in:
KimLS 2019-07-30 19:12:44 -07:00
parent b754ddbc67
commit e56edd9231
4 changed files with 30 additions and 12 deletions

View File

@ -104,6 +104,7 @@ Client::Client(EQStreamInterface* ieqs)
char_name[0] = 0; char_name[0] = 0;
charid = 0; charid = 0;
zone_waiting_for_bootup = 0; zone_waiting_for_bootup = 0;
enter_world_triggered = false;
StartInTutorial = false; StartInTutorial = false;
m_ClientVersion = eqs->ClientVersion(); m_ClientVersion = eqs->ClientVersion();
@ -1192,8 +1193,16 @@ void Client::EnterWorld(bool TryBootup) {
const char *zone_name = database.GetZoneName(zone_id, true); const char *zone_name = database.GetZoneName(zone_id, true);
if (zone_server) { if (zone_server) {
// warn the world we're comming, so it knows not to shutdown if (false == enter_world_triggered) {
zone_server->IncomingClient(this); //Drop any clients we own in other zones.
zoneserver_list.DropClient(GetLSID(), zone_server);
// warn the zone we're coming
zone_server->IncomingClient(this);
//tell the server not to trigger this multiple times before we get a zone unavailable
enter_world_triggered = true;
}
} }
else { else {
if (TryBootup) { if (TryBootup) {
@ -1212,9 +1221,17 @@ void Client::EnterWorld(bool TryBootup) {
return; return;
} }
} }
zone_waiting_for_bootup = 0; zone_waiting_for_bootup = 0;
if(!cle) { if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zone_id)) {
Log(Logs::General, Logs::World_Server, "Enter world failed. Zone is locked.");
TellClientZoneUnavailable();
return;
}
if (!cle) {
TellClientZoneUnavailable();
return; return;
} }
@ -1231,12 +1248,6 @@ void Client::EnterWorld(bool TryBootup) {
); );
if (seen_character_select) { if (seen_character_select) {
if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zone_id)) {
Log(Logs::General, Logs::World_Server, "Enter world failed. Zone is locked.");
TellClientZoneUnavailable();
return;
}
auto pack = new ServerPacket; auto pack = new ServerPacket;
pack->opcode = ServerOP_AcceptWorldEntrance; pack->opcode = ServerOP_AcceptWorldEntrance;
pack->size = sizeof(WorldToZone_Struct); pack->size = sizeof(WorldToZone_Struct);
@ -1356,6 +1367,7 @@ void Client::TellClientZoneUnavailable() {
zone_id = 0; zone_id = 0;
zone_waiting_for_bootup = 0; zone_waiting_for_bootup = 0;
enter_world_triggered = false;
autobootup_timeout.Disable(); autobootup_timeout.Disable();
} }

View File

@ -82,6 +82,7 @@ private:
bool is_player_zoning; bool is_player_zoning;
Timer autobootup_timeout; Timer autobootup_timeout;
uint32 zone_waiting_for_bootup; uint32 zone_waiting_for_bootup;
bool enter_world_triggered;
bool StartInTutorial; bool StartInTutorial;
EQEmu::versions::ClientVersion m_ClientVersion; EQEmu::versions::ClientVersion m_ClientVersion;

View File

@ -708,11 +708,16 @@ void ZSList::WorldShutDown(uint32 time, uint32 interval)
} }
} }
void ZSList::DropClient(uint32 lsid) { void ZSList::DropClient(uint32 lsid, ZoneServer *ignore_zoneserver) {
ServerPacket packet(ServerOP_DropClient, sizeof(ServerZoneDropClient_Struct)); ServerPacket packet(ServerOP_DropClient, sizeof(ServerZoneDropClient_Struct));
auto drop = (ServerZoneDropClient_Struct*)packet.pBuffer; auto drop = (ServerZoneDropClient_Struct*)packet.pBuffer;
drop->lsid = lsid; drop->lsid = lsid;
SendPacket(&packet);
for (auto &zs : zone_server_list) {
if (zs.get() != ignore_zoneserver) {
zs->SendPacket(&packet);
}
}
} }
void ZSList::OnTick(EQ::Timer *t) void ZSList::OnTick(EQ::Timer *t)

View File

@ -57,7 +57,7 @@ public:
void SOPZoneBootup(const char *adminname, uint32 ZoneServerID, const char *zonename, bool iMakeStatic = false); void SOPZoneBootup(const char *adminname, uint32 ZoneServerID, const char *zonename, bool iMakeStatic = false);
void UpdateUCSServerAvailable(bool ucss_available = true); void UpdateUCSServerAvailable(bool ucss_available = true);
void WorldShutDown(uint32 time, uint32 interval); void WorldShutDown(uint32 time, uint32 interval);
void DropClient(uint32 lsid); void DropClient(uint32 lsid, ZoneServer *ignore_zoneserver);
ZoneServer* FindByPort(uint16 port); ZoneServer* FindByPort(uint16 port);
ZoneServer* FindByID(uint32 ZoneID); ZoneServer* FindByID(uint32 ZoneID);