aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-07-08 22:07:27 +0100
committerJustin Clark-Casey (justincc)2013-07-08 22:07:27 +0100
commitc3db5959441dbd1e04cdd32e92bda9eb5bf2853b (patch)
treea7b262be4f9f0dc0c7c5464ce5d657351c53a63e /OpenSim/Region/CoreModules/Framework
parentAdd "show caps stats by user" and "show caps stats by cap" console commands t... (diff)
parentPlaced a throttle on UserManagementModule for name lookups. Singularity appar... (diff)
downloadopensim-SC_OLD-c3db5959441dbd1e04cdd32e92bda9eb5bf2853b.zip
opensim-SC_OLD-c3db5959441dbd1e04cdd32e92bda9eb5bf2853b.tar.gz
opensim-SC_OLD-c3db5959441dbd1e04cdd32e92bda9eb5bf2853b.tar.bz2
opensim-SC_OLD-c3db5959441dbd1e04cdd32e92bda9eb5bf2853b.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r--OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs71
3 files changed, 61 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs
index d07cff4..69d7e16 100644
--- a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs
@@ -176,7 +176,7 @@ namespace OpenSim.Region.CoreModules.Framework.Library
176 m_log.InfoFormat("[LIBRARY MODULE]: Loading library archive {0} ({1})...", iarFileName, simpleName); 176 m_log.InfoFormat("[LIBRARY MODULE]: Loading library archive {0} ({1})...", iarFileName, simpleName);
177 simpleName = GetInventoryPathFromName(simpleName); 177 simpleName = GetInventoryPathFromName(simpleName);
178 178
179 InventoryArchiveReadRequest archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, simpleName, iarFileName, false); 179 InventoryArchiveReadRequest archread = new InventoryArchiveReadRequest(m_MockScene.InventoryService, m_MockScene.AssetService, m_MockScene.UserAccountService, uinfo, simpleName, iarFileName, false);
180 try 180 try
181 { 181 {
182 HashSet<InventoryNodeBase> nodes = archread.Execute(); 182 HashSet<InventoryNodeBase> nodes = archread.Execute();
@@ -185,7 +185,7 @@ namespace OpenSim.Region.CoreModules.Framework.Library
185 // didn't find the subfolder with the given name; place it on the top 185 // didn't find the subfolder with the given name; place it on the top
186 m_log.InfoFormat("[LIBRARY MODULE]: Didn't find {0} in library. Placing archive on the top level", simpleName); 186 m_log.InfoFormat("[LIBRARY MODULE]: Didn't find {0} in library. Placing archive on the top level", simpleName);
187 archread.Close(); 187 archread.Close();
188 archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, "/", iarFileName, false); 188 archread = new InventoryArchiveReadRequest(m_MockScene.InventoryService, m_MockScene.AssetService, m_MockScene.UserAccountService, uinfo, "/", iarFileName, false);
189 archread.Execute(); 189 archread.Execute();
190 } 190 }
191 191
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs
index ad3cf15..245c808 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
58 if (umanmod == Name) 58 if (umanmod == Name)
59 { 59 {
60 m_Enabled = true; 60 m_Enabled = true;
61 RegisterConsoleCmds(); 61 Init();
62 m_log.DebugFormat("[USER MANAGEMENT MODULE]: {0} is enabled", Name); 62 m_log.DebugFormat("[USER MANAGEMENT MODULE]: {0} is enabled", Name);
63 } 63 }
64 } 64 }
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index a7cbc8f..a528093 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -28,9 +28,11 @@ using System;
28using System.Collections.Generic; 28using System.Collections.Generic;
29using System.IO; 29using System.IO;
30using System.Reflection; 30using System.Reflection;
31using System.Threading;
31 32
32using OpenSim.Framework; 33using OpenSim.Framework;
33using OpenSim.Framework.Console; 34using OpenSim.Framework.Console;
35using OpenSim.Framework.Monitoring;
34using OpenSim.Region.ClientStack.LindenUDP; 36using OpenSim.Region.ClientStack.LindenUDP;
35using OpenSim.Region.Framework; 37using OpenSim.Region.Framework;
36using OpenSim.Region.Framework.Interfaces; 38using OpenSim.Region.Framework.Interfaces;
@@ -57,6 +59,10 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
57 // The cache 59 // The cache
58 protected Dictionary<UUID, UserData> m_UserCache = new Dictionary<UUID, UserData>(); 60 protected Dictionary<UUID, UserData> m_UserCache = new Dictionary<UUID, UserData>();
59 61
62 // Throttle the name requests
63 private OpenSim.Framework.BlockingQueue<NameRequest> m_RequestQueue = new OpenSim.Framework.BlockingQueue<NameRequest>();
64
65
60 #region ISharedRegionModule 66 #region ISharedRegionModule
61 67
62 public void Initialise(IConfigSource config) 68 public void Initialise(IConfigSource config)
@@ -65,7 +71,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
65 if (umanmod == Name) 71 if (umanmod == Name)
66 { 72 {
67 m_Enabled = true; 73 m_Enabled = true;
68 RegisterConsoleCmds(); 74 Init();
69 m_log.DebugFormat("[USER MANAGEMENT MODULE]: {0} is enabled", Name); 75 m_log.DebugFormat("[USER MANAGEMENT MODULE]: {0} is enabled", Name);
70 } 76 }
71 } 77 }
@@ -160,16 +166,9 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
160 } 166 }
161 else 167 else
162 { 168 {
163 string[] names; 169 NameRequest request = new NameRequest(remote_client, uuid);
164 bool foundRealName = TryGetUserNames(uuid, out names); 170 m_RequestQueue.Enqueue(request);
165 171
166 if (names.Length == 2)
167 {
168 if (!foundRealName)
169 m_log.DebugFormat("[USER MANAGEMENT MODULE]: Sending {0} {1} for {2} to {3} since no bound name found", names[0], names[1], uuid, remote_client.Name);
170
171 remote_client.SendNameReply(uuid, names[0], names[1]);
172 }
173 } 172 }
174 } 173 }
175 174
@@ -514,9 +513,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
514 return; 513 return;
515 } 514 }
516 515
517 //try update unknown users 516 //try update unknown users, but don't update anyone else
518 //and creator's home URL's 517 if (oldUser.FirstName == "Unknown" && !creatorData.Contains("Unknown"))
519 if ((oldUser.FirstName == "Unknown" && !creatorData.Contains("Unknown")) || (oldUser.HomeURL != null && !creatorData.StartsWith(oldUser.HomeURL)))
520 { 518 {
521 lock (m_UserCache) 519 lock (m_UserCache)
522 m_UserCache.Remove(id); 520 m_UserCache.Remove(id);
@@ -597,6 +595,18 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
597 595
598 #endregion IUserManagement 596 #endregion IUserManagement
599 597
598 protected void Init()
599 {
600 RegisterConsoleCmds();
601 Watchdog.StartThread(
602 ProcessQueue,
603 "NameRequestThread",
604 ThreadPriority.BelowNormal,
605 true,
606 false);
607
608 }
609
600 protected void RegisterConsoleCmds() 610 protected void RegisterConsoleCmds()
601 { 611 {
602 MainConsole.Instance.Commands.AddCommand("Users", true, 612 MainConsole.Instance.Commands.AddCommand("Users", true,
@@ -663,5 +673,40 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
663 673
664 MainConsole.Instance.Output(cdt.ToString()); 674 MainConsole.Instance.Output(cdt.ToString());
665 } 675 }
676
677 private void ProcessQueue()
678 {
679 while (true)
680 {
681 Watchdog.UpdateThread();
682
683 NameRequest request = m_RequestQueue.Dequeue();
684 string[] names;
685 bool foundRealName = TryGetUserNames(request.uuid, out names);
686
687 if (names.Length == 2)
688 {
689 if (!foundRealName)
690 m_log.DebugFormat("[USER MANAGEMENT MODULE]: Sending {0} {1} for {2} to {3} since no bound name found", names[0], names[1], request.uuid, request.client.Name);
691
692 request.client.SendNameReply(request.uuid, names[0], names[1]);
693 }
694
695 }
696 }
697
698 }
699
700 class NameRequest
701 {
702 public IClientAPI client;
703 public UUID uuid;
704
705 public NameRequest(IClientAPI c, UUID n)
706 {
707 client = c;
708 uuid = n;
709 }
666 } 710 }
711
667} \ No newline at end of file 712} \ No newline at end of file