diff options
author | UbitUmarov | 2015-11-27 14:39:11 +0000 |
---|---|---|
committer | UbitUmarov | 2015-11-27 14:39:11 +0000 |
commit | f1bbc4d38663435cde3ca1461d675ff0bdff77e4 (patch) | |
tree | e0d2294d438506d6a37abf8e3fd68a9ca2f1d742 /OpenSim/Region/CoreModules/Framework/UserManagement | |
parent | DeregisterRegion from grid earlier on close (diff) | |
download | opensim-SC-f1bbc4d38663435cde3ca1461d675ff0bdff77e4.zip opensim-SC-f1bbc4d38663435cde3ca1461d675ff0bdff77e4.tar.gz opensim-SC-f1bbc4d38663435cde3ca1461d675ff0bdff77e4.tar.bz2 opensim-SC-f1bbc4d38663435cde3ca1461d675ff0bdff77e4.tar.xz |
stop some requests processing when module as no scenes (there must be a better way to fix this)
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/UserManagement')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 7d0c47f..e1764bf 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -182,6 +182,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
182 | // m_log.DebugFormat( | 182 | // m_log.DebugFormat( |
183 | // "[USER MANAGEMENT MODULE]: Handling request for name binding of UUID {0} from {1}", | 183 | // "[USER MANAGEMENT MODULE]: Handling request for name binding of UUID {0} from {1}", |
184 | // uuid, remote_client.Name); | 184 | // uuid, remote_client.Name); |
185 | if(m_Scenes.Count <= 0) | ||
186 | return; | ||
185 | 187 | ||
186 | if (m_Scenes[0].LibraryService != null && (m_Scenes[0].LibraryService.LibraryRootFolder.Owner == uuid)) | 188 | if (m_Scenes[0].LibraryService != null && (m_Scenes[0].LibraryService.LibraryRootFolder.Owner == uuid)) |
187 | { | 189 | { |
@@ -288,6 +290,9 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
288 | 290 | ||
289 | public List<UserData> GetUserData(string query, int page_size, int page_number) | 291 | public List<UserData> GetUserData(string query, int page_size, int page_number) |
290 | { | 292 | { |
293 | if(m_Scenes.Count <= 0) | ||
294 | return new List<UserData>();; | ||
295 | |||
291 | // search the user accounts service | 296 | // search the user accounts service |
292 | List<UserAccount> accs = m_Scenes[0].UserAccountService.GetUserAccounts(m_Scenes[0].RegionInfo.ScopeID, query); | 297 | List<UserAccount> accs = m_Scenes[0].UserAccountService.GetUserAccounts(m_Scenes[0].RegionInfo.ScopeID, query); |
293 | 298 | ||
@@ -380,6 +385,9 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
380 | /// <param name='names'>The array of names if found. If not found, then names[0] = "Unknown" and names[1] = "User"</param> | 385 | /// <param name='names'>The array of names if found. If not found, then names[0] = "Unknown" and names[1] = "User"</param> |
381 | private bool TryGetUserNamesFromServices(UUID uuid, string[] names) | 386 | private bool TryGetUserNamesFromServices(UUID uuid, string[] names) |
382 | { | 387 | { |
388 | if(m_Scenes.Count <= 0) | ||
389 | return false; | ||
390 | |||
383 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(UUID.Zero, uuid); | 391 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(UUID.Zero, uuid); |
384 | 392 | ||
385 | if (account != null) | 393 | if (account != null) |
@@ -445,6 +453,9 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
445 | 453 | ||
446 | public UUID GetUserIdByName(string firstName, string lastName) | 454 | public UUID GetUserIdByName(string firstName, string lastName) |
447 | { | 455 | { |
456 | if(m_Scenes.Count <= 0) | ||
457 | return UUID.Zero; | ||
458 | |||
448 | // TODO: Optimize for reverse lookup if this gets used by non-console commands. | 459 | // TODO: Optimize for reverse lookup if this gets used by non-console commands. |
449 | lock (m_UserCache) | 460 | lock (m_UserCache) |
450 | { | 461 | { |
@@ -555,6 +566,12 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
555 | #region Cache Management | 566 | #region Cache Management |
556 | public bool GetUser(UUID uuid, out UserData userdata) | 567 | public bool GetUser(UUID uuid, out UserData userdata) |
557 | { | 568 | { |
569 | if(m_Scenes.Count <= 0) | ||
570 | { | ||
571 | userdata = new UserData(); | ||
572 | return false; | ||
573 | } | ||
574 | |||
558 | lock (m_UserCache) | 575 | lock (m_UserCache) |
559 | { | 576 | { |
560 | if (m_UserCache.TryGetValue(uuid, out userdata)) | 577 | if (m_UserCache.TryGetValue(uuid, out userdata)) |