diff options
author | Robert Adams | 2014-09-03 21:21:01 -0700 |
---|---|---|
committer | Robert Adams | 2014-09-03 21:21:01 -0700 |
commit | 47ac103df785e63a541fa9752fd4f0cea4947f16 (patch) | |
tree | 819709c3d8c58db5d3d3af9b2495c3ceff36cf30 /OpenSim/Region | |
parent | Merge branch 'master' into bullet-2.82 (diff) | |
parent | For processing outbound http requests in the XMLRPCModule, start the thread t... (diff) | |
download | opensim-SC-47ac103df785e63a541fa9752fd4f0cea4947f16.zip opensim-SC-47ac103df785e63a541fa9752fd4f0cea4947f16.tar.gz opensim-SC-47ac103df785e63a541fa9752fd4f0cea4947f16.tar.bz2 opensim-SC-47ac103df785e63a541fa9752fd4f0cea4947f16.tar.xz |
Merge branch 'master' into bullet-2.82
Diffstat (limited to 'OpenSim/Region')
7 files changed, 68 insertions, 46 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs index c6e05b1..d7ea906 100644 --- a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs | |||
@@ -36,6 +36,7 @@ using Nini.Config; | |||
36 | using Nwc.XmlRpc; | 36 | using Nwc.XmlRpc; |
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Monitoring; | ||
39 | using OpenSim.Framework.Servers; | 40 | using OpenSim.Framework.Servers; |
40 | using OpenSim.Framework.Servers.HttpServer; | 41 | using OpenSim.Framework.Servers.HttpServer; |
41 | using OpenSim.Region.Framework.Interfaces; | 42 | using OpenSim.Region.Framework.Interfaces; |
@@ -656,12 +657,8 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC | |||
656 | 657 | ||
657 | public void Process() | 658 | public void Process() |
658 | { | 659 | { |
659 | httpThread = new Thread(SendRequest); | ||
660 | httpThread.Name = "HttpRequestThread"; | ||
661 | httpThread.Priority = ThreadPriority.BelowNormal; | ||
662 | httpThread.IsBackground = true; | ||
663 | _finished = false; | 660 | _finished = false; |
664 | httpThread.Start(); | 661 | Watchdog.StartThread(SendRequest, "HttpRequestThread", ThreadPriority.BelowNormal, true, false); |
665 | } | 662 | } |
666 | 663 | ||
667 | /* | 664 | /* |
@@ -733,6 +730,8 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC | |||
733 | } | 730 | } |
734 | 731 | ||
735 | _finished = true; | 732 | _finished = true; |
733 | |||
734 | Watchdog.RemoveThread(); | ||
736 | } | 735 | } |
737 | 736 | ||
738 | public void Stop() | 737 | public void Stop() |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 18376c3..5f0dbd7 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -224,6 +224,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
224 | public bool m_clampPrimSize; | 224 | public bool m_clampPrimSize; |
225 | public bool m_trustBinaries; | 225 | public bool m_trustBinaries; |
226 | public bool m_allowScriptCrossings = true; | 226 | public bool m_allowScriptCrossings = true; |
227 | |||
228 | /// <summary> | ||
229 | /// Can avatars cross from and to this region? | ||
230 | /// </summary> | ||
231 | public bool AllowAvatarCrossing { get; set; } | ||
232 | |||
227 | public bool m_useFlySlow; | 233 | public bool m_useFlySlow; |
228 | public bool m_useTrashOnDelete = true; | 234 | public bool m_useTrashOnDelete = true; |
229 | 235 | ||
@@ -1023,6 +1029,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1023 | 1029 | ||
1024 | #endregion Region Config | 1030 | #endregion Region Config |
1025 | 1031 | ||
1032 | IConfig entityTransferConfig = m_config.Configs["EntityTransfer"]; | ||
1033 | if (entityTransferConfig != null) | ||
1034 | { | ||
1035 | AllowAvatarCrossing = entityTransferConfig.GetBoolean("AllowAvatarCrossing", AllowAvatarCrossing); | ||
1036 | } | ||
1037 | |||
1026 | #region Interest Management | 1038 | #region Interest Management |
1027 | 1039 | ||
1028 | IConfig interestConfig = m_config.Configs["InterestManagement"]; | 1040 | IConfig interestConfig = m_config.Configs["InterestManagement"]; |
@@ -1091,6 +1103,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1091 | CollidablePrims = true; | 1103 | CollidablePrims = true; |
1092 | PhysicsEnabled = true; | 1104 | PhysicsEnabled = true; |
1093 | 1105 | ||
1106 | AllowAvatarCrossing = true; | ||
1107 | |||
1094 | PeriodicBackup = true; | 1108 | PeriodicBackup = true; |
1095 | UseBackup = true; | 1109 | UseBackup = true; |
1096 | 1110 | ||
@@ -5613,6 +5627,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
5613 | return true; | 5627 | return true; |
5614 | } | 5628 | } |
5615 | 5629 | ||
5630 | if (!AllowAvatarCrossing && !viaTeleport) | ||
5631 | return false; | ||
5632 | |||
5616 | // FIXME: Root agent count is currently known to be inaccurate. This forces a recount before we check. | 5633 | // FIXME: Root agent count is currently known to be inaccurate. This forces a recount before we check. |
5617 | // However, the long term fix is to make sure root agent count is always accurate. | 5634 | // However, the long term fix is to make sure root agent count is always accurate. |
5618 | m_sceneGraph.RecalculateStats(); | 5635 | m_sceneGraph.RecalculateStats(); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e0b7640..3c37de8 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -608,8 +608,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
608 | } | 608 | } |
609 | 609 | ||
610 | /// <summary> | 610 | /// <summary> |
611 | /// Current velocity of the avatar. | 611 | /// Velocity of the avatar with respect to its local reference frame. |
612 | /// </summary> | 612 | /// </summary> |
613 | /// <remarks> | ||
614 | /// So when sat on a vehicle this will be 0. To get velocity with respect to the world use GetWorldVelocity() | ||
615 | /// </remarks> | ||
613 | public override Vector3 Velocity | 616 | public override Vector3 Velocity |
614 | { | 617 | { |
615 | get | 618 | get |
@@ -622,10 +625,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
622 | // "[SCENE PRESENCE]: Set velocity {0} for {1} in {2} via getting Velocity!", | 625 | // "[SCENE PRESENCE]: Set velocity {0} for {1} in {2} via getting Velocity!", |
623 | // m_velocity, Name, Scene.RegionInfo.RegionName); | 626 | // m_velocity, Name, Scene.RegionInfo.RegionName); |
624 | } | 627 | } |
625 | else if (ParentPart != null) | 628 | // else if (ParentPart != null) |
626 | { | 629 | // { |
627 | return ParentPart.ParentGroup.Velocity; | 630 | // return ParentPart.ParentGroup.Velocity; |
628 | } | 631 | // } |
629 | 632 | ||
630 | return m_velocity; | 633 | return m_velocity; |
631 | } | 634 | } |
@@ -749,25 +752,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
749 | } | 752 | } |
750 | 753 | ||
751 | /// <summary> | 754 | /// <summary> |
752 | /// Gets the world rotation of this presence. | 755 | /// Get rotation relative to the world. |
753 | /// </summary> | 756 | /// </summary> |
754 | /// <remarks> | ||
755 | /// Unlike Rotation, this returns the world rotation no matter whether the avatar is sitting on a prim or not. | ||
756 | /// </remarks> | ||
757 | /// <returns></returns> | 757 | /// <returns></returns> |
758 | public Quaternion GetWorldRotation() | 758 | public Quaternion GetWorldRotation() |
759 | { | 759 | { |
760 | if (IsSatOnObject) | 760 | SceneObjectPart sitPart = ParentPart; |
761 | { | ||
762 | SceneObjectPart sitPart = ParentPart; | ||
763 | 761 | ||
764 | if (sitPart != null) | 762 | if (sitPart != null) |
765 | return sitPart.GetWorldRotation() * Rotation; | 763 | return sitPart.GetWorldRotation() * Rotation; |
766 | } | ||
767 | 764 | ||
768 | return Rotation; | 765 | return Rotation; |
769 | } | 766 | } |
770 | 767 | ||
768 | /// <summary> | ||
769 | /// Get velocity relative to the world. | ||
770 | /// </summary> | ||
771 | public Vector3 GetWorldVelocity() | ||
772 | { | ||
773 | SceneObjectPart sitPart = ParentPart; | ||
774 | |||
775 | if (sitPart != null) | ||
776 | return sitPart.ParentGroup.Velocity; | ||
777 | |||
778 | return Velocity; | ||
779 | } | ||
780 | |||
771 | public void AdjustKnownSeeds() | 781 | public void AdjustKnownSeeds() |
772 | { | 782 | { |
773 | Dictionary<ulong, string> seeds; | 783 | Dictionary<ulong, string> seeds; |
@@ -3216,7 +3226,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3216 | m_lastVelocity = Velocity; | 3226 | m_lastVelocity = Velocity; |
3217 | } | 3227 | } |
3218 | 3228 | ||
3219 | CheckForBorderCrossing(); | 3229 | if (Scene.AllowAvatarCrossing) |
3230 | CheckForBorderCrossing(); | ||
3220 | 3231 | ||
3221 | CheckForSignificantMovement(); // sends update to the modules. | 3232 | CheckForSignificantMovement(); // sends update to the modules. |
3222 | } | 3233 | } |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs index f5bd44d..bdd07e0 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs | |||
@@ -109,10 +109,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
109 | 109 | ||
110 | internal int m_resetk = 0; | 110 | internal int m_resetk = 0; |
111 | 111 | ||
112 | // Working threads | ||
113 | |||
114 | private Thread m_listener = null; | ||
115 | |||
116 | private Object msyncConnect = new Object(); | 112 | private Object msyncConnect = new Object(); |
117 | 113 | ||
118 | internal bool m_randomizeNick = true; // add random suffix | 114 | internal bool m_randomizeNick = true; // add random suffix |
@@ -363,10 +359,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
363 | 359 | ||
364 | m_log.InfoFormat("[IRC-Connector-{0}]: Connected to {1}:{2}", idn, m_server, m_port); | 360 | m_log.InfoFormat("[IRC-Connector-{0}]: Connected to {1}:{2}", idn, m_server, m_port); |
365 | 361 | ||
366 | m_listener = new Thread(new ThreadStart(ListenerRun)); | 362 | Watchdog.StartThread(ListenerRun, "IRCConnectionListenerThread", ThreadPriority.Normal, true, false); |
367 | m_listener.Name = "IRCConnectorListenerThread"; | ||
368 | m_listener.IsBackground = true; | ||
369 | m_listener.Start(); | ||
370 | 363 | ||
371 | // This is the message order recommended by RFC 2812 | 364 | // This is the message order recommended by RFC 2812 |
372 | if (m_password != null) | 365 | if (m_password != null) |
@@ -510,21 +503,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
510 | { | 503 | { |
511 | while (m_enabled && m_connected) | 504 | while (m_enabled && m_connected) |
512 | { | 505 | { |
513 | |||
514 | if ((inputLine = m_reader.ReadLine()) == null) | 506 | if ((inputLine = m_reader.ReadLine()) == null) |
515 | throw new Exception("Listener input socket closed"); | 507 | throw new Exception("Listener input socket closed"); |
516 | 508 | ||
509 | Watchdog.UpdateThread(); | ||
510 | |||
517 | // m_log.Info("[IRCConnector]: " + inputLine); | 511 | // m_log.Info("[IRCConnector]: " + inputLine); |
518 | 512 | ||
519 | if (inputLine.Contains("PRIVMSG")) | 513 | if (inputLine.Contains("PRIVMSG")) |
520 | { | 514 | { |
521 | |||
522 | Dictionary<string, string> data = ExtractMsg(inputLine); | 515 | Dictionary<string, string> data = ExtractMsg(inputLine); |
523 | 516 | ||
524 | // Any chat ??? | 517 | // Any chat ??? |
525 | if (data != null) | 518 | if (data != null) |
526 | { | 519 | { |
527 | |||
528 | OSChatMessage c = new OSChatMessage(); | 520 | OSChatMessage c = new OSChatMessage(); |
529 | c.Message = data["msg"]; | 521 | c.Message = data["msg"]; |
530 | c.Type = ChatTypeEnum.Region; | 522 | c.Type = ChatTypeEnum.Region; |
@@ -540,9 +532,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
540 | c.Message = String.Format("/me {0}", c.Message.Substring(8, c.Message.Length - 9)); | 532 | c.Message = String.Format("/me {0}", c.Message.Substring(8, c.Message.Length - 9)); |
541 | 533 | ||
542 | ChannelState.OSChat(this, c, false); | 534 | ChannelState.OSChat(this, c, false); |
543 | |||
544 | } | 535 | } |
545 | |||
546 | } | 536 | } |
547 | else | 537 | else |
548 | { | 538 | { |
@@ -562,6 +552,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
562 | 552 | ||
563 | if (m_enabled && (m_resetk == resetk)) | 553 | if (m_enabled && (m_resetk == resetk)) |
564 | Reconnect(); | 554 | Reconnect(); |
555 | |||
556 | Watchdog.RemoveThread(); | ||
565 | } | 557 | } |
566 | 558 | ||
567 | private Regex RE = new Regex(@":(?<nick>[\w-]*)!(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)", | 559 | private Regex RE = new Regex(@":(?<nick>[\w-]*)!(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)", |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index f7317c0..a46c241 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -32,6 +32,7 @@ using System.Runtime.InteropServices; | |||
32 | using System.Text; | 32 | using System.Text; |
33 | using System.Threading; | 33 | using System.Threading; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Monitoring; | ||
35 | using OpenSim.Region.Framework; | 36 | using OpenSim.Region.Framework; |
36 | using OpenSim.Region.CoreModules; | 37 | using OpenSim.Region.CoreModules; |
37 | using Logging = OpenSim.Region.CoreModules.Framework.Statistics.Logging; | 38 | using Logging = OpenSim.Region.CoreModules.Framework.Statistics.Logging; |
@@ -286,9 +287,13 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
286 | if (BSParam.UseSeparatePhysicsThread) | 287 | if (BSParam.UseSeparatePhysicsThread) |
287 | { | 288 | { |
288 | // The physics simulation should happen independently of the heartbeat loop | 289 | // The physics simulation should happen independently of the heartbeat loop |
289 | m_physicsThread = new Thread(BulletSPluginPhysicsThread); | 290 | m_physicsThread |
290 | m_physicsThread.Name = BulletEngineName; | 291 | = Watchdog.StartThread( |
291 | m_physicsThread.Start(); | 292 | BulletSPluginPhysicsThread, |
293 | string.Format("{0} ({1})", BulletEngineName, RegionName), | ||
294 | ThreadPriority.Normal, | ||
295 | true, | ||
296 | true); | ||
292 | } | 297 | } |
293 | } | 298 | } |
294 | 299 | ||
@@ -856,7 +861,11 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
856 | // TODO. | 861 | // TODO. |
857 | DetailLog("{0},BulletSPluginPhysicsThread,longerThanRealtime={1}", BSScene.DetailLogZero, simulationTimeVsRealtimeDifferenceMS); | 862 | DetailLog("{0},BulletSPluginPhysicsThread,longerThanRealtime={1}", BSScene.DetailLogZero, simulationTimeVsRealtimeDifferenceMS); |
858 | } | 863 | } |
864 | |||
865 | Watchdog.UpdateThread(); | ||
859 | } | 866 | } |
867 | |||
868 | Watchdog.RemoveThread(); | ||
860 | } | 869 | } |
861 | 870 | ||
862 | #endregion // Simulation | 871 | #endregion // Simulation |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5d7fc9d..7c384b2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2560,7 +2560,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2560 | if (m_host.ParentGroup.IsAttachment) | 2560 | if (m_host.ParentGroup.IsAttachment) |
2561 | { | 2561 | { |
2562 | ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.AttachedAvatar); | 2562 | ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.AttachedAvatar); |
2563 | vel = avatar.Velocity; | 2563 | vel = avatar.GetWorldVelocity(); |
2564 | } | 2564 | } |
2565 | else | 2565 | else |
2566 | { | 2566 | { |
@@ -11221,7 +11221,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11221 | ret.Add(new LSL_Rotation(av.GetWorldRotation())); | 11221 | ret.Add(new LSL_Rotation(av.GetWorldRotation())); |
11222 | break; | 11222 | break; |
11223 | case ScriptBaseClass.OBJECT_VELOCITY: | 11223 | case ScriptBaseClass.OBJECT_VELOCITY: |
11224 | ret.Add(new LSL_Vector(av.Velocity.X, av.Velocity.Y, av.Velocity.Z)); | 11224 | ret.Add(new LSL_Vector(av.GetWorldVelocity())); |
11225 | break; | 11225 | break; |
11226 | case ScriptBaseClass.OBJECT_OWNER: | 11226 | case ScriptBaseClass.OBJECT_OWNER: |
11227 | ret.Add(new LSL_String(id)); | 11227 | ret.Add(new LSL_String(id)); |
@@ -11342,7 +11342,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11342 | ScenePresence sp = World.GetScenePresence(obj.ParentGroup.AttachedAvatar); | 11342 | ScenePresence sp = World.GetScenePresence(obj.ParentGroup.AttachedAvatar); |
11343 | 11343 | ||
11344 | if (sp != null) | 11344 | if (sp != null) |
11345 | vel = sp.Velocity; | 11345 | vel = sp.GetWorldVelocity(); |
11346 | } | 11346 | } |
11347 | else | 11347 | else |
11348 | { | 11348 | { |
diff --git a/OpenSim/Region/UserStatistics/SimStatsAJAX.cs b/OpenSim/Region/UserStatistics/SimStatsAJAX.cs index ad848a1..06d9e91 100644 --- a/OpenSim/Region/UserStatistics/SimStatsAJAX.cs +++ b/OpenSim/Region/UserStatistics/SimStatsAJAX.cs | |||
@@ -162,9 +162,6 @@ namespace OpenSim.Region.UserStatistics | |||
162 | output.Append("OthrMS"); | 162 | output.Append("OthrMS"); |
163 | HTMLUtil.TD_C(ref output); | 163 | HTMLUtil.TD_C(ref output); |
164 | HTMLUtil.TD_O(ref output, TDHeaderClass); | 164 | HTMLUtil.TD_O(ref output, TDHeaderClass); |
165 | output.Append("ScrLPS"); | ||
166 | HTMLUtil.TD_C(ref output); | ||
167 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
168 | output.Append("OutPPS"); | 165 | output.Append("OutPPS"); |
169 | HTMLUtil.TD_C(ref output); | 166 | HTMLUtil.TD_C(ref output); |
170 | HTMLUtil.TD_O(ref output, TDHeaderClass); | 167 | HTMLUtil.TD_O(ref output, TDHeaderClass); |
@@ -194,9 +191,6 @@ namespace OpenSim.Region.UserStatistics | |||
194 | output.Append(sdata.OtherFrameTime); | 191 | output.Append(sdata.OtherFrameTime); |
195 | HTMLUtil.TD_C(ref output); | 192 | HTMLUtil.TD_C(ref output); |
196 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | 193 | HTMLUtil.TD_O(ref output, TDDataClassCenter); |
197 | output.Append(sdata.ScriptLinesPerSecond); | ||
198 | HTMLUtil.TD_C(ref output); | ||
199 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
200 | output.Append(sdata.OutPacketsPerSecond); | 194 | output.Append(sdata.OutPacketsPerSecond); |
201 | HTMLUtil.TD_C(ref output); | 195 | HTMLUtil.TD_C(ref output); |
202 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | 196 | HTMLUtil.TD_O(ref output, TDDataClassCenter); |