MoveInZone was causing inconsistencies since client was desyncing, we will do a full zone, fixed CheckTransporters to not send you to safe location

This commit is contained in:
Emagi 2025-06-21 21:13:14 -04:00
parent 6f3dc5119a
commit 31e8f782ce
3 changed files with 38 additions and 83 deletions

View File

@ -4893,35 +4893,6 @@ bool Client::GotoSpawn(const char* search_name, bool forceTarget) {
return true; return true;
} }
void Client::MoveInZone(float x, float y, float z, float h) {
SetReloadingZone(true);
GetPlayer()->SetX(x);
GetPlayer()->SetY(y);
GetPlayer()->SetZ(z);
GetPlayer()->SetHeading(h);
GetPlayer()->SetSpawnOrigX(x);
GetPlayer()->SetSpawnOrigY(y);
GetPlayer()->SetSpawnOrigZ(z);
GetPlayer()->SetSpawnOrigHeading(h);
SetZoningCoords(x,y,z,h);
EQ2Packet* pack = GetPlayer()->Move(x, y, z, GetVersion());
if(pack)
QueuePacket(pack);
PacketStruct* packet = configReader.getStruct("WS_TeleportWithinZone", GetVersion());
if (packet)
{
packet->setDataByName("x", x);
packet->setDataByName("y", y);
packet->setDataByName("z", z);
QueuePacket(packet->serialize());
safe_delete(packet);
}
}
bool Client::CheckZoneAccess(const char* zoneName) { bool Client::CheckZoneAccess(const char* zoneName) {
LogWrite(CCLIENT__DEBUG, 0, "Client", "Zone access check for %s (%u), client: %u", zoneName, database.GetZoneID(zoneName), GetVersion()); LogWrite(CCLIENT__DEBUG, 0, "Client", "Zone access check for %s (%u), client: %u", zoneName, database.GetZoneID(zoneName), GetVersion());
@ -10196,10 +10167,6 @@ void Client::ProcessTeleport(Spawn* spawn, vector<TransportDestination*>* destin
QueuePacket(app); QueuePacket(app);
} }
} }
else {
if (destination->destination_zone_id == GetCurrentZone()->GetZoneID() && destination->type == TRANSPORT_TYPE_FORCEZONE) {
MoveInZone(destination->destination_x, destination->destination_y, destination->destination_z, destination->destination_heading);
}
else { else {
// determine if this is an instanced zone that already exists // determine if this is an instanced zone that already exists
ZoneChangeDetails zone_details; ZoneChangeDetails zone_details;
@ -10225,7 +10192,6 @@ void Client::ProcessTeleport(Spawn* spawn, vector<TransportDestination*>* destin
} }
} }
} }
}
if (destination->message.length() > 0) if (destination->message.length() > 0)
SimpleMessage(CHANNEL_COLOR_YELLOW, destination->message.c_str()); SimpleMessage(CHANNEL_COLOR_YELLOW, destination->message.c_str());
} }
@ -10363,10 +10329,6 @@ void Client::ProcessTeleportLocation(EQApplicationPacket* app) {
QueuePacket(outapp); QueuePacket(outapp);
} }
} }
else {
if((destination->destination_zone_id == GetCurrentZone()->GetZoneID() && destination->type == TRANSPORT_TYPE_FORCEZONE)) {
MoveInZone(destination->destination_x, destination->destination_y, destination->destination_z, destination->destination_heading);
}
else { else {
GetPlayer()->SetX(destination->destination_x); GetPlayer()->SetX(destination->destination_x);
GetPlayer()->SetY(destination->destination_y); GetPlayer()->SetY(destination->destination_y);
@ -10390,7 +10352,6 @@ void Client::ProcessTeleportLocation(EQApplicationPacket* app) {
} }
} }
} }
}
if (destination->message.length() > 0) if (destination->message.length() > 0)
SimpleMessage(CHANNEL_COLOR_YELLOW, destination->message.c_str()); SimpleMessage(CHANNEL_COLOR_YELLOW, destination->message.c_str());
} }

View File

@ -292,7 +292,6 @@ public:
bool IdentifyInstance(ZoneChangeDetails* zone_details, int32 zoneID); bool IdentifyInstance(ZoneChangeDetails* zone_details, int32 zoneID);
bool TryZoneInstance(int32 zoneID, bool zone_coords_valid = false); bool TryZoneInstance(int32 zoneID, bool zone_coords_valid = false);
bool GotoSpawn(const char* search_name, bool forceTarget = false); bool GotoSpawn(const char* search_name, bool forceTarget = false);
void MoveInZone(float x, float y, float z, float h);
void DisplayDeadWindow(); void DisplayDeadWindow();
void HandlePlayerRevive(int32 point_id); void HandlePlayerRevive(int32 point_id);

View File

@ -3394,10 +3394,6 @@ void ZoneServer::CheckTransporters(Client* client) {
if(packet) if(packet)
client->QueuePacket(packet); client->QueuePacket(packet);
} }
else{
if(loc->force_zone && loc->destination_zone_id == GetZoneID()) {
client->MoveInZone(loc->destination_x, loc->destination_y, loc->destination_z, loc->destination_heading);
}
else{ else{
ZoneChangeDetails zone_details; ZoneChangeDetails zone_details;
bool foundZone = zone_list.GetZone(&zone_details, loc->destination_zone_id); bool foundZone = zone_list.GetZone(&zone_details, loc->destination_zone_id);
@ -3406,8 +3402,7 @@ void ZoneServer::CheckTransporters(Client* client) {
client->GetPlayer()->SetY(loc->destination_y); client->GetPlayer()->SetY(loc->destination_y);
client->GetPlayer()->SetZ(loc->destination_z); client->GetPlayer()->SetZ(loc->destination_z);
client->GetPlayer()->SetHeading(loc->destination_heading); client->GetPlayer()->SetHeading(loc->destination_heading);
client->Zone(&zone_details, (ZoneServer*)zone_details.zonePtr); client->Zone(&zone_details, (ZoneServer*)zone_details.zonePtr, false);
}
} }
} }
break; break;