diff options
author | Diva Canto | 2010-01-10 10:40:07 -0800 |
---|---|---|
committer | Diva Canto | 2010-01-10 10:40:07 -0800 |
commit | 1e1b2ab221851efc414678b7ea52ef2ca788ce9f (patch) | |
tree | 29b6aa80e54a9c18529ae14e7d185fe67582d151 /OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory | |
parent | Add a "LockedOut" flag to allow locking a region out via the grid server. (diff) | |
download | opensim-SC_OLD-1e1b2ab221851efc414678b7ea52ef2ca788ce9f.zip opensim-SC_OLD-1e1b2ab221851efc414678b7ea52ef2ca788ce9f.tar.gz opensim-SC_OLD-1e1b2ab221851efc414678b7ea52ef2ca788ce9f.tar.bz2 opensim-SC_OLD-1e1b2ab221851efc414678b7ea52ef2ca788ce9f.tar.xz |
* OMG! All but one references to UserProfileCacheService have been rerouted!
* HG is seriously broken here
* Compiles. Untested.
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory')
3 files changed, 47 insertions, 59 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 7584dd8..5ed2b7a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
50 | private bool m_Enabled = false; | 50 | private bool m_Enabled = false; |
51 | private bool m_Initialized = false; | 51 | private bool m_Initialized = false; |
52 | private Scene m_Scene; | 52 | private Scene m_Scene; |
53 | private UserProfileCacheService m_UserProfileService; // This should change to IUserProfileService | 53 | private IUserAccountService m_UserAccountService; // This should change to IUserProfileService |
54 | 54 | ||
55 | private IInventoryService m_GridService; | 55 | private IInventoryService m_GridService; |
56 | private ISessionAuthInventoryService m_HGService; | 56 | private ISessionAuthInventoryService m_HGService; |
@@ -157,10 +157,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
157 | if (!m_Initialized) | 157 | if (!m_Initialized) |
158 | { | 158 | { |
159 | m_Scene = scene; | 159 | m_Scene = scene; |
160 | // HACK for now. Ugh! | 160 | m_UserAccountService = m_Scene.UserAccountService; |
161 | m_UserProfileService = m_Scene.CommsManager.UserProfileCacheService; | ||
162 | // ugh! | ||
163 | m_UserProfileService.SetInventoryService(this); | ||
164 | 161 | ||
165 | m_Initialized = true; | 162 | m_Initialized = true; |
166 | } | 163 | } |
@@ -514,58 +511,66 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
514 | 511 | ||
515 | private UUID GetSessionID(UUID userID) | 512 | private UUID GetSessionID(UUID userID) |
516 | { | 513 | { |
517 | CachedUserInfo uinfo = m_UserProfileService.GetUserDetails(userID); | 514 | ScenePresence sp = null; |
518 | if (uinfo != null) | 515 | if (m_Scene.TryGetAvatar(userID, out sp)) |
519 | return uinfo.SessionID; | 516 | { |
517 | return sp.ControllingClient.SessionId; | ||
518 | } | ||
520 | 519 | ||
521 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: user profile for {0} not found", userID); | 520 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: scene presence for {0} not found", userID); |
522 | return UUID.Zero; | 521 | return UUID.Zero; |
523 | } | 522 | } |
524 | 523 | ||
525 | private bool IsLocalGridUser(UUID userID) | 524 | private bool IsLocalGridUser(UUID userID) |
526 | { | 525 | { |
527 | if (m_UserProfileService == null) | 526 | return true; |
528 | { | ||
529 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: IsLocalGridUser, no profile service. Returning false."); | ||
530 | return false; | ||
531 | } | ||
532 | 527 | ||
533 | CachedUserInfo uinfo = m_UserProfileService.GetUserDetails(userID); | 528 | // REFACTORING PROBLEM. This needs to be rewritten |
534 | if (uinfo == null) | ||
535 | { | ||
536 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: IsLocalGridUser, no profile for user {0}. Returning true.", userID); | ||
537 | return true; | ||
538 | } | ||
539 | 529 | ||
540 | if ((uinfo.UserProfile.UserInventoryURI == null) || (uinfo.UserProfile.UserInventoryURI == "")) | 530 | //if (m_UserAccountService == null) |
541 | // this happens in standalone profiles, apparently | 531 | //{ |
542 | return true; | 532 | // m_log.DebugFormat("[HG INVENTORY CONNECTOR]: IsLocalGridUser, no user account service. Returning false."); |
533 | // return false; | ||
534 | //} | ||
535 | |||
536 | //UserAccount uinfo = m_UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, userID); | ||
537 | //if (uinfo == null) | ||
538 | //{ | ||
539 | // m_log.DebugFormat("[HG INVENTORY CONNECTOR]: IsLocalGridUser, no account for user {0}. Returning false.", userID); | ||
540 | // return false; | ||
541 | //} | ||
542 | |||
543 | //if ((uinfo.UserProfile.UserInventoryURI == null) || (uinfo.UserProfile.UserInventoryURI == "")) | ||
544 | // // this happens in standalone profiles, apparently | ||
545 | // return true; | ||
543 | 546 | ||
544 | string userInventoryServerURI = Util.ServerURI(uinfo.UserProfile.UserInventoryURI); | 547 | //string userInventoryServerURI = Util.ServerURI(uinfo.UserProfile.UserInventoryURI); |
545 | 548 | ||
546 | string uri = LocalGridInventory.TrimEnd('/'); | 549 | //string uri = LocalGridInventory.TrimEnd('/'); |
547 | 550 | ||
548 | if ((userInventoryServerURI == uri) || (userInventoryServerURI == "")) | 551 | //if ((userInventoryServerURI == uri) || (userInventoryServerURI == "")) |
549 | { | 552 | //{ |
550 | return true; | 553 | // return true; |
551 | } | 554 | //} |
552 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: user {0} is foreign({1} - {2})", userID, userInventoryServerURI, uri); | 555 | //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: user {0} is foreign({1} - {2})", userID, userInventoryServerURI, uri); |
553 | return false; | 556 | //return false; |
554 | } | 557 | } |
555 | 558 | ||
556 | private string GetUserInventoryURI(UUID userID) | 559 | private string GetUserInventoryURI(UUID userID) |
557 | { | 560 | { |
558 | string invURI = LocalGridInventory; | 561 | string invURI = LocalGridInventory; |
562 | // REFACTORING PROBLEM!!! This needs to be rewritten | ||
563 | |||
564 | //CachedUserInfo uinfo = m_UserAccountService.GetUserDetails(userID); | ||
565 | //if ((uinfo == null) || (uinfo.UserProfile == null)) | ||
566 | // return invURI; | ||
559 | 567 | ||
560 | CachedUserInfo uinfo = m_UserProfileService.GetUserDetails(userID); | 568 | //string userInventoryServerURI = Util.ServerURI(uinfo.UserProfile.UserInventoryURI); |
561 | if ((uinfo == null) || (uinfo.UserProfile == null)) | ||
562 | return invURI; | ||
563 | 569 | ||
564 | string userInventoryServerURI = Util.ServerURI(uinfo.UserProfile.UserInventoryURI); | 570 | //if ((userInventoryServerURI != null) && |
571 | // (userInventoryServerURI != "")) | ||
572 | // invURI = userInventoryServerURI; | ||
565 | 573 | ||
566 | if ((userInventoryServerURI != null) && | ||
567 | (userInventoryServerURI != "")) | ||
568 | invURI = userInventoryServerURI; | ||
569 | return invURI; | 574 | return invURI; |
570 | } | 575 | } |
571 | 576 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index f2e344f..9d6da4f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -131,8 +131,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
131 | 131 | ||
132 | if (!m_Initialized) | 132 | if (!m_Initialized) |
133 | { | 133 | { |
134 | // ugh! | ||
135 | scene.CommsManager.UserProfileCacheService.SetInventoryService(this); | ||
136 | m_Initialized = true; | 134 | m_Initialized = true; |
137 | } | 135 | } |
138 | 136 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index 3580c27..575a190 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |||
@@ -49,7 +49,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
49 | private bool m_Enabled = false; | 49 | private bool m_Enabled = false; |
50 | private bool m_Initialized = false; | 50 | private bool m_Initialized = false; |
51 | private Scene m_Scene; | 51 | private Scene m_Scene; |
52 | private UserProfileCacheService m_UserProfileService; | ||
53 | private InventoryServicesConnector m_RemoteConnector; | 52 | private InventoryServicesConnector m_RemoteConnector; |
54 | 53 | ||
55 | public Type ReplaceableInterface | 54 | public Type ReplaceableInterface |
@@ -114,8 +113,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
114 | 113 | ||
115 | if (!m_Initialized) | 114 | if (!m_Initialized) |
116 | { | 115 | { |
117 | // ugh! | ||
118 | scene.CommsManager.UserProfileCacheService.SetInventoryService(this); | ||
119 | m_Initialized = true; | 116 | m_Initialized = true; |
120 | } | 117 | } |
121 | 118 | ||
@@ -133,10 +130,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
133 | 130 | ||
134 | public void RegionLoaded(Scene scene) | 131 | public void RegionLoaded(Scene scene) |
135 | { | 132 | { |
136 | m_UserProfileService = m_Scene.CommsManager.UserProfileCacheService; | ||
137 | if (m_UserProfileService != null) | ||
138 | m_log.Debug("[XXXX] Set m_UserProfileService in " + m_Scene.RegionInfo.RegionName); | ||
139 | |||
140 | if (!m_Enabled) | 133 | if (!m_Enabled) |
141 | return; | 134 | return; |
142 | 135 | ||
@@ -344,21 +337,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
344 | 337 | ||
345 | private UUID GetSessionID(UUID userID) | 338 | private UUID GetSessionID(UUID userID) |
346 | { | 339 | { |
347 | //if (m_Scene == null) | 340 | ScenePresence sp = null; |
348 | //{ | 341 | if (m_Scene.TryGetAvatar(userID, out sp)) |
349 | // m_log.Debug("[INVENTORY CONNECTOR]: OOPS! scene is null"); | ||
350 | //} | ||
351 | |||
352 | if (m_UserProfileService == null) | ||
353 | { | 342 | { |
354 | //m_log.Debug("[INVENTORY CONNECTOR]: OOPS! UserProfileCacheService is null"); | 343 | return sp.ControllingClient.SessionId; |
355 | return UUID.Zero; | ||
356 | } | 344 | } |
357 | 345 | ||
358 | CachedUserInfo uinfo = m_UserProfileService.GetUserDetails(userID); | 346 | m_log.DebugFormat("[INVENTORY CONNECTOR]: scene presence for {0} not found", userID); |
359 | if (uinfo != null) | ||
360 | return uinfo.SessionID; | ||
361 | m_log.DebugFormat("[INVENTORY CONNECTOR]: user profile for {0} not found", userID); | ||
362 | return UUID.Zero; | 347 | return UUID.Zero; |
363 | 348 | ||
364 | } | 349 | } |