aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules
diff options
context:
space:
mode:
authorMelanie2009-10-27 11:32:11 +0000
committerMelanie2009-10-27 11:32:11 +0000
commit31a848e97bd984ab0a85feca397ce419f6ae839a (patch)
tree4743f5eb7c12b3723ed4b986d19714d1b3a0a3ea /OpenSim/Region/OptionalModules
parentCommented out instrumentation in ODEPrim.cs (diff)
parentFinally hunted down the Parallel deadlock. Packets were being handled asynchr... (diff)
downloadopensim-SC-31a848e97bd984ab0a85feca397ce419f6ae839a.zip
opensim-SC-31a848e97bd984ab0a85feca397ce419f6ae839a.tar.gz
opensim-SC-31a848e97bd984ab0a85feca397ce419f6ae839a.tar.bz2
opensim-SC-31a848e97bd984ab0a85feca397ce419f6ae839a.tar.xz
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs10
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs7
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs3
-rw-r--r--OpenSim/Region/OptionalModules/ContentManagementSystem/CMController.cs10
-rw-r--r--OpenSim/Region/OptionalModules/ContentManagementSystem/MetaEntity.cs6
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs42
-rw-r--r--OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs13
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs11
8 files changed, 57 insertions, 45 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index df03b8d..4b0d01a 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -67,9 +67,8 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
67 { 67 {
68 m_client = client; 68 m_client = client;
69 m_scene = scene; 69 m_scene = scene;
70 70
71 Thread loopThread = new Thread(InternalLoop); 71 Watchdog.StartThread(InternalLoop, "IRCClientView", ThreadPriority.Normal, false);
72 loopThread.Start();
73 } 72 }
74 73
75 private void SendServerCommand(string command) 74 private void SendServerCommand(string command)
@@ -102,7 +101,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
102 { 101 {
103 try 102 try
104 { 103 {
105 string strbuf = ""; 104 string strbuf = String.Empty;
106 105
107 while (m_connected && m_client.Connected) 106 while (m_connected && m_client.Connected)
108 { 107 {
@@ -140,6 +139,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
140 } 139 }
141 140
142 Thread.Sleep(0); 141 Thread.Sleep(0);
142 Watchdog.UpdateThread();
143 } 143 }
144 } 144 }
145 catch (IOException) 145 catch (IOException)
@@ -156,6 +156,8 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
156 156
157 m_log.Warn("[IRCd] Disconnected client."); 157 m_log.Warn("[IRCd] Disconnected client.");
158 } 158 }
159
160 Watchdog.RemoveThread();
159 } 161 }
160 162
161 private void ProcessInMessage(string message, string command) 163 private void ProcessInMessage(string message, string command)
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
index 91ce9f1..eb39026 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
@@ -33,6 +33,7 @@ using System.Reflection;
33using System.Text; 33using System.Text;
34using System.Threading; 34using System.Threading;
35using log4net; 35using log4net;
36using OpenSim.Framework;
36using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
37 38
38namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server 39namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
@@ -56,8 +57,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
56 57
57 m_listener.Start(50); 58 m_listener.Start(50);
58 59
59 Thread thread = new Thread(ListenLoop); 60 Watchdog.StartThread(ListenLoop, "IRCServer", ThreadPriority.Normal, false);
60 thread.Start();
61 m_baseScene = baseScene; 61 m_baseScene = baseScene;
62 } 62 }
63 63
@@ -72,7 +72,10 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
72 while (m_running) 72 while (m_running)
73 { 73 {
74 AcceptClient(m_listener.AcceptTcpClient()); 74 AcceptClient(m_listener.AcceptTcpClient());
75 Watchdog.UpdateThread();
75 } 76 }
77
78 Watchdog.RemoveThread();
76 } 79 }
77 80
78 private void AcceptClient(TcpClient client) 81 private void AcceptClient(TcpClient client)
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index b2544fa..f24869b 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -94,7 +94,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
94 } 94 }
95 private Dictionary<UUID, GroupRequestIDInfo> m_clientRequestIDInfo = new Dictionary<UUID, GroupRequestIDInfo>(); 95 private Dictionary<UUID, GroupRequestIDInfo> m_clientRequestIDInfo = new Dictionary<UUID, GroupRequestIDInfo>();
96 private const int m_clientRequestIDFlushTimeOut = 300000; // Every 5 minutes 96 private const int m_clientRequestIDFlushTimeOut = 300000; // Every 5 minutes
97 private Timer m_clientRequestIDFlushTimer = new Timer(); 97 private Timer m_clientRequestIDFlushTimer;
98 98
99 99
100 // Configuration settings 100 // Configuration settings
@@ -133,6 +133,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
133 m_groupNoticesEnabled = groupsConfig.GetBoolean("NoticesEnabled", true); 133 m_groupNoticesEnabled = groupsConfig.GetBoolean("NoticesEnabled", true);
134 m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true); 134 m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true);
135 135
136 m_clientRequestIDFlushTimer = new Timer();
136 m_clientRequestIDFlushTimer.Interval = m_clientRequestIDFlushTimeOut; 137 m_clientRequestIDFlushTimer.Interval = m_clientRequestIDFlushTimeOut;
137 m_clientRequestIDFlushTimer.Elapsed += FlushClientRequestIDInfoCache; 138 m_clientRequestIDFlushTimer.Elapsed += FlushClientRequestIDInfoCache;
138 m_clientRequestIDFlushTimer.AutoReset = true; 139 m_clientRequestIDFlushTimer.AutoReset = true;
diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/CMController.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/CMController.cs
index 16fe9e9..8d6c41d 100644
--- a/OpenSim/Region/OptionalModules/ContentManagementSystem/CMController.cs
+++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/CMController.cs
@@ -86,7 +86,6 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
86 /// </value> 86 /// </value>
87 Hashtable m_sceneList = Hashtable.Synchronized(new Hashtable()); 87 Hashtable m_sceneList = Hashtable.Synchronized(new Hashtable());
88 State m_state = State.NONE; 88 State m_state = State.NONE;
89 Thread m_thread = null;
90 CMView m_view = null; 89 CMView m_view = null;
91 90
92 #endregion Fields 91 #endregion Fields
@@ -148,10 +147,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
148 lock (this) 147 lock (this)
149 { 148 {
150 m_estateModule = scene.RequestModuleInterface<IEstateModule>(); 149 m_estateModule = scene.RequestModuleInterface<IEstateModule>();
151 m_thread = new Thread(MainLoop); 150 Watchdog.StartThread(MainLoop, "Content Management", ThreadPriority.Normal, true);
152 m_thread.Name = "Content Management";
153 m_thread.IsBackground = true;
154 m_thread.Start();
155 m_state = State.NONE; 151 m_state = State.NONE;
156 } 152 }
157 } 153 }
@@ -200,6 +196,8 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
200 m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- uuuuuuuuuh, what?"); 196 m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- uuuuuuuuuh, what?");
201 break; 197 break;
202 } 198 }
199
200 Watchdog.UpdateThread();
203 } 201 }
204 } 202 }
205 catch (Exception e) 203 catch (Exception e)
@@ -209,6 +207,8 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
209 "[CONTENT MANAGEMENT]: Content management thread terminating with exception. PLEASE REBOOT YOUR SIM - CONTENT MANAGEMENT WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}", 207 "[CONTENT MANAGEMENT]: Content management thread terminating with exception. PLEASE REBOOT YOUR SIM - CONTENT MANAGEMENT WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}",
210 e); 208 e);
211 } 209 }
210
211 Watchdog.RemoveThread();
212 } 212 }
213 213
214 /// <summary> 214 /// <summary>
diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/MetaEntity.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/MetaEntity.cs
index b6513e2..1a72971 100644
--- a/OpenSim/Region/OptionalModules/ContentManagementSystem/MetaEntity.cs
+++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/MetaEntity.cs
@@ -183,10 +183,12 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
183 public virtual void HideFromAll() 183 public virtual void HideFromAll()
184 { 184 {
185 foreach (SceneObjectPart part in m_Entity.Children.Values) 185 foreach (SceneObjectPart part in m_Entity.Children.Values)
186 m_Entity.Scene.ClientManager.ForEach( 186 {
187 m_Entity.Scene.ForEachClient(
187 delegate(IClientAPI controller) 188 delegate(IClientAPI controller)
188 { controller.SendKillObject(m_Entity.RegionHandle, part.LocalId); } 189 { controller.SendKillObject(m_Entity.RegionHandle, part.LocalId); }
189 ); 190 );
191 }
190 } 192 }
191 193
192 public void SendFullUpdate(IClientAPI client) 194 public void SendFullUpdate(IClientAPI client)
@@ -202,7 +204,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
202 204
203 public void SendFullUpdateToAll() 205 public void SendFullUpdateToAll()
204 { 206 {
205 m_Entity.Scene.ClientManager.ForEach( 207 m_Entity.Scene.ForEachClient(
206 delegate(IClientAPI controller) 208 delegate(IClientAPI controller)
207 { m_Entity.SendFullUpdateToClient(controller); } 209 { m_Entity.SendFullUpdateToClient(controller); }
208 ); 210 );
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
index 292e345..1f1ebae 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
@@ -525,8 +525,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
525 { 525 {
526 get 526 get
527 { 527 {
528 PhysicsVector tmp = GetSOP().PhysActor.GeometricCenter; 528 Vector3 tmp = GetSOP().PhysActor.GeometricCenter;
529 return new Vector3(tmp.X, tmp.Y, tmp.Z); 529 return tmp;
530 } 530 }
531 } 531 }
532 532
@@ -534,8 +534,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
534 { 534 {
535 get 535 get
536 { 536 {
537 PhysicsVector tmp = GetSOP().PhysActor.CenterOfMass; 537 Vector3 tmp = GetSOP().PhysActor.CenterOfMass;
538 return new Vector3(tmp.X, tmp.Y, tmp.Z); 538 return tmp;
539 } 539 }
540 } 540 }
541 541
@@ -543,15 +543,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
543 { 543 {
544 get 544 get
545 { 545 {
546 PhysicsVector tmp = GetSOP().PhysActor.RotationalVelocity; 546 Vector3 tmp = GetSOP().PhysActor.RotationalVelocity;
547 return new Vector3(tmp.X, tmp.Y, tmp.Z); 547 return tmp;
548 } 548 }
549 set 549 set
550 { 550 {
551 if (!CanEdit()) 551 if (!CanEdit())
552 return; 552 return;
553 553
554 GetSOP().PhysActor.RotationalVelocity = new PhysicsVector(value.X, value.Y, value.Z); 554 GetSOP().PhysActor.RotationalVelocity = value;
555 } 555 }
556 } 556 }
557 557
@@ -559,15 +559,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
559 { 559 {
560 get 560 get
561 { 561 {
562 PhysicsVector tmp = GetSOP().PhysActor.Velocity; 562 Vector3 tmp = GetSOP().PhysActor.Velocity;
563 return new Vector3(tmp.X, tmp.Y, tmp.Z); 563 return tmp;
564 } 564 }
565 set 565 set
566 { 566 {
567 if (!CanEdit()) 567 if (!CanEdit())
568 return; 568 return;
569 569
570 GetSOP().PhysActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z); 570 GetSOP().PhysActor.Velocity = value;
571 } 571 }
572 } 572 }
573 573
@@ -575,15 +575,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
575 { 575 {
576 get 576 get
577 { 577 {
578 PhysicsVector tmp = GetSOP().PhysActor.Torque; 578 Vector3 tmp = GetSOP().PhysActor.Torque;
579 return new Vector3(tmp.X, tmp.Y, tmp.Z); 579 return tmp;
580 } 580 }
581 set 581 set
582 { 582 {
583 if (!CanEdit()) 583 if (!CanEdit())
584 return; 584 return;
585 585
586 GetSOP().PhysActor.Torque = new PhysicsVector(value.X, value.Y, value.Z); 586 GetSOP().PhysActor.Torque = value;
587 } 587 }
588 } 588 }
589 589
@@ -591,8 +591,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
591 { 591 {
592 get 592 get
593 { 593 {
594 PhysicsVector tmp = GetSOP().PhysActor.Acceleration; 594 Vector3 tmp = GetSOP().PhysActor.Acceleration;
595 return new Vector3(tmp.X, tmp.Y, tmp.Z); 595 return tmp;
596 } 596 }
597 } 597 }
598 598
@@ -600,15 +600,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
600 { 600 {
601 get 601 get
602 { 602 {
603 PhysicsVector tmp = GetSOP().PhysActor.Force; 603 Vector3 tmp = GetSOP().PhysActor.Force;
604 return new Vector3(tmp.X, tmp.Y, tmp.Z); 604 return tmp;
605 } 605 }
606 set 606 set
607 { 607 {
608 if (!CanEdit()) 608 if (!CanEdit())
609 return; 609 return;
610 610
611 GetSOP().PhysActor.Force = new PhysicsVector(value.X, value.Y, value.Z); 611 GetSOP().PhysActor.Force = value;
612 } 612 }
613 } 613 }
614 614
@@ -627,7 +627,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
627 if (!CanEdit()) 627 if (!CanEdit())
628 return; 628 return;
629 629
630 GetSOP().PhysActor.AddForce(new PhysicsVector(force.X, force.Y, force.Z), pushforce); 630 GetSOP().PhysActor.AddForce(force, pushforce);
631 } 631 }
632 632
633 public void AddAngularForce(Vector3 force, bool pushforce) 633 public void AddAngularForce(Vector3 force, bool pushforce)
@@ -635,7 +635,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
635 if (!CanEdit()) 635 if (!CanEdit())
636 return; 636 return;
637 637
638 GetSOP().PhysActor.AddAngularForce(new PhysicsVector(force.X, force.Y, force.Z), pushforce); 638 GetSOP().PhysActor.AddAngularForce(force, pushforce);
639 } 639 }
640 640
641 public void SetMomentum(Vector3 momentum) 641 public void SetMomentum(Vector3 momentum)
@@ -643,7 +643,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
643 if (!CanEdit()) 643 if (!CanEdit())
644 return; 644 return;
645 645
646 GetSOP().PhysActor.SetMomentum(new PhysicsVector(momentum.X, momentum.Y, momentum.Z)); 646 GetSOP().PhysActor.SetMomentum(momentum);
647 } 647 }
648 648
649 #endregion 649 #endregion
diff --git a/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs b/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs
index fc1c608..3490a8b 100644
--- a/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs
+++ b/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs
@@ -45,13 +45,13 @@ namespace OpenSim.Region.Modules.SvnSerialiser
45 public class SvnBackupModule : IRegionModule 45 public class SvnBackupModule : IRegionModule
46 { 46 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 private readonly List<Scene> m_scenes = new List<Scene>();
49 private readonly Timer m_timer = new Timer();
50 48
51 private bool m_enabled = false; 49 private List<Scene> m_scenes;
52 private bool m_installBackupOnLoad = false; 50 private Timer m_timer;
51 private bool m_enabled;
52 private bool m_installBackupOnLoad;
53 private IRegionSerialiserModule m_serialiser; 53 private IRegionSerialiserModule m_serialiser;
54 private bool m_svnAutoSave = false; 54 private bool m_svnAutoSave;
55 private SvnClient m_svnClient; 55 private SvnClient m_svnClient;
56 private string m_svndir = "SVNmodule" + Slash.DirectorySeparatorChar + "repo"; 56 private string m_svndir = "SVNmodule" + Slash.DirectorySeparatorChar + "repo";
57 private string m_svnpass = "password"; 57 private string m_svnpass = "password";
@@ -204,6 +204,9 @@ namespace OpenSim.Region.Modules.SvnSerialiser
204 204
205 public void Initialise(Scene scene, IConfigSource source) 205 public void Initialise(Scene scene, IConfigSource source)
206 { 206 {
207 m_scenes = new List<Scene>();
208 m_timer = new Timer();
209
207 try 210 try
208 { 211 {
209 if (!source.Configs["SVN"].GetBoolean("Enabled", false)) 212 if (!source.Configs["SVN"].GetBoolean("Enabled", false))
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 41a6255..ac39a53 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -41,12 +41,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
41 { 41 {
42 // private const bool m_enabled = false; 42 // private const bool m_enabled = false;
43 43
44 private Mutex m_createMutex = new Mutex(false); 44 private Mutex m_createMutex;
45 45 private Timer m_timer;
46 private Timer m_timer = new Timer(500);
47 46
48 private Dictionary<UUID,NPCAvatar> m_avatars = new Dictionary<UUID, NPCAvatar>(); 47 private Dictionary<UUID,NPCAvatar> m_avatars = new Dictionary<UUID, NPCAvatar>();
49
50 private Dictionary<UUID,AvatarAppearance> m_appearanceCache = new Dictionary<UUID, AvatarAppearance>(); 48 private Dictionary<UUID,AvatarAppearance> m_appearanceCache = new Dictionary<UUID, AvatarAppearance>();
51 49
52 // Timer vars. 50 // Timer vars.
@@ -138,10 +136,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC
138 136
139 public void Initialise(Scene scene, IConfigSource source) 137 public void Initialise(Scene scene, IConfigSource source)
140 { 138 {
141 scene.RegisterModuleInterface<INPCModule>(this); 139 m_createMutex = new Mutex(false);
142 140
141 m_timer = new Timer(500);
143 m_timer.Elapsed += m_timer_Elapsed; 142 m_timer.Elapsed += m_timer_Elapsed;
144 m_timer.Start(); 143 m_timer.Start();
144
145 scene.RegisterModuleInterface<INPCModule>(this);
145 } 146 }
146 147
147 void m_timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) 148 void m_timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)