aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs4
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs34
-rw-r--r--OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs7
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs70
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs24
7 files changed, 67 insertions, 89 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
index a1bc27b..7c7d08d 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Framework.Servers.HttpServer
52 52
53 public enum EventType : int 53 public enum EventType : int
54 { 54 {
55 LongPoll = 0, 55 Poll = 0,
56 LslHttp = 1, 56 LslHttp = 1,
57 Inventory = 2, 57 Inventory = 2,
58 Texture = 3, 58 Texture = 3,
@@ -85,7 +85,7 @@ namespace OpenSim.Framework.Servers.HttpServer
85 Drop = pDrop; 85 Drop = pDrop;
86 Id = pId; 86 Id = pId;
87 TimeOutms = pTimeOutms; 87 TimeOutms = pTimeOutms;
88 Type = EventType.LongPoll; 88 Type = EventType.Poll;
89 } 89 }
90 } 90 }
91} 91}
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
index 82c7727..4dad44a 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
@@ -48,7 +48,6 @@ namespace OpenSim.Framework.Servers.HttpServer
48 48
49 private Dictionary<PollServiceHttpRequest, Queue<PollServiceHttpRequest>> m_bycontext; 49 private Dictionary<PollServiceHttpRequest, Queue<PollServiceHttpRequest>> m_bycontext;
50 private BlockingQueue<PollServiceHttpRequest> m_requests = new BlockingQueue<PollServiceHttpRequest>(); 50 private BlockingQueue<PollServiceHttpRequest> m_requests = new BlockingQueue<PollServiceHttpRequest>();
51 private static Queue<PollServiceHttpRequest> m_slowRequests = new Queue<PollServiceHttpRequest>();
52 private static Queue<PollServiceHttpRequest> m_retryRequests = new Queue<PollServiceHttpRequest>(); 51 private static Queue<PollServiceHttpRequest> m_retryRequests = new Queue<PollServiceHttpRequest>();
53 52
54 private uint m_WorkerThreadCount = 0; 53 private uint m_WorkerThreadCount = 0;
@@ -56,11 +55,9 @@ namespace OpenSim.Framework.Servers.HttpServer
56 private Thread m_retrysThread; 55 private Thread m_retrysThread;
57 56
58 private bool m_running = false; 57 private bool m_running = false;
59 private int slowCount = 0;
60 58
61 private SmartThreadPool m_threadPool; 59 private SmartThreadPool m_threadPool;
62 60
63
64 public PollServiceRequestManager( 61 public PollServiceRequestManager(
65 BaseHttpServer pSrv, bool performResponsesAsync, uint pWorkerThreadCount, int pTimeout) 62 BaseHttpServer pSrv, bool performResponsesAsync, uint pWorkerThreadCount, int pTimeout)
66 { 63 {
@@ -80,7 +77,6 @@ namespace OpenSim.Framework.Servers.HttpServer
80 startInfo.ThreadPoolName = "PoolService"; 77 startInfo.ThreadPoolName = "PoolService";
81 78
82 m_threadPool = new SmartThreadPool(startInfo); 79 m_threadPool = new SmartThreadPool(startInfo);
83
84 } 80 }
85 81
86 public void Start() 82 public void Start()
@@ -176,17 +172,7 @@ namespace OpenSim.Framework.Servers.HttpServer
176 public void EnqueueInt(PollServiceHttpRequest req) 172 public void EnqueueInt(PollServiceHttpRequest req)
177 { 173 {
178 if (m_running) 174 if (m_running)
179 { 175 m_requests.Enqueue(req);
180 if (req.PollServiceArgs.Type != PollServiceEventArgs.EventType.LongPoll)
181 {
182 m_requests.Enqueue(req);
183 }
184 else
185 {
186 lock (m_slowRequests)
187 m_slowRequests.Enqueue(req);
188 }
189 }
190 } 176 }
191 177
192 private void CheckRetries() 178 private void CheckRetries()
@@ -201,17 +187,6 @@ namespace OpenSim.Framework.Servers.HttpServer
201 while (m_retryRequests.Count > 0 && m_running) 187 while (m_retryRequests.Count > 0 && m_running)
202 m_requests.Enqueue(m_retryRequests.Dequeue()); 188 m_requests.Enqueue(m_retryRequests.Dequeue());
203 } 189 }
204 slowCount++;
205 if (slowCount >= 10)
206 {
207 slowCount = 0;
208
209 lock (m_slowRequests)
210 {
211 while (m_slowRequests.Count > 0 && m_running)
212 m_requests.Enqueue(m_slowRequests.Dequeue());
213 }
214 }
215 } 190 }
216 } 191 }
217 192
@@ -244,13 +219,6 @@ namespace OpenSim.Framework.Servers.HttpServer
244 PollServiceHttpRequest wreq; 219 PollServiceHttpRequest wreq;
245 m_retryRequests.Clear(); 220 m_retryRequests.Clear();
246 221
247 lock (m_slowRequests)
248 {
249 while (m_slowRequests.Count > 0)
250 m_requests.Enqueue(m_slowRequests.Dequeue());
251
252 }
253
254 while (m_requests.Count() > 0) 222 while (m_requests.Count() > 0)
255 { 223 {
256 try 224 try
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
index 035097f..ae5e175 100644
--- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -663,12 +663,6 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
663 Status = (int)OSHttpStatusCode.ClientErrorJoker; 663 Status = (int)OSHttpStatusCode.ClientErrorJoker;
664 ResponseBody = e.Message; 664 ResponseBody = e.Message;
665 } 665 }
666
667 if (ResponseBody == null)
668 ResponseBody = String.Empty;
669
670 _finished = true;
671 return;
672 } 666 }
673 catch (Exception e) 667 catch (Exception e)
674 { 668 {
@@ -727,13 +721,10 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
727 else 721 else
728 { 722 {
729 _finished = true; 723 _finished = true;
724 if (ResponseBody == null)
725 ResponseBody = String.Empty;
730 } 726 }
731 } 727 }
732
733 if (ResponseBody == null)
734 ResponseBody = String.Empty;
735
736 _finished = true;
737 } 728 }
738 729
739 public void Stop() 730 public void Stop()
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 2731274..474378d 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2456,7 +2456,9 @@ namespace OpenSim.Region.Framework.Scenes
2456 // This is irritating. Really. 2456 // This is irritating. Really.
2457 if (!AbsolutePosition.IsFinite()) 2457 if (!AbsolutePosition.IsFinite())
2458 { 2458 {
2459 RemoveFromPhysicalScene(); 2459 bool isphysical = PhysicsActor != null;
2460 if(isphysical)
2461 RemoveFromPhysicalScene();
2460 m_log.Error("[AVATAR]: NonFinite Avatar position detected... Reset Position. Mantis this please. Error #9999902"); 2462 m_log.Error("[AVATAR]: NonFinite Avatar position detected... Reset Position. Mantis this please. Error #9999902");
2461 2463
2462 m_pos = m_LastFinitePos; 2464 m_pos = m_LastFinitePos;
@@ -2468,7 +2470,8 @@ namespace OpenSim.Region.Framework.Scenes
2468 m_log.Error("[AVATAR]: NonFinite Avatar position detected... Reset Position. Mantis this please. Error #9999903"); 2470 m_log.Error("[AVATAR]: NonFinite Avatar position detected... Reset Position. Mantis this please. Error #9999903");
2469 } 2471 }
2470 2472
2471 AddToPhysicalScene(false); 2473 if(isphysical)
2474 AddToPhysicalScene(false);
2472 } 2475 }
2473 else 2476 else
2474 { 2477 {
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs
index 9cef3d5..de7e879 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs
@@ -138,7 +138,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
138 ); 138 );
139 // we do land collisions not ode | CollisionCategories.Land); 139 // we do land collisions not ode | CollisionCategories.Land);
140 public IntPtr Body = IntPtr.Zero; 140 public IntPtr Body = IntPtr.Zero;
141 private ODEScene _parent_scene; 141 private ODEScene m_parent_scene;
142 private IntPtr capsule = IntPtr.Zero; 142 private IntPtr capsule = IntPtr.Zero;
143 public IntPtr collider = IntPtr.Zero; 143 public IntPtr collider = IntPtr.Zero;
144 144
@@ -169,6 +169,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
169 { 169 {
170 m_uuid = UUID.Random(); 170 m_uuid = UUID.Random();
171 m_localID = localID; 171 m_localID = localID;
172 m_parent_scene = parent_scene;
172 173
173 timeStep = parent_scene.ODE_STEPSIZE; 174 timeStep = parent_scene.ODE_STEPSIZE;
174 invtimeStep = 1 / timeStep; 175 invtimeStep = 1 / timeStep;
@@ -187,13 +188,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
187 } 188 }
188 else 189 else
189 { 190 {
190 _position = new Vector3(((float)_parent_scene.WorldExtents.X * 0.5f), ((float)_parent_scene.WorldExtents.Y * 0.5f), parent_scene.GetTerrainHeightAtXY(128f, 128f) + 10f); 191 _position = new Vector3(((float)m_parent_scene.WorldExtents.X * 0.5f), ((float)m_parent_scene.WorldExtents.Y * 0.5f), parent_scene.GetTerrainHeightAtXY(128f, 128f) + 10f);
191 m_log.Warn("[PHYSICS]: Got NaN Position on Character Create"); 192 m_log.Warn("[PHYSICS]: Got NaN Position on Character Create");
192 } 193 }
193 194
194 _parent_scene = parent_scene;
195
196
197 m_size.X = pSize.X; 195 m_size.X = pSize.X;
198 m_size.Y = pSize.Y; 196 m_size.Y = pSize.Y;
199 m_size.Z = pSize.Z; 197 m_size.Z = pSize.Z;
@@ -213,7 +211,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
213 // force lower density for testing 211 // force lower density for testing
214 m_density = 3.0f; 212 m_density = 3.0f;
215 213
216 mu = parent_scene.AvatarFriction; 214 mu = m_parent_scene.AvatarFriction;
217 215
218 walkDivisor = walk_divisor; 216 walkDivisor = walk_divisor;
219 runDivisor = rundivisor; 217 runDivisor = rundivisor;
@@ -437,11 +435,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde
437 { 435 {
438 if (value.Z > 9999999f) 436 if (value.Z > 9999999f)
439 { 437 {
440 value.Z = _parent_scene.GetTerrainHeightAtXY(127, 127) + 5; 438 value.Z = m_parent_scene.GetTerrainHeightAtXY(127, 127) + 5;
441 } 439 }
442 if (value.Z < -100f) 440 if (value.Z < -100f)
443 { 441 {
444 value.Z = _parent_scene.GetTerrainHeightAtXY(127, 127) + 5; 442 value.Z = m_parent_scene.GetTerrainHeightAtXY(127, 127) + 5;
445 } 443 }
446 AddChange(changes.Position, value); 444 AddChange(changes.Position, value);
447 } 445 }
@@ -704,7 +702,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
704 { 702 {
705 if (pushforce) 703 if (pushforce)
706 { 704 {
707 AddChange(changes.Force, force * m_density / (_parent_scene.ODE_STEPSIZE * 28f)); 705 AddChange(changes.Force, force * m_density / (m_parent_scene.ODE_STEPSIZE * 28f));
708 } 706 }
709 else 707 else
710 { 708 {
@@ -751,9 +749,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde
751 AvaAvaSizeYsq = 0.5f * sy; 749 AvaAvaSizeYsq = 0.5f * sy;
752 AvaAvaSizeYsq *= AvaAvaSizeYsq; 750 AvaAvaSizeYsq *= AvaAvaSizeYsq;
753 751
754 _parent_scene.waitForSpaceUnlock(_parent_scene.CharsSpace); 752 m_parent_scene.waitForSpaceUnlock(m_parent_scene.CharsSpace);
755 753
756 collider = d.HashSpaceCreate(_parent_scene.CharsSpace); 754 collider = d.HashSpaceCreate(m_parent_scene.CharsSpace);
757 d.HashSpaceSetLevels(collider, -4, 3); 755 d.HashSpaceSetLevels(collider, -4, 3);
758 d.SpaceSetSublevel(collider, 3); 756 d.SpaceSetSublevel(collider, 3);
759 d.SpaceSetCleanup(collider, false); 757 d.SpaceSetCleanup(collider, false);
@@ -772,10 +770,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
772 770
773 d.MassSetBoxTotal(out ShellMass, m_mass, m_size.X, m_size.Y, m_size.Z); 771 d.MassSetBoxTotal(out ShellMass, m_mass, m_size.X, m_size.Y, m_size.Z);
774 772
775 PID_D = basePID_D * m_mass / _parent_scene.ODE_STEPSIZE; 773 PID_D = basePID_D * m_mass / m_parent_scene.ODE_STEPSIZE;
776 PID_P = basePID_P * m_mass / _parent_scene.ODE_STEPSIZE; 774 PID_P = basePID_P * m_mass / m_parent_scene.ODE_STEPSIZE;
777 775
778 Body = d.BodyCreate(_parent_scene.world); 776 Body = d.BodyCreate(m_parent_scene.world);
779 777
780 _zeroFlag = false; 778 _zeroFlag = false;
781 m_pidControllerActive = true; 779 m_pidControllerActive = true;
@@ -795,7 +793,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
795 793
796 // The purpose of the AMotor here is to keep the avatar's physical 794 // The purpose of the AMotor here is to keep the avatar's physical
797 // surrogate from rotating while moving 795 // surrogate from rotating while moving
798 Amotor = d.JointCreateAMotor(_parent_scene.world, IntPtr.Zero); 796 Amotor = d.JointCreateAMotor(m_parent_scene.world, IntPtr.Zero);
799 d.JointAttach(Amotor, Body, IntPtr.Zero); 797 d.JointAttach(Amotor, Body, IntPtr.Zero);
800 798
801 d.JointSetAMotorMode(Amotor, 0); 799 d.JointSetAMotorMode(Amotor, 0);
@@ -854,8 +852,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
854 //kill the Geoms 852 //kill the Geoms
855 if (capsule != IntPtr.Zero) 853 if (capsule != IntPtr.Zero)
856 { 854 {
857 _parent_scene.actor_name_map.Remove(capsule); 855 m_parent_scene.actor_name_map.Remove(capsule);
858 _parent_scene.waitForSpaceUnlock(collider); 856 m_parent_scene.waitForSpaceUnlock(collider);
859 d.GeomDestroy(capsule); 857 d.GeomDestroy(capsule);
860 capsule = IntPtr.Zero; 858 capsule = IntPtr.Zero;
861 } 859 }
@@ -1049,20 +1047,20 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1049 fixbody = true; 1047 fixbody = true;
1050 localpos.X = 0.1f; 1048 localpos.X = 0.1f;
1051 } 1049 }
1052 else if (localpos.X > _parent_scene.WorldExtents.X - 0.1f) 1050 else if (localpos.X > m_parent_scene.WorldExtents.X - 0.1f)
1053 { 1051 {
1054 fixbody = true; 1052 fixbody = true;
1055 localpos.X = _parent_scene.WorldExtents.X - 0.1f; 1053 localpos.X = m_parent_scene.WorldExtents.X - 0.1f;
1056 } 1054 }
1057 if (localpos.Y < 0.0f) 1055 if (localpos.Y < 0.0f)
1058 { 1056 {
1059 fixbody = true; 1057 fixbody = true;
1060 localpos.Y = 0.1f; 1058 localpos.Y = 0.1f;
1061 } 1059 }
1062 else if (localpos.Y > _parent_scene.WorldExtents.Y - 0.1) 1060 else if (localpos.Y > m_parent_scene.WorldExtents.Y - 0.1)
1063 { 1061 {
1064 fixbody = true; 1062 fixbody = true;
1065 localpos.Y = _parent_scene.WorldExtents.Y - 0.1f; 1063 localpos.Y = m_parent_scene.WorldExtents.Y - 0.1f;
1066 } 1064 }
1067 if (fixbody) 1065 if (fixbody)
1068 { 1066 {
@@ -1107,7 +1105,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1107 posch.Y += vel.Y * ftmp; 1105 posch.Y += vel.Y * ftmp;
1108 } 1106 }
1109 1107
1110 float terrainheight = _parent_scene.GetTerrainHeightAtXY(posch.X, posch.Y); 1108 float terrainheight = m_parent_scene.GetTerrainHeightAtXY(posch.X, posch.Y);
1111 if (chrminZ < terrainheight) 1109 if (chrminZ < terrainheight)
1112 { 1110 {
1113 if (ctz.Z < 0) 1111 if (ctz.Z < 0)
@@ -1119,7 +1117,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1119 m_haveLastFallVel = true; 1117 m_haveLastFallVel = true;
1120 } 1118 }
1121 1119
1122 Vector3 n = _parent_scene.GetTerrainNormalAtXY(posch.X, posch.Y); 1120 Vector3 n = m_parent_scene.GetTerrainNormalAtXY(posch.X, posch.Y);
1123 float depth = terrainheight - chrminZ; 1121 float depth = terrainheight - chrminZ;
1124 1122
1125 vec.Z = depth * PID_P * 50; 1123 vec.Z = depth * PID_P * 50;
@@ -1215,7 +1213,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1215 break; 1213 break;
1216 1214
1217 case PIDHoverType.GroundAndWater: 1215 case PIDHoverType.GroundAndWater:
1218 float waterHeight = _parent_scene.GetWaterLevel(); 1216 float waterHeight = m_parent_scene.GetWaterLevel();
1219 if (terrainheight > waterHeight) 1217 if (terrainheight > waterHeight)
1220 m_targetHoverHeight = terrainheight + m_PIDHoverHeight; 1218 m_targetHoverHeight = terrainheight + m_PIDHoverHeight;
1221 else 1219 else
@@ -1381,7 +1379,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1381 vec.Y += (ctz.Y - vel.Y) * PID_D * 0.833f; 1379 vec.Y += (ctz.Y - vel.Y) * PID_D * 0.833f;
1382 // hack for breaking on fall 1380 // hack for breaking on fall
1383 if (ctz.Z == -9999f) 1381 if (ctz.Z == -9999f)
1384 vec.Z += -vel.Z * PID_D - _parent_scene.gravityz * m_mass; 1382 vec.Z += -vel.Z * PID_D - m_parent_scene.gravityz * m_mass;
1385 } 1383 }
1386 } 1384 }
1387 } 1385 }
@@ -1407,7 +1405,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1407 1405
1408 if (flying || hoverPIDActive) 1406 if (flying || hoverPIDActive)
1409 { 1407 {
1410 vec.Z -= _parent_scene.gravityz * m_mass; 1408 vec.Z -= m_parent_scene.gravityz * m_mass;
1411 1409
1412 if(!hoverPIDActive) 1410 if(!hoverPIDActive)
1413 { 1411 {
@@ -1585,7 +1583,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1585 public override void UnSubscribeEvents() 1583 public override void UnSubscribeEvents()
1586 { 1584 {
1587 m_eventsubscription = 0; 1585 m_eventsubscription = 0;
1588 _parent_scene.RemoveCollisionEventReporting(this); 1586 m_parent_scene.RemoveCollisionEventReporting(this);
1589 lock(CollisionEventsThisFrame) 1587 lock(CollisionEventsThisFrame)
1590 CollisionEventsThisFrame.Clear(); 1588 CollisionEventsThisFrame.Clear();
1591 } 1589 }
@@ -1594,7 +1592,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1594 { 1592 {
1595 lock(CollisionEventsThisFrame) 1593 lock(CollisionEventsThisFrame)
1596 CollisionEventsThisFrame.AddCollider(CollidedWith, contact); 1594 CollisionEventsThisFrame.AddCollider(CollidedWith, contact);
1597 _parent_scene.AddCollisionEventReporting(this); 1595 m_parent_scene.AddCollisionEventReporting(this);
1598 } 1596 }
1599 1597
1600 public void SendCollisions(int timestep) 1598 public void SendCollisions(int timestep)
@@ -1645,14 +1643,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1645 1643
1646 AvatarGeomAndBodyCreation(_position.X, _position.Y, _position.Z); 1644 AvatarGeomAndBodyCreation(_position.X, _position.Y, _position.Z);
1647 1645
1648 _parent_scene.actor_name_map[collider] = (PhysicsActor)this; 1646 m_parent_scene.actor_name_map[collider] = (PhysicsActor)this;
1649 _parent_scene.actor_name_map[capsule] = (PhysicsActor)this; 1647 m_parent_scene.actor_name_map[capsule] = (PhysicsActor)this;
1650 _parent_scene.AddCharacter(this); 1648 m_parent_scene.AddCharacter(this);
1651 } 1649 }
1652 else 1650 else
1653 { 1651 {
1654 _parent_scene.RemoveCollisionEventReporting(this); 1652 m_parent_scene.RemoveCollisionEventReporting(this);
1655 _parent_scene.RemoveCharacter(this); 1653 m_parent_scene.RemoveCharacter(this);
1656 // destroy avatar capsule and related ODE data 1654 // destroy avatar capsule and related ODE data
1657 AvatarGeomAndBodyDestroy(); 1655 AvatarGeomAndBodyDestroy();
1658 } 1656 }
@@ -1699,8 +1697,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1699// Velocity = Vector3.Zero; 1697// Velocity = Vector3.Zero;
1700 m_targetVelocity = Vector3.Zero; 1698 m_targetVelocity = Vector3.Zero;
1701 1699
1702 _parent_scene.actor_name_map[collider] = (PhysicsActor)this; 1700 m_parent_scene.actor_name_map[collider] = (PhysicsActor)this;
1703 _parent_scene.actor_name_map[capsule] = (PhysicsActor)this; 1701 m_parent_scene.actor_name_map[capsule] = (PhysicsActor)this;
1704 } 1702 }
1705 m_freemove = false; 1703 m_freemove = false;
1706 m_pidControllerActive = true; 1704 m_pidControllerActive = true;
@@ -2008,7 +2006,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
2008 2006
2009 public void AddChange(changes what, object arg) 2007 public void AddChange(changes what, object arg)
2010 { 2008 {
2011 _parent_scene.AddChange((PhysicsActor)this, what, arg); 2009 m_parent_scene.AddChange((PhysicsActor)this, what, arg);
2012 } 2010 }
2013 2011
2014 private struct strAvatarSize 2012 private struct strAvatarSize
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs
index 63bef7c..2e6a7db 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs
@@ -243,6 +243,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
243 internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue) 243 internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue)
244 { 244 {
245 float len; 245 float len;
246 if(float.IsNaN(pValue) || float.IsInfinity(pValue))
247 return;
246 248
247 switch (pParam) 249 switch (pParam)
248 { 250 {
@@ -374,6 +376,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
374 internal void ProcessVectorVehicleParam(Vehicle pParam, Vector3 pValue) 376 internal void ProcessVectorVehicleParam(Vehicle pParam, Vector3 pValue)
375 { 377 {
376 float len; 378 float len;
379 if(!pValue.IsFinite())
380 return;
377 381
378 switch (pParam) 382 switch (pParam)
379 { 383 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index d5f2e78..af88e4f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -16756,7 +16756,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
16756 retl.Add((LSL_String)((bool)elem ? ScriptBaseClass.JSON_TRUE : ScriptBaseClass.JSON_FALSE)); 16756 retl.Add((LSL_String)((bool)elem ? ScriptBaseClass.JSON_TRUE : ScriptBaseClass.JSON_FALSE));
16757 return retl; 16757 return retl;
16758 case LitJson.JsonType.Double: 16758 case LitJson.JsonType.Double:
16759 retl.Add(new LSL_Float((float)elem)); 16759 retl.Add(new LSL_Float((double)elem));
16760 return retl; 16760 return retl;
16761 case LitJson.JsonType.None: 16761 case LitJson.JsonType.None:
16762 retl.Add((LSL_String)ScriptBaseClass.JSON_NULL); 16762 retl.Add((LSL_String)ScriptBaseClass.JSON_NULL);
@@ -16794,7 +16794,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
16794 case LitJson.JsonType.Boolean: 16794 case LitJson.JsonType.Boolean:
16795 return ((bool)elem ? (LSL_String)ScriptBaseClass.JSON_TRUE : (LSL_String)ScriptBaseClass.JSON_FALSE); 16795 return ((bool)elem ? (LSL_String)ScriptBaseClass.JSON_TRUE : (LSL_String)ScriptBaseClass.JSON_FALSE);
16796 case LitJson.JsonType.Double: 16796 case LitJson.JsonType.Double:
16797 return (new LSL_Float((float)elem)); 16797 return (new LSL_Float((double)elem));
16798 case LitJson.JsonType.None: 16798 case LitJson.JsonType.None:
16799 return ((LSL_String)ScriptBaseClass.JSON_NULL); 16799 return ((LSL_String)ScriptBaseClass.JSON_NULL);
16800 case LitJson.JsonType.String: 16800 case LitJson.JsonType.String:
@@ -16804,7 +16804,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
16804 string s = LitJson.JsonMapper.ToJson(elem); 16804 string s = LitJson.JsonMapper.ToJson(elem);
16805 return (LSL_String)s; 16805 return (LSL_String)s;
16806 default: 16806 default:
16807 throw new Exception(ScriptBaseClass.JSON_INVALID); 16807 throw new Exception(ScriptBaseClass.JSON_INVALID);
16808 } 16808 }
16809 } 16809 }
16810 16810
@@ -16879,9 +16879,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
16879 return i.ToString(); 16879 return i.ToString();
16880 } 16880 }
16881 if (o is LSL_Rotation) 16881 if (o is LSL_Rotation)
16882 return ((LSL_Rotation)o).ToString(); 16882 {
16883 StringBuilder sb = new StringBuilder(128);
16884 sb.Append("\"");
16885 LSL_Rotation r = (LSL_Rotation)o;
16886 sb.Append(r.ToString());
16887 sb.Append("\"");
16888 return sb.ToString();
16889 }
16883 if (o is LSL_Vector) 16890 if (o is LSL_Vector)
16884 return ((LSL_Vector)o).ToString(); 16891 {
16892 StringBuilder sb = new StringBuilder(128);
16893 sb.Append("\"");
16894 LSL_Vector v = (LSL_Vector)o;
16895 sb.Append(v.ToString());
16896 sb.Append("\"");
16897 return sb.ToString();
16898 }
16885 if (o is LSL_String || o is string) 16899 if (o is LSL_String || o is string)
16886 { 16900 {
16887 string str; 16901 string str;