aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTeravus Ovares2009-04-14 01:57:35 +0000
committerTeravus Ovares2009-04-14 01:57:35 +0000
commitc2e75aecd1eba90d3a376896f1a798a4c9c58e6d (patch)
tree277760c63ec2af87374d62e2c3fd78a081e4be7a
parent* Set eol-style: native on J2KImage.cs (diff)
downloadopensim-SC_OLD-c2e75aecd1eba90d3a376896f1a798a4c9c58e6d.zip
opensim-SC_OLD-c2e75aecd1eba90d3a376896f1a798a4c9c58e6d.tar.gz
opensim-SC_OLD-c2e75aecd1eba90d3a376896f1a798a4c9c58e6d.tar.bz2
opensim-SC_OLD-c2e75aecd1eba90d3a376896f1a798a4c9c58e6d.tar.xz
* Commit a variety of fixes to bugs discovered while trying to fix the NaN singularity.
* WebStatsModule doesn't crash on restart. GodsModule doesn't crash when there is no Dialog Module. LLUDPServer doesn't crash when the Operation was Aborted. * ODEPlugin does 'Almost NaN' sanity checks. * ODEPlugin sacrifices NaN avatars to the NaN black hole to appease it and keep it from sucking the rest of the world in.
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs10
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs1
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs52
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs111
-rw-r--r--OpenSim/Region/UserStatistics/WebStatsModule.cs7
6 files changed, 150 insertions, 34 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
index aa2423f..f0fd74b 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
@@ -199,6 +199,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
199 199
200 int numCollected = 0; 200 int numCollected = 0;
201 //First of all make sure our packet queue isn't above our threshold 201 //First of all make sure our packet queue isn't above our threshold
202 if (m_client == null)
203 return;
204
205 if (m_client.PacketHandler == null)
206 return;
207
208 if (m_client.PacketHandler.PacketQueue == null)
209 return;
210
211
202 if (m_client.PacketHandler.PacketQueue.TextureOutgoingPacketQueueCount < 200) 212 if (m_client.PacketHandler.PacketQueue.TextureOutgoingPacketQueueCount < 200)
203 { 213 {
204 214
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index 3b9d293..26a8959 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -378,6 +378,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
378 378
379 case SocketError.NetworkReset: 379 case SocketError.NetworkReset:
380 case SocketError.ConnectionReset: 380 case SocketError.ConnectionReset:
381 case SocketError.OperationAborted:
381 break; 382 break;
382 383
383 default: 384 default:
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
index 9601ffc..335bc19 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
@@ -80,7 +80,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
80 } 80 }
81 else 81 else
82 { 82 {
83 m_dialogModule.SendAlertToUser(agentID, "Request for god powers denied"); 83 if (m_dialogModule != null)
84 m_dialogModule.SendAlertToUser(agentID, "Request for god powers denied");
84 } 85 }
85 } 86 }
86 } 87 }
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index e5ddeb5..cda90d6 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -939,11 +939,14 @@ namespace OpenSim.Region.Framework.Scenes
939 { 939 {
940 if (PhysicsActor != null) 940 if (PhysicsActor != null)
941 { 941 {
942 m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); 942 lock (m_scene.SyncRoot)
943 m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; 943 {
944 m_physicsActor.UnSubscribeEvents(); 944 m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients;
945 m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; 945 m_scene.PhysicsScene.RemoveAvatar(PhysicsActor);
946 PhysicsActor = null; 946 m_physicsActor.UnSubscribeEvents();
947 m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate;
948 PhysicsActor = null;
949 }
947 } 950 }
948 } 951 }
949 952
@@ -3192,25 +3195,30 @@ namespace OpenSim.Region.Framework.Scenes
3192 /// </summary> 3195 /// </summary>
3193 public void AddToPhysicalScene(bool isFlying) 3196 public void AddToPhysicalScene(bool isFlying)
3194 { 3197 {
3195 PhysicsScene scene = m_scene.PhysicsScene; 3198 lock (m_scene.SyncRoot)
3196
3197 PhysicsVector pVec =
3198 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y,
3199 AbsolutePosition.Z);
3200
3201 if (m_avHeight == 127.0f)
3202 {
3203 m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec, new PhysicsVector(0, 0, 1.56f), isFlying);
3204 }
3205 else
3206 { 3199 {
3207 m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec, new PhysicsVector(0, 0, m_avHeight), isFlying); 3200 PhysicsScene scene = m_scene.PhysicsScene;
3201
3202 PhysicsVector pVec =
3203 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y,
3204 AbsolutePosition.Z);
3205
3206 if (m_avHeight == 127.0f)
3207 {
3208 m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec, new PhysicsVector(0, 0, 1.56f),
3209 isFlying);
3210 }
3211 else
3212 {
3213 m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec,
3214 new PhysicsVector(0, 0, m_avHeight), isFlying);
3215 }
3216 scene.AddPhysicsActorTaint(m_physicsActor);
3217 //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients;
3218 m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate;
3219 m_physicsActor.SubscribeEvents(1000);
3220 m_physicsActor.LocalID = LocalId;
3208 } 3221 }
3209 scene.AddPhysicsActorTaint(m_physicsActor);
3210 //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients;
3211 m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate;
3212 m_physicsActor.SubscribeEvents(1000);
3213 m_physicsActor.LocalID = LocalId;
3214 } 3222 }
3215 3223
3216 // Event called by the physics plugin to tell the avatar about a collision. 3224 // Event called by the physics plugin to tell the avatar about a collision.
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index c160cda..dae19c3 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -137,6 +137,14 @@ namespace OpenSim.Region.Physics.OdePlugin
137 137
138 if (PhysicsVector.isFinite(pos)) 138 if (PhysicsVector.isFinite(pos))
139 { 139 {
140 if (pos.Z > 9999999)
141 {
142 pos.Z = parent_scene.GetTerrainHeightAtXY(127, 127) + 5;
143 }
144 if (pos.Z < -90000)
145 {
146 pos.Z = parent_scene.GetTerrainHeightAtXY(127, 127) + 5;
147 }
140 _position = pos; 148 _position = pos;
141 m_taintPosition.X = pos.X; 149 m_taintPosition.X = pos.X;
142 m_taintPosition.Y = pos.Y; 150 m_taintPosition.Y = pos.Y;
@@ -396,6 +404,15 @@ namespace OpenSim.Region.Physics.OdePlugin
396 { 404 {
397 if (PhysicsVector.isFinite(value)) 405 if (PhysicsVector.isFinite(value))
398 { 406 {
407 if (value.Z > 9999999)
408 {
409 value.Z = _parent_scene.GetTerrainHeightAtXY(127, 127) + 5;
410 }
411 if (value.Z < -90000)
412 {
413 value.Z = _parent_scene.GetTerrainHeightAtXY(127, 127) + 5;
414 }
415
399 _position.X = value.X; 416 _position.X = value.X;
400 _position.Y = value.Y; 417 _position.Y = value.Y;
401 _position.Z = value.Z; 418 _position.Z = value.Z;
@@ -780,6 +797,41 @@ namespace OpenSim.Region.Physics.OdePlugin
780 } 797 }
781 //PidStatus = true; 798 //PidStatus = true;
782 799
800 d.Vector3 localpos = d.BodyGetPosition(Body);
801 PhysicsVector localPos = new PhysicsVector(localpos.X, localpos.Y, localpos.Z);
802 if (!PhysicsVector.isFinite(localPos))
803 {
804
805 m_log.Warn("[PHYSICS]: Avatar Position is non-finite!");
806 _parent_scene.RemoveCharacter(this);
807 // destroy avatar capsule and related ODE data
808 if (Amotor != IntPtr.Zero)
809 {
810 // Kill the Amotor
811 d.JointDestroy(Amotor);
812 Amotor = IntPtr.Zero;
813 }
814 //kill the Geometry
815 _parent_scene.waitForSpaceUnlock(_parent_scene.space);
816
817 if (Body != IntPtr.Zero)
818 {
819 //kill the body
820 d.BodyDestroy(Body);
821
822 Body = IntPtr.Zero;
823 }
824
825 if (Shell != IntPtr.Zero)
826 {
827 d.GeomDestroy(Shell);
828 _parent_scene.geom_name_map.Remove(Shell);
829 Shell = IntPtr.Zero;
830 }
831
832 return;
833 }
834
783 PhysicsVector vec = new PhysicsVector(); 835 PhysicsVector vec = new PhysicsVector();
784 d.Vector3 vel = d.BodyGetLinearVel(Body); 836 d.Vector3 vel = d.BodyGetLinearVel(Body);
785 float movementdivisor = 1f; 837 float movementdivisor = 1f;
@@ -901,6 +953,34 @@ namespace OpenSim.Region.Physics.OdePlugin
901 else 953 else
902 { 954 {
903 m_log.Warn("[PHYSICS]: Got a NaN force vector in Move()"); 955 m_log.Warn("[PHYSICS]: Got a NaN force vector in Move()");
956 m_log.Warn("[PHYSICS]: Avatar Position is non-finite!");
957 _parent_scene.RemoveCharacter(this);
958 // destroy avatar capsule and related ODE data
959 if (Amotor != IntPtr.Zero)
960 {
961 // Kill the Amotor
962 d.JointDestroy(Amotor);
963 Amotor = IntPtr.Zero;
964 }
965 //kill the Geometry
966 _parent_scene.waitForSpaceUnlock(_parent_scene.space);
967
968 if (Body != IntPtr.Zero)
969 {
970 //kill the body
971 d.BodyDestroy(Body);
972
973 Body = IntPtr.Zero;
974 }
975
976 if (Shell != IntPtr.Zero)
977 {
978 d.GeomDestroy(Shell);
979 _parent_scene.geom_name_map.Remove(Shell);
980 Shell = IntPtr.Zero;
981 }
982
983 return;
904 } 984 }
905 } 985 }
906 986
@@ -1044,21 +1124,30 @@ namespace OpenSim.Region.Physics.OdePlugin
1044 { 1124 {
1045 _parent_scene.RemoveCharacter(this); 1125 _parent_scene.RemoveCharacter(this);
1046 // destroy avatar capsule and related ODE data 1126 // destroy avatar capsule and related ODE data
1047 1127 if (Amotor != IntPtr.Zero)
1048 // Kill the Amotor 1128 {
1049 d.JointDestroy(Amotor); 1129 // Kill the Amotor
1050 Amotor = IntPtr.Zero; 1130 d.JointDestroy(Amotor);
1051 1131 Amotor = IntPtr.Zero;
1132 }
1052 //kill the Geometry 1133 //kill the Geometry
1053 _parent_scene.waitForSpaceUnlock(_parent_scene.space); 1134 _parent_scene.waitForSpaceUnlock(_parent_scene.space);
1054 1135
1055 d.GeomDestroy(Shell); 1136 if (Body != IntPtr.Zero)
1056 _parent_scene.geom_name_map.Remove(Shell); 1137 {
1057 Shell = IntPtr.Zero; 1138 //kill the body
1139 d.BodyDestroy(Body);
1140
1141 Body = IntPtr.Zero;
1142 }
1143
1144 if (Shell != IntPtr.Zero)
1145 {
1146 d.GeomDestroy(Shell);
1147 _parent_scene.geom_name_map.Remove(Shell);
1148 Shell = IntPtr.Zero;
1149 }
1058 1150
1059 //kill the body
1060 d.BodyDestroy(Body);
1061 Body=IntPtr.Zero;
1062 } 1151 }
1063 1152
1064 m_isPhysical = m_tainted_isPhysical; 1153 m_isPhysical = m_tainted_isPhysical;
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index cdbf1db..d427401 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -131,6 +131,9 @@ namespace OpenSim.Region.UserStatistics
131 } 131 }
132 132
133 m_scene.Add(scene); 133 m_scene.Add(scene);
134 if (m_simstatsCounters.ContainsKey(scene.RegionInfo.RegionID))
135 m_simstatsCounters.Remove(scene.RegionInfo.RegionID);
136
134 m_simstatsCounters.Add(scene.RegionInfo.RegionID, new USimStatsData(scene.RegionInfo.RegionID)); 137 m_simstatsCounters.Add(scene.RegionInfo.RegionID, new USimStatsData(scene.RegionInfo.RegionID));
135 scene.StatsReporter.OnSendStatsResult += ReceiveClassicSimStatsPacket; 138 scene.StatsReporter.OnSendStatsResult += ReceiveClassicSimStatsPacket;
136 } 139 }
@@ -293,6 +296,10 @@ namespace OpenSim.Region.UserStatistics
293 } 296 }
294 dbConn.Close(); 297 dbConn.Close();
295 dbConn.Dispose(); 298 dbConn.Dispose();
299 m_sessions.Clear();
300 m_scene.Clear();
301 reports.Clear();
302 m_simstatsCounters.Clear();
296 } 303 }
297 304
298 public virtual string Name 305 public virtual string Name