diff options
author | Justin Clark-Casey (justincc) | 2013-07-08 22:07:27 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-07-08 22:07:27 +0100 |
commit | c3db5959441dbd1e04cdd32e92bda9eb5bf2853b (patch) | |
tree | a7b262be4f9f0dc0c7c5464ce5d657351c53a63e /OpenSim/Region/CoreModules | |
parent | Add "show caps stats by user" and "show caps stats by cap" console commands t... (diff) | |
parent | Placed a throttle on UserManagementModule for name lookups. Singularity appar... (diff) | |
download | opensim-SC-c3db5959441dbd1e04cdd32e92bda9eb5bf2853b.zip opensim-SC-c3db5959441dbd1e04cdd32e92bda9eb5bf2853b.tar.gz opensim-SC-c3db5959441dbd1e04cdd32e92bda9eb5bf2853b.tar.bz2 opensim-SC-c3db5959441dbd1e04cdd32e92bda9eb5bf2853b.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules')
8 files changed, 102 insertions, 52 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 98285e9..31c42d8 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -67,10 +67,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
67 | /// </summary> | 67 | /// </summary> |
68 | protected bool m_merge; | 68 | protected bool m_merge; |
69 | 69 | ||
70 | /// <value> | 70 | protected IInventoryService m_InventoryService; |
71 | /// We only use this to request modules | 71 | protected IAssetService m_AssetService; |
72 | /// </value> | 72 | protected IUserAccountService m_UserAccountService; |
73 | protected Scene m_scene; | ||
74 | 73 | ||
75 | /// <value> | 74 | /// <value> |
76 | /// The stream from which the inventory archive will be loaded. | 75 | /// The stream from which the inventory archive will be loaded. |
@@ -118,9 +117,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
118 | protected Dictionary<UUID, UUID> m_creatorIdForAssetId = new Dictionary<UUID, UUID>(); | 117 | protected Dictionary<UUID, UUID> m_creatorIdForAssetId = new Dictionary<UUID, UUID>(); |
119 | 118 | ||
120 | public InventoryArchiveReadRequest( | 119 | public InventoryArchiveReadRequest( |
121 | Scene scene, UserAccount userInfo, string invPath, string loadPath, bool merge) | 120 | IInventoryService inv, IAssetService assets, IUserAccountService uacc, UserAccount userInfo, string invPath, string loadPath, bool merge) |
122 | : this( | 121 | : this( |
123 | scene, | 122 | inv, |
123 | assets, | ||
124 | uacc, | ||
124 | userInfo, | 125 | userInfo, |
125 | invPath, | 126 | invPath, |
126 | new GZipStream(ArchiveHelpers.GetStream(loadPath), CompressionMode.Decompress), | 127 | new GZipStream(ArchiveHelpers.GetStream(loadPath), CompressionMode.Decompress), |
@@ -129,9 +130,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
129 | } | 130 | } |
130 | 131 | ||
131 | public InventoryArchiveReadRequest( | 132 | public InventoryArchiveReadRequest( |
132 | Scene scene, UserAccount userInfo, string invPath, Stream loadStream, bool merge) | 133 | IInventoryService inv, IAssetService assets, IUserAccountService uacc, UserAccount userInfo, string invPath, Stream loadStream, bool merge) |
133 | { | 134 | { |
134 | m_scene = scene; | 135 | m_InventoryService = inv; |
136 | m_AssetService = assets; | ||
137 | m_UserAccountService = uacc; | ||
135 | m_merge = merge; | 138 | m_merge = merge; |
136 | m_userInfo = userInfo; | 139 | m_userInfo = userInfo; |
137 | m_invPath = invPath; | 140 | m_invPath = invPath; |
@@ -162,7 +165,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
162 | 165 | ||
163 | List<InventoryFolderBase> folderCandidates | 166 | List<InventoryFolderBase> folderCandidates |
164 | = InventoryArchiveUtils.FindFoldersByPath( | 167 | = InventoryArchiveUtils.FindFoldersByPath( |
165 | m_scene.InventoryService, m_userInfo.PrincipalID, m_invPath); | 168 | m_InventoryService, m_userInfo.PrincipalID, m_invPath); |
166 | 169 | ||
167 | if (folderCandidates.Count == 0) | 170 | if (folderCandidates.Count == 0) |
168 | { | 171 | { |
@@ -297,7 +300,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
297 | string plainPath = ArchiveConstants.ExtractPlainPathFromIarPath(archivePath); | 300 | string plainPath = ArchiveConstants.ExtractPlainPathFromIarPath(archivePath); |
298 | List<InventoryFolderBase> folderCandidates | 301 | List<InventoryFolderBase> folderCandidates |
299 | = InventoryArchiveUtils.FindFoldersByPath( | 302 | = InventoryArchiveUtils.FindFoldersByPath( |
300 | m_scene.InventoryService, m_userInfo.PrincipalID, plainPath); | 303 | m_InventoryService, m_userInfo.PrincipalID, plainPath); |
301 | 304 | ||
302 | if (folderCandidates.Count != 0) | 305 | if (folderCandidates.Count != 0) |
303 | { | 306 | { |
@@ -380,7 +383,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
380 | = new InventoryFolderBase( | 383 | = new InventoryFolderBase( |
381 | newFolderId, newFolderName, m_userInfo.PrincipalID, | 384 | newFolderId, newFolderName, m_userInfo.PrincipalID, |
382 | (short)AssetType.Unknown, destFolder.ID, 1); | 385 | (short)AssetType.Unknown, destFolder.ID, 1); |
383 | m_scene.InventoryService.AddFolder(destFolder); | 386 | m_InventoryService.AddFolder(destFolder); |
384 | 387 | ||
385 | // Record that we have now created this folder | 388 | // Record that we have now created this folder |
386 | iarPathExisting += rawDirsToCreate[i] + "/"; | 389 | iarPathExisting += rawDirsToCreate[i] + "/"; |
@@ -406,7 +409,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
406 | // Don't use the item ID that's in the file | 409 | // Don't use the item ID that's in the file |
407 | item.ID = UUID.Random(); | 410 | item.ID = UUID.Random(); |
408 | 411 | ||
409 | UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_scene.UserAccountService); | 412 | UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_UserAccountService); |
410 | if (UUID.Zero != ospResolvedId) // The user exists in this grid | 413 | if (UUID.Zero != ospResolvedId) // The user exists in this grid |
411 | { | 414 | { |
412 | // m_log.DebugFormat("[INVENTORY ARCHIVER]: Found creator {0} via OSPA resolution", ospResolvedId); | 415 | // m_log.DebugFormat("[INVENTORY ARCHIVER]: Found creator {0} via OSPA resolution", ospResolvedId); |
@@ -436,7 +439,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
436 | // relying on native tar tools. | 439 | // relying on native tar tools. |
437 | m_creatorIdForAssetId[item.AssetID] = item.CreatorIdAsUuid; | 440 | m_creatorIdForAssetId[item.AssetID] = item.CreatorIdAsUuid; |
438 | 441 | ||
439 | m_scene.AddInventoryItem(item); | 442 | if (!m_InventoryService.AddItem(item)) |
443 | m_log.WarnFormat("[INVENTORY ARCHIVER]: Unable to save item {0} in folder {1}", item.Name, item.Folder); | ||
440 | 444 | ||
441 | return item; | 445 | return item; |
442 | } | 446 | } |
@@ -533,7 +537,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
533 | AssetBase asset = new AssetBase(assetId, "From IAR", assetType, UUID.Zero.ToString()); | 537 | AssetBase asset = new AssetBase(assetId, "From IAR", assetType, UUID.Zero.ToString()); |
534 | asset.Data = data; | 538 | asset.Data = data; |
535 | 539 | ||
536 | m_scene.AssetService.Store(asset); | 540 | m_AssetService.Store(asset); |
537 | 541 | ||
538 | return true; | 542 | return true; |
539 | } | 543 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index 849449b..797097f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | |||
@@ -294,7 +294,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
294 | 294 | ||
295 | try | 295 | try |
296 | { | 296 | { |
297 | request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream, merge); | 297 | request = new InventoryArchiveReadRequest(m_aScene.InventoryService, m_aScene.AssetService, m_aScene.UserAccountService, userInfo, invPath, loadStream, merge); |
298 | } | 298 | } |
299 | catch (EntryPointNotFoundException e) | 299 | catch (EntryPointNotFoundException e) |
300 | { | 300 | { |
@@ -342,7 +342,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
342 | 342 | ||
343 | try | 343 | try |
344 | { | 344 | { |
345 | request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath, merge); | 345 | request = new InventoryArchiveReadRequest(m_aScene.InventoryService, m_aScene.AssetService, m_aScene.UserAccountService, userInfo, invPath, loadPath, merge); |
346 | } | 346 | } |
347 | catch (EntryPointNotFoundException e) | 347 | catch (EntryPointNotFoundException e) |
348 | { | 348 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs index 95f562e..08f199a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs | |||
@@ -229,7 +229,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
229 | 229 | ||
230 | { | 230 | { |
231 | // Test replication of path1 | 231 | // Test replication of path1 |
232 | new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null, false) | 232 | new InventoryArchiveReadRequest(scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) |
233 | .ReplicateArchivePathToUserInventory( | 233 | .ReplicateArchivePathToUserInventory( |
234 | iarPath1, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 234 | iarPath1, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
235 | foldersCreated, nodesLoaded); | 235 | foldersCreated, nodesLoaded); |
@@ -246,7 +246,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
246 | 246 | ||
247 | { | 247 | { |
248 | // Test replication of path2 | 248 | // Test replication of path2 |
249 | new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null, false) | 249 | new InventoryArchiveReadRequest(scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) |
250 | .ReplicateArchivePathToUserInventory( | 250 | .ReplicateArchivePathToUserInventory( |
251 | iarPath2, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 251 | iarPath2, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
252 | foldersCreated, nodesLoaded); | 252 | foldersCreated, nodesLoaded); |
@@ -291,8 +291,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
291 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); | 291 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); |
292 | 292 | ||
293 | string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); | 293 | string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); |
294 | 294 | ||
295 | new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null, false) | 295 | new InventoryArchiveReadRequest(scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) |
296 | .ReplicateArchivePathToUserInventory( | 296 | .ReplicateArchivePathToUserInventory( |
297 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 297 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
298 | new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>()); | 298 | new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>()); |
@@ -342,8 +342,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
342 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); | 342 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); |
343 | 343 | ||
344 | string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); | 344 | string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); |
345 | 345 | ||
346 | new InventoryArchiveReadRequest(scene, ua1, folder1ExistingName, (Stream)null, true) | 346 | new InventoryArchiveReadRequest(scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, folder1ExistingName, (Stream)null, true) |
347 | .ReplicateArchivePathToUserInventory( | 347 | .ReplicateArchivePathToUserInventory( |
348 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 348 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
349 | new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>()); | 349 | new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>()); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs index 5e7e24c..b85739e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs | |||
@@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
86 | Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH)); | 86 | Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH)); |
87 | 87 | ||
88 | InventoryArchiveReadRequest iarr | 88 | InventoryArchiveReadRequest iarr |
89 | = new InventoryArchiveReadRequest(null, null, null, (Stream)null, false); | 89 | = new InventoryArchiveReadRequest(null, null, null, null, null, (Stream)null, false); |
90 | iarr.LoadControlFile(filePath, data); | 90 | iarr.LoadControlFile(filePath, data); |
91 | 91 | ||
92 | Assert.That(iarr.ControlFileLoaded, Is.True); | 92 | Assert.That(iarr.ControlFileLoaded, Is.True); |
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; | |||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.IO; | 29 | using System.IO; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Threading; | ||
31 | 32 | ||
32 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
33 | using OpenSim.Framework.Console; | 34 | using OpenSim.Framework.Console; |
35 | using OpenSim.Framework.Monitoring; | ||
34 | using OpenSim.Region.ClientStack.LindenUDP; | 36 | using OpenSim.Region.ClientStack.LindenUDP; |
35 | using OpenSim.Region.Framework; | 37 | using OpenSim.Region.Framework; |
36 | using OpenSim.Region.Framework.Interfaces; | 38 | using 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 |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index 70ba944..7f78076 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs | |||
@@ -195,19 +195,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
195 | { | 195 | { |
196 | InventoryCollection invCol = m_RemoteConnector.GetFolderContent(userID, folderID); | 196 | InventoryCollection invCol = m_RemoteConnector.GetFolderContent(userID, folderID); |
197 | 197 | ||
198 | if (invCol != null && UserManager != null) | 198 | // Commenting this for now, because it's causing more grief than good |
199 | { | 199 | //if (invCol != null && UserManager != null) |
200 | // Protect ourselves against the caller subsequently modifying the items list | 200 | //{ |
201 | List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items); | 201 | // // Protect ourselves against the caller subsequently modifying the items list |
202 | 202 | // List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items); | |
203 | if (items != null && items.Count > 0) | 203 | |
204 | Util.FireAndForget(delegate | 204 | // if (items != null && items.Count > 0) |
205 | { | 205 | // //Util.FireAndForget(delegate |
206 | foreach (InventoryItemBase item in items) | 206 | // //{ |
207 | if (!string.IsNullOrEmpty(item.CreatorData)) | 207 | // foreach (InventoryItemBase item in items) |
208 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | 208 | // if (!string.IsNullOrEmpty(item.CreatorData)) |
209 | }); | 209 | // UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); |
210 | } | 210 | // //}); |
211 | //} | ||
211 | 212 | ||
212 | return invCol; | 213 | return invCol; |
213 | } | 214 | } |