From 7d0b37faec1d0743ebd8760455529fc6ff6eb589 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 15 Aug 2019 18:01:51 +0100 Subject: [PATCH] still another missing ShowNPCs case, and needed changes for prev commit --- .../CoreModules/World/WorldMap/WorldMapModule.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index be9a8802fd..e7b9cb5c8f 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -88,14 +88,14 @@ namespace OpenSim.Region.CoreModules.World.WorldMap private List m_rootAgents = new List(); private volatile bool threadrunning = false; // expire time for the blacklists in seconds - private double expireBlackListTime = 600.0; // 10 minutes + protected double expireBlackListTime = 600.0; // 10 minutes // expire mapItems responses time in seconds. Throttles requests to regions that do answer private const double expireResponsesTime = 120.0; // 2 minutes ? //private int CacheRegionsDistance = 256; - private bool m_exportPrintScale = false; // prints the scale of map in meters on exported map - private bool m_exportPrintRegionName = false; // prints the region name exported map - private bool m_showNPCs = true; + protected bool m_exportPrintScale = false; // prints the scale of map in meters on exported map + protected bool m_exportPrintRegionName = false; // prints the region name exported map + protected bool m_showNPCs = true; #region INonSharedRegionModule Members public virtual void Initialise(IConfigSource config) @@ -490,7 +490,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap // Service 6 right now (MAP_ITEM_AGENTS_LOCATION; green dots) int tc = Environment.TickCount; - if (m_scene.GetRootAgentCount() <= 1) + if (m_scene.GetRootAgentCount() <= 1) //own position is not sent { mapitem = new mapItemReply( xstart + 1, @@ -617,7 +617,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap // Service 6 right now (MAP_ITEM_AGENTS_LOCATION; green dots) int tc = Environment.TickCount; - if (m_scene.GetRootAgentCount() <= 1) + if (m_scene.GetRootAgentCount() <= 1) // own is not sent { mapitem = new mapItemReply( xstart + 1, @@ -1578,6 +1578,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap OSDArray responsearr = new OSDArray(); // Don't preallocate. MT (m_scene.GetRootAgentCount()); m_scene.ForEachRootScenePresence(delegate (ScenePresence sp) { + if (!m_showNPCs && sp.IsNPC) + return; OSDMap responsemapdata = new OSDMap(); responsemapdata["X"] = OSD.FromInteger((int)(xstart + sp.AbsolutePosition.X)); responsemapdata["Y"] = OSD.FromInteger((int)(ystart + sp.AbsolutePosition.Y));