aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/IClientAPI.cs6
-rw-r--r--OpenSim/Framework/LandStatReportItem.cs54
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs56
-rw-r--r--OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs39
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs6
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs7
-rw-r--r--OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs6
-rw-r--r--OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs7
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsActor.cs5
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsScene.cs9
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs1
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs5
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs30
-rw-r--r--OpenSim/Region/Physics/POSPlugin/POSPlugin.cs8
-rw-r--r--OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs8
15 files changed, 243 insertions, 4 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index f260245..0823b0d 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -610,6 +610,8 @@ namespace OpenSim.Framework
610 610
611 public delegate void ForceReleaseControls(IClientAPI remoteClient, LLUUID agentID); 611 public delegate void ForceReleaseControls(IClientAPI remoteClient, LLUUID agentID);
612 612
613 public delegate void GodLandStatRequest(int parcelID, uint reportType, uint requestflags, string filter, IClientAPI remoteClient);
614
613 //Estate Requests 615 //Estate Requests
614 public delegate void DetailedEstateDataRequest(IClientAPI remoteClient, LLUUID invoice); 616 public delegate void DetailedEstateDataRequest(IClientAPI remoteClient, LLUUID invoice);
615 public delegate void SetEstateFlagsRequest(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, int matureLevel, bool restrictPushObject, bool allowParcelChanges); 617 public delegate void SetEstateFlagsRequest(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, int matureLevel, bool restrictPushObject, bool allowParcelChanges);
@@ -626,6 +628,7 @@ namespace OpenSim.Framework
626 public delegate void EstateDebugRegionRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics); 628 public delegate void EstateDebugRegionRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics);
627 public delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID prey); 629 public delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID prey);
628 630
631
629 public interface IClientAPI 632 public interface IClientAPI
630 { 633 {
631 LLVector3 StartPos { get; set; } 634 LLVector3 StartPos { get; set; }
@@ -801,6 +804,7 @@ namespace OpenSim.Framework
801 event AgentSit OnUndo; 804 event AgentSit OnUndo;
802 805
803 event ForceReleaseControls OnForceReleaseControls; 806 event ForceReleaseControls OnForceReleaseControls;
807 event GodLandStatRequest OnLandStatRequest;
804 808
805 event DetailedEstateDataRequest OnDetailedEstateDataRequest; 809 event DetailedEstateDataRequest OnDetailedEstateDataRequest;
806 event SetEstateFlagsRequest OnSetEstateFlagsRequest; 810 event SetEstateFlagsRequest OnSetEstateFlagsRequest;
@@ -989,6 +993,8 @@ namespace OpenSim.Framework
989 993
990 void SendGroupNameReply(LLUUID groupLLUID, string GroupName); 994 void SendGroupNameReply(LLUUID groupLLUID, string GroupName);
991 995
996 void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia);
997
992 byte[] GetThrottlesPacked(float multiplier); 998 byte[] GetThrottlesPacked(float multiplier);
993 999
994 1000
diff --git a/OpenSim/Framework/LandStatReportItem.cs b/OpenSim/Framework/LandStatReportItem.cs
new file mode 100644
index 0000000..3a92253
--- /dev/null
+++ b/OpenSim/Framework/LandStatReportItem.cs
@@ -0,0 +1,54 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28
29using System;
30using System.Collections.Generic;
31using System.Text;
32using libsecondlife;
33
34
35namespace OpenSim.Framework
36{
37 public class LandStatReportItem
38 {
39 public float LocationX;
40 public float LocationY;
41 public float LocationZ;
42 public string OwnerName;
43 public float Score;
44 public LLUUID TaskID;
45 public uint TaskLocalID;
46 public string TaskName;
47
48 public LandStatReportItem()
49 {
50
51 }
52
53 }
54}
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 9bef65f..484518a 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -250,6 +250,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
250 250
251 private ForceReleaseControls handlerForceReleaseControls = null; 251 private ForceReleaseControls handlerForceReleaseControls = null;
252 252
253 private GodLandStatRequest handlerLandStatRequest = null;
254
253 private UUIDNameRequest handlerUUIDGroupNameRequest = null; 255 private UUIDNameRequest handlerUUIDGroupNameRequest = null;
254 256
255 private RequestObjectPropertiesFamily handlerObjectGroupRequest = null; 257 private RequestObjectPropertiesFamily handlerObjectGroupRequest = null;
@@ -842,6 +844,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
842 844
843 public event ForceReleaseControls OnForceReleaseControls; 845 public event ForceReleaseControls OnForceReleaseControls;
844 846
847 public event GodLandStatRequest OnLandStatRequest;
848
845 public event RequestObjectPropertiesFamily OnObjectGroupRequest; 849 public event RequestObjectPropertiesFamily OnObjectGroupRequest;
846 850
847 public event DetailedEstateDataRequest OnDetailedEstateDataRequest; 851 public event DetailedEstateDataRequest OnDetailedEstateDataRequest;
@@ -5641,11 +5645,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5641 OnEstateTeleportOneUserHomeRequest(this,invoice,SenderID,Prey); 5645 OnEstateTeleportOneUserHomeRequest(this,invoice,SenderID,Prey);
5642 } 5646 }
5643 break; 5647 break;
5648 case "colliders":
5649 handlerLandStatRequest = OnLandStatRequest;
5650 if (handlerLandStatRequest != null)
5651 {
5652 handlerLandStatRequest(0, 1, 0, "", this);
5653 }
5654 break;
5644 default: 5655 default:
5645 m_log.Error("EstateOwnerMessage: Unknown method requested\n" + messagePacket.ToString()); 5656 m_log.Error("EstateOwnerMessage: Unknown method requested\n" + messagePacket.ToString());
5646 break; 5657 break;
5647 } 5658 }
5648 break; 5659 break;
5660 case PacketType.LandStatRequest:
5661 LandStatRequestPacket lsrp = (LandStatRequestPacket)Pack;
5662
5663 handlerLandStatRequest = OnLandStatRequest;
5664 if (handlerLandStatRequest != null)
5665 {
5666 handlerLandStatRequest(lsrp.RequestData.ParcelLocalID,lsrp.RequestData.ReportType,lsrp.RequestData.RequestFlags,Helpers.FieldToUTF8String(lsrp.RequestData.Filter),this);
5667 }
5668 //int parcelID, uint reportType, uint requestflags, string filter
5669
5670 //lsrp.RequestData.ParcelLocalID;
5671 //lsrp.RequestData.ReportType; // 1 = colliders, 0 = scripts
5672 //lsrp.RequestData.RequestFlags;
5673 //lsrp.RequestData.Filter;
5674
5675 break;
5676
5649 case PacketType.RequestRegionInfo: 5677 case PacketType.RequestRegionInfo:
5650 RequestRegionInfoPacket.AgentDataBlock mPacket = ((RequestRegionInfoPacket)Pack).AgentData; 5678 RequestRegionInfoPacket.AgentDataBlock mPacket = ((RequestRegionInfoPacket)Pack).AgentData;
5651 5679
@@ -5982,6 +6010,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5982 pack.UUIDNameBlock = uidnameblock; 6010 pack.UUIDNameBlock = uidnameblock;
5983 OutPacket(pack, ThrottleOutPacketType.Task); 6011 OutPacket(pack, ThrottleOutPacketType.Task);
5984 } 6012 }
6013
6014 public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia)
6015 {
6016 LandStatReplyPacket lsrp = new LandStatReplyPacket();
6017 LandStatReplyPacket.RequestDataBlock lsreqdpb = new LandStatReplyPacket.RequestDataBlock();
6018 LandStatReplyPacket.ReportDataBlock[] lsrepdba = new LandStatReplyPacket.ReportDataBlock[lsrpia.Length];
6019 //LandStatReplyPacket.ReportDataBlock lsrepdb = new LandStatReplyPacket.ReportDataBlock();
6020 // lsrepdb.
6021 lsrp.RequestData.ReportType = reportType;
6022 lsrp.RequestData.RequestFlags = requestFlags;
6023 lsrp.RequestData.TotalObjectCount = resultCount;
6024 for (int i = 0; i < lsrpia.Length; i++)
6025 {
6026 LandStatReplyPacket.ReportDataBlock lsrepdb = new LandStatReplyPacket.ReportDataBlock();
6027 lsrepdb.LocationX = lsrpia[i].LocationX;
6028 lsrepdb.LocationY = lsrpia[i].LocationY;
6029 lsrepdb.LocationZ = lsrpia[i].LocationZ;
6030 lsrepdb.Score = lsrpia[i].Score;
6031 lsrepdb.TaskID = lsrpia[i].TaskID;
6032 lsrepdb.TaskLocalID = lsrpia[i].TaskLocalID;
6033 lsrepdb.TaskName = Helpers.StringToField(lsrpia[i].TaskName);
6034 lsrepdb.OwnerName = Helpers.StringToField(lsrpia[i].OwnerName);
6035 lsrepdba[i] = lsrepdb;
6036 }
6037 lsrp.ReportData = lsrepdba;
6038 OutPacket(lsrp, ThrottleOutPacketType.Task);
6039 }
6040
5985 public ClientInfo GetClientInfo() 6041 public ClientInfo GetClientInfo()
5986 { 6042 {
5987 //MainLog.Instance.Verbose("CLIENT", "GetClientInfo BGN"); 6043 //MainLog.Instance.Verbose("CLIENT", "GetClientInfo BGN");
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
311 { 311 {
312 remote_client.sendEstateCovenantInformation(); 312 remote_client.sendEstateCovenantInformation();
313 } 313 }
314 private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient)
315 {
316 Dictionary<uint, float> colliders = m_scene.PhysicsScene.GetTopColliders();
317
318 List<LandStatReportItem> collidera = new List<LandStatReportItem>();
319 lock (colliders)
320 {
321 foreach (uint obj in colliders.Keys)
322 {
323 SceneObjectPart prt = m_scene.GetSceneObjectPart(obj);
324 if (prt != null)
325 {
326 if (prt.ParentGroup != null)
327 {
328 SceneObjectGroup sog = prt.ParentGroup;
329 if (sog != null)
330 {
331 LandStatReportItem lsri = new LandStatReportItem();
332 lsri.LocationX = sog.AbsolutePosition.X;
333 lsri.LocationY = sog.AbsolutePosition.Y;
334 lsri.LocationZ = sog.AbsolutePosition.Z;
335 lsri.Score = colliders[obj];
336 lsri.TaskID = sog.UUID;
337 lsri.TaskLocalID = sog.LocalId;
338 lsri.TaskName = sog.GetPartName(obj);
339 lsri.OwnerName = m_scene.CommsManager.UUIDNameRequestString(sog.OwnerID);
340
341
342 collidera.Add(lsri);
343 }
344 }
345 }
346
347 }
348 }
349 remoteClient.SendLandStatReply(reportType, requestFlags, (uint)collidera.Count,collidera.ToArray());
350
351 }
314 352
315 #endregion 353 #endregion
316 354
@@ -435,6 +473,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
435 473
436 client.OnRegionInfoRequest += HandleRegionInfoRequest; 474 client.OnRegionInfoRequest += HandleRegionInfoRequest;
437 client.OnEstateCovenantRequest += HandleEstateCovenantRequest; 475 client.OnEstateCovenantRequest += HandleEstateCovenantRequest;
476 client.OnLandStatRequest += HandleLandStatRequest;
438 sendRegionHandshake(client); 477 sendRegionHandshake(client);
439 } 478 }
440 } 479 }
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
index cd5ca61..09069a9 100644
--- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
@@ -271,7 +271,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
271 public event AgentSit OnUndo; 271 public event AgentSit OnUndo;
272 272
273 public event ForceReleaseControls OnForceReleaseControls; 273 public event ForceReleaseControls OnForceReleaseControls;
274 274 public event GodLandStatRequest OnLandStatRequest;
275 public event RequestObjectPropertiesFamily OnObjectGroupRequest; 275 public event RequestObjectPropertiesFamily OnObjectGroupRequest;
276 276
277 public event DetailedEstateDataRequest OnDetailedEstateDataRequest; 277 public event DetailedEstateDataRequest OnDetailedEstateDataRequest;
@@ -764,6 +764,10 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
764 public void SendGroupNameReply(LLUUID groupLLUID, string GroupName) 764 public void SendGroupNameReply(LLUUID groupLLUID, string GroupName)
765 { 765 {
766 } 766 }
767
768 public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia)
769 {
770 }
767 #endregion 771 #endregion
768 } 772 }
769} 773}
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 032579e..0410e1c 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -175,6 +175,8 @@ namespace OpenSim.Region.Examples.SimpleModule
175 public event AgentSit OnUndo; 175 public event AgentSit OnUndo;
176 176
177 public event ForceReleaseControls OnForceReleaseControls; 177 public event ForceReleaseControls OnForceReleaseControls;
178
179 public event GodLandStatRequest OnLandStatRequest;
178 public event RequestObjectPropertiesFamily OnObjectGroupRequest; 180 public event RequestObjectPropertiesFamily OnObjectGroupRequest;
179 181
180 public event DetailedEstateDataRequest OnDetailedEstateDataRequest; 182 public event DetailedEstateDataRequest OnDetailedEstateDataRequest;
@@ -761,5 +763,10 @@ namespace OpenSim.Region.Examples.SimpleModule
761 public void SendGroupNameReply(LLUUID groupLLUID, string GroupName) 763 public void SendGroupNameReply(LLUUID groupLLUID, string GroupName)
762 { 764 {
763 } 765 }
766
767 public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia)
768 {
769
770 }
764 } 771 }
765} 772}
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
index d7c4013..ee30e54 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
@@ -198,6 +198,11 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
198 public override void DeleteTerrain() 198 public override void DeleteTerrain()
199 { 199 {
200 } 200 }
201 public override Dictionary<uint, float> GetTopColliders()
202 {
203 Dictionary<uint, float> returncolliders = new Dictionary<uint, float>();
204 return returncolliders;
205 }
201 } 206 }
202 207
203 public class BasicActor : PhysicsActor 208 public class BasicActor : PhysicsActor
@@ -348,6 +353,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
348 public override float CollisionScore 353 public override float CollisionScore
349 { 354 {
350 get { return 0f; } 355 get { return 0f; }
356 set { }
351 } 357 }
352 358
353 public override Quaternion Orientation 359 public override Quaternion Orientation
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
index fcff04e..1fa759c 100644
--- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
+++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
@@ -549,6 +549,12 @@ namespace OpenSim.Region.Physics.BulletXPlugin
549 549
550 } 550 }
551 551
552 public override Dictionary<uint, float> GetTopColliders()
553 {
554 Dictionary<uint, float> returncolliders = new Dictionary<uint, float>();
555 return returncolliders;
556 }
557
552 public override void SetWaterLevel(float baseheight) 558 public override void SetWaterLevel(float baseheight)
553 { 559 {
554 560
@@ -917,6 +923,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
917 public override float CollisionScore 923 public override float CollisionScore
918 { 924 {
919 get { return 0f; } 925 get { return 0f; }
926 set { }
920 } 927 }
921 public override PhysicsVector Size 928 public override PhysicsVector Size
922 { 929 {
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
index 3cf2646..c87e748 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
@@ -176,7 +176,7 @@ namespace OpenSim.Region.Physics.Manager
176 public abstract PhysicsVector GeometricCenter { get; } 176 public abstract PhysicsVector GeometricCenter { get; }
177 public abstract PhysicsVector CenterOfMass { get; } 177 public abstract PhysicsVector CenterOfMass { get; }
178 public abstract PhysicsVector Velocity { get; set; } 178 public abstract PhysicsVector Velocity { get; set; }
179 public abstract float CollisionScore { get;} 179 public abstract float CollisionScore { get; set;}
180 public abstract PhysicsVector Acceleration { get; } 180 public abstract PhysicsVector Acceleration { get; }
181 public abstract Quaternion Orientation { get; set; } 181 public abstract Quaternion Orientation { get; set; }
182 public abstract int PhysicsActorType { get; set; } 182 public abstract int PhysicsActorType { get; set; }
@@ -208,8 +208,10 @@ namespace OpenSim.Region.Physics.Manager
208 public override bool Stopped 208 public override bool Stopped
209 { 209 {
210 get{ return false; } 210 get{ return false; }
211
211 } 212 }
212 213
214
213 public override PhysicsVector Position 215 public override PhysicsVector Position
214 { 216 {
215 get { return PhysicsVector.Zero; } 217 get { return PhysicsVector.Zero; }
@@ -300,6 +302,7 @@ namespace OpenSim.Region.Physics.Manager
300 public override float CollisionScore 302 public override float CollisionScore
301 { 303 {
302 get { return 0f; } 304 get { return 0f; }
305 set { }
303 } 306 }
304 307
305 public override void CrossingFailure() 308 public override void CrossingFailure()
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
index de93f22..f9d990b 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
@@ -25,6 +25,7 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System.Collections.Generic;
28using System.Reflection; 29using System.Reflection;
29using Axiom.Math; 30using Axiom.Math;
30using log4net; 31using log4net;
@@ -86,6 +87,8 @@ namespace OpenSim.Region.Physics.Manager
86 87
87 public abstract void Dispose(); 88 public abstract void Dispose();
88 89
90 public abstract Dictionary<uint, float> GetTopColliders();
91
89 public abstract bool IsThreaded { get; } 92 public abstract bool IsThreaded { get; }
90 93
91 private class NullPhysicsScene : PhysicsScene 94 private class NullPhysicsScene : PhysicsScene
@@ -170,6 +173,12 @@ namespace OpenSim.Region.Physics.Manager
170 public override void Dispose() 173 public override void Dispose()
171 { 174 {
172 } 175 }
176
177 public override Dictionary<uint,float> GetTopColliders()
178 {
179 Dictionary<uint, float> returncolliders = new Dictionary<uint, float>();
180 return returncolliders;
181 }
173 } 182 }
174 } 183 }
175} 184}
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 5024b5d..89162a0 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -570,6 +570,7 @@ namespace OpenSim.Region.Physics.OdePlugin
570 public override float CollisionScore 570 public override float CollisionScore
571 { 571 {
572 get { return 0f; } 572 get { return 0f; }
573 set { }
573 } 574 }
574 575
575 public override bool Kinematic 576 public override bool Kinematic
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 4c8eb20..6ade638 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -124,7 +124,7 @@ namespace OpenSim.Region.Physics.OdePlugin
124 private bool m_throttleUpdates = false; 124 private bool m_throttleUpdates = false;
125 private int throttleCounter = 0; 125 private int throttleCounter = 0;
126 public int m_interpenetrationcount = 0; 126 public int m_interpenetrationcount = 0;
127 public int m_collisionscore = 0; 127 public float m_collisionscore = 0;
128 public int m_roundsUnderMotionThreshold = 0; 128 public int m_roundsUnderMotionThreshold = 0;
129 private int m_crossingfailures = 0; 129 private int m_crossingfailures = 0;
130 130
@@ -243,7 +243,7 @@ namespace OpenSim.Region.Physics.OdePlugin
243 // is physical or the object is modified somehow *IN THE FUTURE* 243 // is physical or the object is modified somehow *IN THE FUTURE*
244 // without this, if an avatar selects prim, they can walk right 244 // without this, if an avatar selects prim, they can walk right
245 // through it while it's selected 245 // through it while it's selected
246 246 m_collisionscore = 0;
247 if ((m_isphysical && !_zeroFlag) || !value) 247 if ((m_isphysical && !_zeroFlag) || !value)
248 { 248 {
249 m_taintselected = value; 249 m_taintselected = value;
@@ -1783,6 +1783,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1783 public override float CollisionScore 1783 public override float CollisionScore
1784 { 1784 {
1785 get { return m_collisionscore; } 1785 get { return m_collisionscore; }
1786 set { m_collisionscore = value; }
1786 } 1787 }
1787 1788
1788 public override bool Kinematic 1789 public override bool Kinematic
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index fef0c4e..e43a1ac 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -555,6 +555,13 @@ namespace OpenSim.Region.Physics.OdePlugin
555 } 555 }
556 556
557 float max_collision_depth = 0f; 557 float max_collision_depth = 0f;
558 if (p1.CollisionScore + count >= float.MaxValue)
559 p1.CollisionScore = 0;
560 p1.CollisionScore += count;
561
562 if (p2.CollisionScore + count >= float.MaxValue)
563 p2.CollisionScore = 0;
564 p2.CollisionScore += count;
558 565
559 for (int i = 0; i < count; i++) 566 for (int i = 0; i < count; i++)
560 { 567 {
@@ -585,6 +592,7 @@ namespace OpenSim.Region.Physics.OdePlugin
585 p2.CollidingGround = true; 592 p2.CollidingGround = true;
586 break; 593 break;
587 } 594 }
595
588 596
589 // we don't want prim or avatar to explode 597 // we don't want prim or avatar to explode
590 598
@@ -2162,5 +2170,27 @@ namespace OpenSim.Region.Physics.OdePlugin
2162 //d.CloseODE(); 2170 //d.CloseODE();
2163 } 2171 }
2164 } 2172 }
2173 public override Dictionary<uint, float> GetTopColliders()
2174 {
2175 Dictionary<uint, float> returncolliders = new Dictionary<uint, float>();
2176 int cnt = 0;
2177 lock (_prims)
2178 {
2179 foreach (OdePrim prm in _prims)
2180 {
2181 if (prm.CollisionScore > 0)
2182 {
2183 returncolliders.Add(prm.m_localID, prm.CollisionScore);
2184 cnt++;
2185 prm.CollisionScore = 0f;
2186 if (cnt > 25)
2187 {
2188 break;
2189 }
2190 }
2191 }
2192 }
2193 return returncolliders;
2194 }
2165 } 2195 }
2166} 2196}
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
index 82ce144..c14a80a 100644
--- a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
+++ b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
@@ -326,6 +326,12 @@ namespace OpenSim.Region.Physics.POSPlugin
326 public override void DeleteTerrain() 326 public override void DeleteTerrain()
327 { 327 {
328 } 328 }
329
330 public override Dictionary<uint, float> GetTopColliders()
331 {
332 Dictionary<uint, float> returncolliders = new Dictionary<uint, float>();
333 return returncolliders;
334 }
329 } 335 }
330 336
331 public class POSCharacter : PhysicsActor 337 public class POSCharacter : PhysicsActor
@@ -476,6 +482,7 @@ namespace OpenSim.Region.Physics.POSPlugin
476 public override float CollisionScore 482 public override float CollisionScore
477 { 483 {
478 get { return 0f; } 484 get { return 0f; }
485 set { }
479 } 486 }
480 487
481 public override Quaternion Orientation 488 public override Quaternion Orientation
@@ -663,6 +670,7 @@ namespace OpenSim.Region.Physics.POSPlugin
663 public override float CollisionScore 670 public override float CollisionScore
664 { 671 {
665 get { return 0f; } 672 get { return 0f; }
673 set { }
666 } 674 }
667 675
668 public override Quaternion Orientation 676 public override Quaternion Orientation
diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
index 175d749..c9e1e30 100644
--- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
+++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
@@ -200,6 +200,12 @@ namespace OpenSim.Region.Physics.PhysXPlugin
200 { 200 {
201 scene.DeleteTerrain(); 201 scene.DeleteTerrain();
202 } 202 }
203
204 public override Dictionary<uint, float> GetTopColliders()
205 {
206 Dictionary<uint, float> returncolliders = new Dictionary<uint, float>();
207 return returncolliders;
208 }
203 } 209 }
204 210
205 public class PhysXCharacter : PhysicsActor 211 public class PhysXCharacter : PhysicsActor
@@ -355,6 +361,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin
355 public override float CollisionScore 361 public override float CollisionScore
356 { 362 {
357 get { return 0f; } 363 get { return 0f; }
364 set { }
358 } 365 }
359 366
360 public override bool Kinematic 367 public override bool Kinematic
@@ -593,6 +600,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin
593 public override float CollisionScore 600 public override float CollisionScore
594 { 601 {
595 get { return 0f; } 602 get { return 0f; }
603 set { }
596 } 604 }
597 605
598 public override bool Kinematic 606 public override bool Kinematic