From 042c9ed4d82e4389ec929f5438e82defad251235 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 25 May 2008 11:22:05 +0000 Subject: * Adds Top Colliders when using ODE. Access it from the estate tools/debug tab. --- .../Modules/World/Estate/EstateManagementModule.cs | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'OpenSim/Region/Environment/Modules/World/Estate') diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index fcdec5d..d3aa4aa 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs @@ -311,6 +311,44 @@ namespace OpenSim.Region.Environment.Modules.World.Estate { remote_client.sendEstateCovenantInformation(); } + private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) + { + Dictionary colliders = m_scene.PhysicsScene.GetTopColliders(); + + List collidera = new List(); + lock (colliders) + { + foreach (uint obj in colliders.Keys) + { + SceneObjectPart prt = m_scene.GetSceneObjectPart(obj); + if (prt != null) + { + if (prt.ParentGroup != null) + { + SceneObjectGroup sog = prt.ParentGroup; + if (sog != null) + { + LandStatReportItem lsri = new LandStatReportItem(); + lsri.LocationX = sog.AbsolutePosition.X; + lsri.LocationY = sog.AbsolutePosition.Y; + lsri.LocationZ = sog.AbsolutePosition.Z; + lsri.Score = colliders[obj]; + lsri.TaskID = sog.UUID; + lsri.TaskLocalID = sog.LocalId; + lsri.TaskName = sog.GetPartName(obj); + lsri.OwnerName = m_scene.CommsManager.UUIDNameRequestString(sog.OwnerID); + + + collidera.Add(lsri); + } + } + } + + } + } + remoteClient.SendLandStatReply(reportType, requestFlags, (uint)collidera.Count,collidera.ToArray()); + + } #endregion @@ -435,6 +473,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate client.OnRegionInfoRequest += HandleRegionInfoRequest; client.OnEstateCovenantRequest += HandleEstateCovenantRequest; + client.OnLandStatRequest += HandleLandStatRequest; sendRegionHandshake(client); } } -- cgit v1.1