From 59dc1e49d4dfcab1643f75945998834673da3235 Mon Sep 17 00:00:00 2001 From: Image <> Date: Sun, 19 Apr 2020 12:16:43 -0400 Subject: [PATCH] RemveSpawn changes - REmove spawn distance slightly increased to distance from send spawn distance. Secondly widgets/signs/doors all stay, only NPCs will be removed/added back to reduce lag in client (reduce loading!) --- EQ2/source/WorldServer/zoneserver.cpp | 8 ++++++-- EQ2/source/WorldServer/zoneserver.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/EQ2/source/WorldServer/zoneserver.cpp b/EQ2/source/WorldServer/zoneserver.cpp index 9fc550a0a..436c54529 100644 --- a/EQ2/source/WorldServer/zoneserver.cpp +++ b/EQ2/source/WorldServer/zoneserver.cpp @@ -1129,7 +1129,11 @@ void ZoneServer::CheckRemoveSpawnFromClient(Spawn* spawn) { packet = configReader.getStruct("WS_DestroyGhostCmd", packet_version); } - if(spawn && spawn != client->GetPlayer() && client->GetPlayer()->WasSentSpawn(spawn->GetID()) && client->GetPlayer()->WasSpawnRemoved(spawn) == false && (spawn_range_map.Get(client)->Get(spawn->GetID()) > REMOVE_SPAWN_DISTANCE && !spawn->IsWidget())){ + if(spawn && spawn != client->GetPlayer() && + client->GetPlayer()->WasSentSpawn(spawn->GetID()) && + client->GetPlayer()->WasSpawnRemoved(spawn) == false && + (spawn_range_map.Get(client)->Get(spawn->GetID()) > REMOVE_SPAWN_DISTANCE && + !spawn->IsSign() && !spawn->IsObject() && !spawn->IsWidget())){ SendRemoveSpawn(client, spawn, packet); } @@ -3537,7 +3541,7 @@ bool ZoneServer::SendRemoveSpawn(Client* client, Spawn* spawn, PacketStruct* pac int32 cur_id = client->GetPlayer()->GetIDWithPlayerSpawn(spawn); if(packet && index > 0 && client->GetPlayer()->WasSpawnRemoved(spawn) == false) { - LogWrite(ZONE__DEBUG, 7, "Zone", "Processing SendRemoveSpawn for spawn index %u...", index); + LogWrite(ZONE__DEBUG, 7, "Zone", "Processing SendRemoveSpawn for spawn index %u (%s)...cur_id: %i", index,spawn->GetName(), cur_id); packet->setDataByName("spawn_index", index); client->GetPlayer()->GetPlayerSpawnMap()->erase(index); client->GetPlayer()->GetPlayerSpawnIndexMap()->erase(spawn); diff --git a/EQ2/source/WorldServer/zoneserver.h b/EQ2/source/WorldServer/zoneserver.h index e8b4bc80c..8d4332f8c 100644 --- a/EQ2/source/WorldServer/zoneserver.h +++ b/EQ2/source/WorldServer/zoneserver.h @@ -98,7 +98,7 @@ class Bot; #define SEND_SPAWN_DISTANCE 250 /* when spawns appear visually to the client */ #define HEAR_SPAWN_DISTANCE 30 /* max distance a client can be from a spawn to 'hear' it */ #define MAX_CHASE_DISTANCE 80 -#define REMOVE_SPAWN_DISTANCE 280 +#define REMOVE_SPAWN_DISTANCE 300 // increased distance between send/remove is ideal, this makes sure there is no overlap if a 'fast' client (AKA GM warp speed) #define SEND_SPAWN_INBULK_DISTANCE (SEND_SPAWN_DISTANCE+REMOVE_SPAWN_DISTANCE)/2 #define TRACKING_STOP 0