diff options
Diffstat (limited to '')
5 files changed, 160 insertions, 159 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index 0aa753d..044764b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | |||
@@ -366,18 +366,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
366 | 366 | ||
367 | public string GetUserAssetServer(UUID userID) | 367 | public string GetUserAssetServer(UUID userID) |
368 | { | 368 | { |
369 | CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(userID); | 369 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, userID); |
370 | if ((uinfo != null) && (uinfo.UserProfile != null)) | 370 | |
371 | { | 371 | if (account != null && account.ServiceURLs.ContainsKey("AssetServerURI") && account.ServiceURLs["AssetServerURI"] != null) |
372 | if ((uinfo.UserProfile.UserAssetURI == string.Empty) || (uinfo.UserProfile.UserAssetURI == "")) | 372 | return account.ServiceURLs["AssetServerURI"].ToString(); |
373 | return m_LocalAssetServiceURI; | 373 | |
374 | return uinfo.UserProfile.UserAssetURI.Trim('/'); | 374 | return string.Empty; |
375 | } | ||
376 | else | ||
377 | { | ||
378 | // we don't know anyting about this user | ||
379 | return string.Empty; | ||
380 | } | ||
381 | } | 375 | } |
382 | 376 | ||
383 | public string GetSimAssetServer() | 377 | public string GetSimAssetServer() |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs index 501f730..3c1f7b6 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs | |||
@@ -38,6 +38,7 @@ using OpenSim.Region.Framework.Scenes; | |||
38 | using OpenSim.Region.Framework.Scenes.Hypergrid; | 38 | using OpenSim.Region.Framework.Scenes.Hypergrid; |
39 | using OpenSim.Services.Interfaces; | 39 | using OpenSim.Services.Interfaces; |
40 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 40 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
41 | using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; | ||
41 | using OpenSim.Server.Base; | 42 | using OpenSim.Server.Base; |
42 | using OpenSim.Services.Connectors.Grid; | 43 | using OpenSim.Services.Connectors.Grid; |
43 | using OpenSim.Framework.Console; | 44 | using OpenSim.Framework.Console; |
@@ -603,93 +604,105 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
603 | 604 | ||
604 | public bool SendUserInformation(GridRegion regInfo, AgentCircuitData agentData) | 605 | public bool SendUserInformation(GridRegion regInfo, AgentCircuitData agentData) |
605 | { | 606 | { |
606 | CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(agentData.AgentID); | 607 | // REFACTORING PROBLEM. This needs to change. Some of this info should go with the agent circuit data. |
607 | 608 | ||
608 | if (uinfo == null) | 609 | //UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, agentData.AgentID); |
609 | return false; | 610 | //if (account == null) |
610 | 611 | // return false; | |
611 | if ((IsLocalUser(uinfo) && (GetHyperlinkRegion(regInfo.RegionHandle) != null)) || | ||
612 | (!IsLocalUser(uinfo) && !IsGoingHome(uinfo, regInfo))) | ||
613 | { | ||
614 | m_log.Info("[HGrid]: Local user is going to foreign region or foreign user is going elsewhere"); | ||
615 | |||
616 | // Set the position of the region on the remote grid | ||
617 | // ulong realHandle = FindRegionHandle(regInfo.RegionHandle); | ||
618 | uint x = 0, y = 0; | ||
619 | Utils.LongToUInts(regInfo.RegionHandle, out x, out y); | ||
620 | GridRegion clonedRegion = new GridRegion(regInfo); | ||
621 | clonedRegion.RegionLocX = (int)x; | ||
622 | clonedRegion.RegionLocY = (int)y; | ||
623 | |||
624 | // Get the user's home region information and adapt the region handle | ||
625 | GridRegion home = GetRegionByUUID(m_aScene.RegionInfo.ScopeID, uinfo.UserProfile.HomeRegionID); | ||
626 | if (m_HyperlinkHandles.ContainsKey(uinfo.UserProfile.HomeRegionID)) | ||
627 | { | ||
628 | ulong realHandle = m_HyperlinkHandles[uinfo.UserProfile.HomeRegionID]; | ||
629 | Utils.LongToUInts(realHandle, out x, out y); | ||
630 | m_log.DebugFormat("[HGrid]: Foreign user is going elsewhere. Adjusting home handle from {0}-{1} to {2}-{3}", home.RegionLocX, home.RegionLocY, x, y); | ||
631 | home.RegionLocX = (int)x; | ||
632 | home.RegionLocY = (int)y; | ||
633 | } | ||
634 | 612 | ||
635 | // Get the user's service URLs | 613 | //if ((IsLocalUser(account) && (GetHyperlinkRegion(regInfo.RegionHandle) != null)) || |
636 | string serverURI = ""; | 614 | // (!IsLocalUser(account) && !IsGoingHome(uinfo, regInfo))) |
637 | if (uinfo.UserProfile is ForeignUserProfileData) | ||
638 | serverURI = Util.ServerURI(((ForeignUserProfileData)uinfo.UserProfile).UserServerURI); | ||
639 | string userServer = (serverURI == "") || (serverURI == null) ? LocalUserServerURI : serverURI; | ||
640 | |||
641 | string assetServer = Util.ServerURI(uinfo.UserProfile.UserAssetURI); | ||
642 | if ((assetServer == null) || (assetServer == "")) | ||
643 | assetServer = LocalAssetServerURI; | ||
644 | |||
645 | string inventoryServer = Util.ServerURI(uinfo.UserProfile.UserInventoryURI); | ||
646 | if ((inventoryServer == null) || (inventoryServer == "")) | ||
647 | inventoryServer = LocalInventoryServerURI; | ||
648 | |||
649 | if (!m_HypergridServiceConnector.InformRegionOfUser(clonedRegion, agentData, home, userServer, assetServer, inventoryServer)) | ||
650 | { | ||
651 | m_log.Warn("[HGrid]: Could not inform remote region of transferring user."); | ||
652 | return false; | ||
653 | } | ||
654 | } | ||
655 | //if ((uinfo == null) || !IsGoingHome(uinfo, regInfo)) | ||
656 | //{ | 615 | //{ |
657 | // m_log.Info("[HGrid]: User seems to be going to foreign region."); | 616 | // m_log.Info("[HGrid]: Local user is going to foreign region or foreign user is going elsewhere"); |
658 | // if (!InformRegionOfUser(regInfo, agentData)) | 617 | |
618 | // PresenceInfo pinfo = m_aScene.PresenceService.GetAgent(agentData.SessionID); | ||
619 | // if (pinfo != null) | ||
620 | // { | ||
621 | // // Set the position of the region on the remote grid | ||
622 | // // ulong realHandle = FindRegionHandle(regInfo.RegionHandle); | ||
623 | // uint x = 0, y = 0; | ||
624 | // Utils.LongToUInts(regInfo.RegionHandle, out x, out y); | ||
625 | // GridRegion clonedRegion = new GridRegion(regInfo); | ||
626 | // clonedRegion.RegionLocX = (int)x; | ||
627 | // clonedRegion.RegionLocY = (int)y; | ||
628 | |||
629 | // // Get the user's home region information and adapt the region handle | ||
630 | // GridRegion home = GetRegionByUUID(m_aScene.RegionInfo.ScopeID, pinfo.HomeRegionID); | ||
631 | // if (m_HyperlinkHandles.ContainsKey(pinfo.HomeRegionID)) | ||
632 | // { | ||
633 | // ulong realHandle = m_HyperlinkHandles[pinfo.HomeRegionID]; | ||
634 | // Utils.LongToUInts(realHandle, out x, out y); | ||
635 | // m_log.DebugFormat("[HGrid]: Foreign user is going elsewhere. Adjusting home handle from {0}-{1} to {2}-{3}", home.RegionLocX, home.RegionLocY, x, y); | ||
636 | // home.RegionLocX = (int)x; | ||
637 | // home.RegionLocY = (int)y; | ||
638 | // } | ||
639 | |||
640 | // // Get the user's service URLs | ||
641 | // string serverURI = ""; | ||
642 | // if (uinfo.UserProfile is ForeignUserProfileData) | ||
643 | // serverURI = Util.ServerURI(((ForeignUserProfileData)uinfo.UserProfile).UserServerURI); | ||
644 | // string userServer = (serverURI == "") || (serverURI == null) ? LocalUserServerURI : serverURI; | ||
645 | |||
646 | // string assetServer = Util.ServerURI(uinfo.UserProfile.UserAssetURI); | ||
647 | // if ((assetServer == null) || (assetServer == "")) | ||
648 | // assetServer = LocalAssetServerURI; | ||
649 | |||
650 | // string inventoryServer = Util.ServerURI(uinfo.UserProfile.UserInventoryURI); | ||
651 | // if ((inventoryServer == null) || (inventoryServer == "")) | ||
652 | // inventoryServer = LocalInventoryServerURI; | ||
653 | |||
654 | // if (!m_HypergridServiceConnector.InformRegionOfUser(clonedRegion, agentData, home, userServer, assetServer, inventoryServer)) | ||
655 | // { | ||
656 | // m_log.Warn("[HGrid]: Could not inform remote region of transferring user."); | ||
657 | // return false; | ||
658 | // } | ||
659 | // } | ||
660 | // else | ||
659 | // { | 661 | // { |
660 | // m_log.Warn("[HGrid]: Could not inform remote region of transferring user."); | 662 | // m_log.Warn("[HGrid]: Unable to find local presence of transferring user."); |
661 | // return false; | 663 | // return false; |
662 | // } | 664 | // } |
663 | //} | 665 | //} |
664 | //else | 666 | ////if ((uinfo == null) || !IsGoingHome(uinfo, regInfo)) |
665 | // m_log.Info("[HGrid]: User seems to be going home " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName); | 667 | ////{ |
666 | 668 | //// m_log.Info("[HGrid]: User seems to be going to foreign region."); | |
667 | // May need to change agent's name | 669 | //// if (!InformRegionOfUser(regInfo, agentData)) |
668 | if (IsLocalUser(uinfo) && (GetHyperlinkRegion(regInfo.RegionHandle) != null)) | 670 | //// { |
669 | { | 671 | //// m_log.Warn("[HGrid]: Could not inform remote region of transferring user."); |
670 | agentData.firstname = agentData.firstname + "." + agentData.lastname; | 672 | //// return false; |
671 | agentData.lastname = "@" + LocalUserServerURI.Replace("http://", ""); ; //HGNetworkServersInfo.Singleton.LocalUserServerURI; | 673 | //// } |
672 | } | 674 | ////} |
675 | ////else | ||
676 | //// m_log.Info("[HGrid]: User seems to be going home " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName); | ||
677 | |||
678 | //// May need to change agent's name | ||
679 | //if (IsLocalUser(uinfo) && (GetHyperlinkRegion(regInfo.RegionHandle) != null)) | ||
680 | //{ | ||
681 | // agentData.firstname = agentData.firstname + "." + agentData.lastname; | ||
682 | // agentData.lastname = "@" + LocalUserServerURI.Replace("http://", ""); ; //HGNetworkServersInfo.Singleton.LocalUserServerURI; | ||
683 | //} | ||
673 | 684 | ||
674 | return true; | 685 | return true; |
675 | } | 686 | } |
676 | 687 | ||
677 | public void AdjustUserInformation(AgentCircuitData agentData) | 688 | public void AdjustUserInformation(AgentCircuitData agentData) |
678 | { | 689 | { |
679 | CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(agentData.AgentID); | 690 | // REFACTORING PROBLEM!!! This needs to change |
680 | if ((uinfo != null) && (uinfo.UserProfile != null) && | 691 | |
681 | (IsLocalUser(uinfo) || !(uinfo.UserProfile is ForeignUserProfileData))) | 692 | //CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(agentData.AgentID); |
682 | { | 693 | //if ((uinfo != null) && (uinfo.UserProfile != null) && |
683 | //m_log.Debug("---------------> Local User!"); | 694 | // (IsLocalUser(uinfo) || !(uinfo.UserProfile is ForeignUserProfileData))) |
684 | string[] parts = agentData.firstname.Split(new char[] { '.' }); | 695 | //{ |
685 | if (parts.Length == 2) | 696 | // //m_log.Debug("---------------> Local User!"); |
686 | { | 697 | // string[] parts = agentData.firstname.Split(new char[] { '.' }); |
687 | agentData.firstname = parts[0]; | 698 | // if (parts.Length == 2) |
688 | agentData.lastname = parts[1]; | 699 | // { |
689 | } | 700 | // agentData.firstname = parts[0]; |
690 | } | 701 | // agentData.lastname = parts[1]; |
691 | //else | 702 | // } |
692 | // m_log.Debug("---------------> Foreign User!"); | 703 | //} |
704 | ////else | ||
705 | //// m_log.Debug("---------------> Foreign User!"); | ||
693 | } | 706 | } |
694 | 707 | ||
695 | // Check if a local user exists with the same UUID as the incoming foreign user | 708 | // Check if a local user exists with the same UUID as the incoming foreign user |
@@ -699,16 +712,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
699 | if (!m_aScene.SceneGridService.RegionLoginsEnabled) | 712 | if (!m_aScene.SceneGridService.RegionLoginsEnabled) |
700 | return false; | 713 | return false; |
701 | 714 | ||
702 | CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(userID); | 715 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, userID); |
703 | if (uinfo != null) | 716 | if (account != null) |
704 | { | 717 | { |
705 | // uh-oh we have a potential intruder | 718 | if (m_aScene.AuthenticationService.Verify(userID, sessionID.ToString(), 30)) |
706 | if (uinfo.SessionID != sessionID) | 719 | { |
707 | // can't have a foreigner with a local UUID | ||
708 | return false; | ||
709 | else | ||
710 | // oh, so it's you! welcome back | 720 | // oh, so it's you! welcome back |
711 | comingHome = true; | 721 | comingHome = true; |
722 | } | ||
723 | else | ||
724 | // can't have a foreigner with a local UUID | ||
725 | return false; | ||
712 | } | 726 | } |
713 | 727 | ||
714 | // OK, user can come in | 728 | // OK, user can come in |
@@ -717,7 +731,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
717 | 731 | ||
718 | public void AcceptUser(ForeignUserProfileData user, GridRegion home) | 732 | public void AcceptUser(ForeignUserProfileData user, GridRegion home) |
719 | { | 733 | { |
720 | m_aScene.CommsManager.UserProfileCacheService.PreloadUserCache(user); | 734 | // REFACTORING PROBLEM. uh-oh, commenting this breaks HG completely |
735 | // Needs to be rewritten | ||
736 | //m_aScene.CommsManager.UserProfileCacheService.PreloadUserCache(user); | ||
737 | |||
721 | ulong realHandle = home.RegionHandle; | 738 | ulong realHandle = home.RegionHandle; |
722 | // Change the local coordinates | 739 | // Change the local coordinates |
723 | // X=0 on the map | 740 | // X=0 on the map |
@@ -733,8 +750,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
733 | 750 | ||
734 | public bool IsLocalUser(UUID userID) | 751 | public bool IsLocalUser(UUID userID) |
735 | { | 752 | { |
736 | CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(userID); | 753 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, userID); |
737 | return IsLocalUser(uinfo); | 754 | return IsLocalUser(account); |
738 | } | 755 | } |
739 | 756 | ||
740 | #endregion | 757 | #endregion |
@@ -767,13 +784,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
767 | return (uinfo.UserProfile.HomeRegionID == rinfo.RegionID); | 784 | return (uinfo.UserProfile.HomeRegionID == rinfo.RegionID); |
768 | } | 785 | } |
769 | 786 | ||
770 | protected bool IsLocalUser(CachedUserInfo uinfo) | 787 | protected bool IsLocalUser(UserAccount account) |
771 | { | 788 | { |
772 | if (uinfo == null) | 789 | if (account != null && |
773 | return false; | 790 | account.ServiceURLs.ContainsKey("HomeURI") && |
791 | account.ServiceURLs["HomeURI"] != null) | ||
774 | 792 | ||
775 | return !(uinfo.UserProfile is ForeignUserProfileData); | 793 | return (account.ServiceURLs["HomeURI"].ToString() == LocalUserServerURI); |
776 | 794 | ||
795 | return false; | ||
777 | } | 796 | } |
778 | 797 | ||
779 | 798 | ||
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 | } |