Browse Source

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!)
Image 4 years ago
parent
commit
59dc1e49d4
2 changed files with 7 additions and 3 deletions
  1. 6 2
      EQ2/source/WorldServer/zoneserver.cpp
  2. 1 1
      EQ2/source/WorldServer/zoneserver.h

+ 6 - 2
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);

+ 1 - 1
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