aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorDiva Canto2009-09-26 21:00:51 -0700
committerDiva Canto2009-09-26 21:00:51 -0700
commitf4bf581b96347b8d7f115eca74fa84a644eb729c (patch)
treec1e42376edb8d2e5a6094854dd1ac4320f0c6f23 /OpenSim/Region/CoreModules
parentFixed a bug with link-region. (diff)
downloadopensim-SC_OLD-f4bf581b96347b8d7f115eca74fa84a644eb729c.zip
opensim-SC_OLD-f4bf581b96347b8d7f115eca74fa84a644eb729c.tar.gz
opensim-SC_OLD-f4bf581b96347b8d7f115eca74fa84a644eb729c.tar.bz2
opensim-SC_OLD-f4bf581b96347b8d7f115eca74fa84a644eb729c.tar.xz
Moved all HG1 operations to HGGridConnector.cs and HypergridServerConnector.cs/HypergridServiceConnector.cs, away from Region.Communications and HGNetworkServersInfo.
Fixed small bugs with hyperlinked regions' map positions.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs29
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs227
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs22
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs9
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs4
5 files changed, 249 insertions, 42 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs
index 41f96b3..9bf31a4 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs
@@ -37,6 +37,7 @@ using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base; 37using OpenSim.Server.Base;
38using OpenSim.Server.Handlers.Base; 38using OpenSim.Server.Handlers.Base;
39using OpenSim.Server.Handlers.Grid; 39using OpenSim.Server.Handlers.Grid;
40using OpenSim.Services.Interfaces;
40using GridRegion = OpenSim.Services.Interfaces.GridRegion; 41using GridRegion = OpenSim.Services.Interfaces.GridRegion;
41 42
42namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid 43namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid
@@ -95,20 +96,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid
95 if (!m_Enabled) 96 if (!m_Enabled)
96 return; 97 return;
97 98
98 if (!m_Registered)
99 {
100 m_Registered = true;
101
102 m_log.Info("[HypergridService]: Starting...");
103
104 Object[] args = new Object[] { m_Config, MainServer.Instance };
105
106 m_HypergridHandler = new HypergridServiceInConnector(m_Config, MainServer.Instance);
107 //ServerUtils.LoadPlugin<HypergridServiceInConnector>("OpenSim.Server.Handlers.dll:HypergridServiceInConnector", args);
108 }
109
110 GridRegion rinfo = new GridRegion(scene.RegionInfo);
111 m_HypergridHandler.AddRegion(rinfo);
112 } 99 }
113 100
114 public void RemoveRegion(Scene scene) 101 public void RemoveRegion(Scene scene)
@@ -122,6 +109,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid
122 109
123 public void RegionLoaded(Scene scene) 110 public void RegionLoaded(Scene scene)
124 { 111 {
112 if (!m_Registered)
113 {
114 m_Registered = true;
115
116 m_log.Info("[HypergridService]: Starting...");
117
118 Object[] args = new Object[] { m_Config, MainServer.Instance };
119
120 m_HypergridHandler = new HypergridServiceInConnector(m_Config, MainServer.Instance, scene.RequestModuleInterface<IHyperlinkService>());
121 //ServerUtils.LoadPlugin<HypergridServiceInConnector>("OpenSim.Server.Handlers.dll:HypergridServiceInConnector", args);
122 }
123
124 GridRegion rinfo = new GridRegion(scene.RegionInfo);
125 m_HypergridHandler.AddRegion(rinfo);
125 } 126 }
126 127
127 #endregion 128 #endregion
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
index 0bb4206..52db400 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
@@ -31,6 +31,7 @@ using System.Net;
31using System.Reflection; 31using System.Reflection;
32using System.Xml; 32using System.Xml;
33 33
34using OpenSim.Framework.Communications.Cache;
34using OpenSim.Framework; 35using OpenSim.Framework;
35using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
36using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
@@ -52,10 +53,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
52 private static readonly ILog m_log = 53 private static readonly ILog m_log =
53 LogManager.GetLogger( 54 LogManager.GetLogger(
54 MethodBase.GetCurrentMethod().DeclaringType); 55 MethodBase.GetCurrentMethod().DeclaringType);
56 private static string LocalAssetServerURI, LocalInventoryServerURI, LocalUserServerURI;
55 57
56 private bool m_Enabled = false; 58 private bool m_Enabled = false;
57 private bool m_Initialized = false; 59 private bool m_Initialized = false;
58 60
61 private Scene m_aScene;
62 private Dictionary<ulong, Scene> m_LocalScenes = new Dictionary<ulong, Scene>();
63
59 private IGridService m_GridServiceConnector; 64 private IGridService m_GridServiceConnector;
60 private HypergridServiceConnector m_HypergridServiceConnector; 65 private HypergridServiceConnector m_HypergridServiceConnector;
61 66
@@ -141,6 +146,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
141 if (!m_Enabled) 146 if (!m_Enabled)
142 return; 147 return;
143 148
149 m_LocalScenes[scene.RegionInfo.RegionHandle] = scene;
144 scene.RegisterModuleInterface<IGridService>(this); 150 scene.RegisterModuleInterface<IGridService>(this);
145 scene.RegisterModuleInterface<IHyperlinkService>(this); 151 scene.RegisterModuleInterface<IHyperlinkService>(this);
146 152
@@ -148,6 +154,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
148 154
149 public void RemoveRegion(Scene scene) 155 public void RemoveRegion(Scene scene)
150 { 156 {
157 m_LocalScenes.Remove(scene.RegionInfo.RegionHandle);
151 } 158 }
152 159
153 public void RegionLoaded(Scene scene) 160 public void RegionLoaded(Scene scene)
@@ -157,7 +164,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
157 164
158 if (!m_Initialized) 165 if (!m_Initialized)
159 { 166 {
167 m_aScene = scene;
168 LocalAssetServerURI = m_aScene.CommsManager.NetworkServersInfo.UserURL;
169 LocalInventoryServerURI = m_aScene.CommsManager.NetworkServersInfo.InventoryURL;
170 LocalUserServerURI = m_aScene.CommsManager.NetworkServersInfo.UserURL;
171
160 m_HypergridServiceConnector = new HypergridServiceConnector(scene.AssetService); 172 m_HypergridServiceConnector = new HypergridServiceConnector(scene.AssetService);
173
161 HGCommands hgCommands = new HGCommands(this, scene); 174 HGCommands hgCommands = new HGCommands(this, scene);
162 MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "link-region", 175 MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "link-region",
163 "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>", 176 "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>",
@@ -167,6 +180,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
167 "Unlink a hypergrid region", hgCommands.RunCommand); 180 "Unlink a hypergrid region", hgCommands.RunCommand);
168 MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "link-mapping", "link-mapping [<x> <y>] <cr>", 181 MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "link-mapping", "link-mapping [<x> <y>] <cr>",
169 "Set local coordinate to map HG regions to", hgCommands.RunCommand); 182 "Set local coordinate to map HG regions to", hgCommands.RunCommand);
183
184 // Yikes!! Remove this as soon as user services get refactored
185 HGNetworkServersInfo.Init(LocalAssetServerURI, LocalInventoryServerURI, LocalUserServerURI);
186
170 m_Initialized = true; 187 m_Initialized = true;
171 } 188 }
172 } 189 }
@@ -240,7 +257,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
240 // Try the foreign users home collection 257 // Try the foreign users home collection
241 foreach (GridRegion r in m_knownRegions.Values) 258 foreach (GridRegion r in m_knownRegions.Values)
242 if (r.RegionID == regionID) 259 if (r.RegionID == regionID)
243 return m_knownRegions[regionID]; 260 return r;
244 261
245 // Finally, try the normal route 262 // Finally, try the normal route
246 return m_GridServiceConnector.GetRegionByUUID(scopeID, regionID); 263 return m_GridServiceConnector.GetRegionByUUID(scopeID, regionID);
@@ -261,7 +278,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
261 foreach (GridRegion r in m_knownRegions.Values) 278 foreach (GridRegion r in m_knownRegions.Values)
262 { 279 {
263 if ((r.RegionLocX == snapX) && (r.RegionLocY == snapY)) 280 if ((r.RegionLocX == snapX) && (r.RegionLocY == snapY))
281 {
264 return r; 282 return r;
283 }
265 } 284 }
266 285
267 // Finally, try the normal route 286 // Finally, try the normal route
@@ -328,8 +347,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
328 347
329 private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle) 348 private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle)
330 { 349 {
331 m_HyperlinkRegions.Add(regionInfo.RegionID, regionInfo); 350 m_HyperlinkRegions[regionInfo.RegionID] = regionInfo;
332 m_HyperlinkHandles.Add(regionInfo.RegionID, regionHandle); 351 m_HyperlinkHandles[regionInfo.RegionID] = regionHandle;
333 } 352 }
334 353
335 private void RemoveHyperlinkRegion(UUID regionID) 354 private void RemoveHyperlinkRegion(UUID regionID)
@@ -340,8 +359,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
340 359
341 private void AddHyperlinkHomeRegion(UUID userID, GridRegion regionInfo, ulong regionHandle) 360 private void AddHyperlinkHomeRegion(UUID userID, GridRegion regionInfo, ulong regionHandle)
342 { 361 {
343 m_knownRegions.Add(userID, regionInfo); 362 m_knownRegions[userID] = regionInfo;
344 m_HyperlinkHandles.Add(regionInfo.RegionID, regionHandle); 363 m_HyperlinkHandles[regionInfo.RegionID] = regionHandle;
345 } 364 }
346 365
347 private void RemoveHyperlinkHomeRegion(UUID regionID) 366 private void RemoveHyperlinkHomeRegion(UUID regionID)
@@ -412,7 +431,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
412 // From the map search and secondlife://blah 431 // From the map search and secondlife://blah
413 public GridRegion TryLinkRegion(Scene m_scene, IClientAPI client, string mapName) 432 public GridRegion TryLinkRegion(Scene m_scene, IClientAPI client, string mapName)
414 { 433 {
415 int xloc = random.Next(0, Int16.MaxValue); 434 int xloc = random.Next(0, Int16.MaxValue) * (int) Constants.RegionSize;
416 return TryLinkRegionToCoords(m_scene, client, mapName, xloc, 0); 435 return TryLinkRegionToCoords(m_scene, client, mapName, xloc, 0);
417 } 436 }
418 437
@@ -563,10 +582,206 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
563 foreach (GridRegion r in m_HyperlinkRegions.Values) 582 foreach (GridRegion r in m_HyperlinkRegions.Values)
564 if ((r.RegionHandle == handle) && (m_HyperlinkHandles.ContainsKey(r.RegionID))) 583 if ((r.RegionHandle == handle) && (m_HyperlinkHandles.ContainsKey(r.RegionID)))
565 return m_HyperlinkHandles[r.RegionID]; 584 return m_HyperlinkHandles[r.RegionID];
585
586 foreach (GridRegion r in m_knownRegions.Values)
587 if ((r.RegionHandle == handle) && (m_HyperlinkHandles.ContainsKey(r.RegionID)))
588 return m_HyperlinkHandles[r.RegionID];
589
566 return handle; 590 return handle;
567 } 591 }
568 592
593 public bool SendUserInformation(GridRegion regInfo, AgentCircuitData agentData)
594 {
595 CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(agentData.AgentID);
596
597 if ((IsLocalUser(uinfo) && (GetHyperlinkRegion(regInfo.RegionHandle) != null)) ||
598 (!IsLocalUser(uinfo) && !IsGoingHome(uinfo, regInfo)))
599 {
600 m_log.Info("[HGrid]: Local user is going to foreign region or foreign user is going elsewhere");
601
602 // Set the position of the region on the remote grid
603 ulong realHandle = FindRegionHandle(regInfo.RegionHandle);
604 uint x = 0, y = 0;
605 Utils.LongToUInts(regInfo.RegionHandle, out x, out y);
606 GridRegion clonedRegion = new GridRegion(regInfo);
607 clonedRegion.RegionLocX = (int)x;
608 clonedRegion.RegionLocY = (int)y;
609
610 // Get the user's home region information
611 GridRegion home = m_aScene.GridService.GetRegionByUUID(m_aScene.RegionInfo.ScopeID, uinfo.UserProfile.HomeRegionID);
612
613 // Get the user's service URLs
614 string serverURI = "";
615 if (uinfo.UserProfile is ForeignUserProfileData)
616 serverURI = Util.ServerURI(((ForeignUserProfileData)uinfo.UserProfile).UserServerURI);
617 string userServer = (serverURI == "") || (serverURI == null) ? LocalUserServerURI : serverURI;
618
619 string assetServer = Util.ServerURI(uinfo.UserProfile.UserAssetURI);
620 if ((assetServer == null) || (assetServer == ""))
621 assetServer = LocalAssetServerURI;
622
623 string inventoryServer = Util.ServerURI(uinfo.UserProfile.UserInventoryURI);
624 if ((inventoryServer == null) || (inventoryServer == ""))
625 inventoryServer = LocalInventoryServerURI;
626
627 if (!m_HypergridServiceConnector.InformRegionOfUser(clonedRegion, agentData, home, userServer, assetServer, inventoryServer))
628 {
629 m_log.Warn("[HGrid]: Could not inform remote region of transferring user.");
630 return false;
631 }
632 }
633 //if ((uinfo == null) || !IsGoingHome(uinfo, regInfo))
634 //{
635 // m_log.Info("[HGrid]: User seems to be going to foreign region.");
636 // if (!InformRegionOfUser(regInfo, agentData))
637 // {
638 // m_log.Warn("[HGrid]: Could not inform remote region of transferring user.");
639 // return false;
640 // }
641 //}
642 //else
643 // m_log.Info("[HGrid]: User seems to be going home " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName);
644
645 // May need to change agent's name
646 if (IsLocalUser(uinfo) && (GetHyperlinkRegion(regInfo.RegionHandle) != null))
647 {
648 agentData.firstname = agentData.firstname + "." + agentData.lastname;
649 agentData.lastname = "@" + LocalUserServerURI.Replace("http://", ""); ; //HGNetworkServersInfo.Singleton.LocalUserServerURI;
650 }
651
652 return true;
653 }
654
655 public void AdjustUserInformation(AgentCircuitData agentData)
656 {
657 CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(agentData.AgentID);
658 if ((uinfo != null) && (uinfo.UserProfile != null) &&
659 (IsLocalUser(uinfo) || !(uinfo.UserProfile is ForeignUserProfileData)))
660 {
661 //m_log.Debug("---------------> Local User!");
662 string[] parts = agentData.firstname.Split(new char[] { '.' });
663 if (parts.Length == 2)
664 {
665 agentData.firstname = parts[0];
666 agentData.lastname = parts[1];
667 }
668 }
669 //else
670 // m_log.Debug("---------------> Foreign User!");
671 }
672
673 // Check if a local user exists with the same UUID as the incoming foreign user
674 public bool CheckUserAtEntry(UUID userID, UUID sessionID, out bool comingHome)
675 {
676 comingHome = false;
677 if (!m_aScene.SceneGridService.RegionLoginsEnabled)
678 return false;
679
680 CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(userID);
681 if (uinfo != null)
682 {
683 // uh-oh we have a potential intruder
684 if (uinfo.SessionID != sessionID)
685 // can't have a foreigner with a local UUID
686 return false;
687 else
688 // oh, so it's you! welcome back
689 comingHome = true;
690 }
691
692 // OK, user can come in
693 return true;
694 }
695
696 public void AcceptUser(ForeignUserProfileData user, GridRegion home)
697 {
698 m_aScene.CommsManager.UserProfileCacheService.PreloadUserCache(user);
699 ulong realHandle = home.RegionHandle;
700 // Change the local coordinates
701 // X=0 on the map
702 home.RegionLocX = 0;
703 home.RegionLocY = random.Next(0, 10000) * (int)Constants.RegionSize;
704
705 AddHyperlinkHomeRegion(user.ID, home, realHandle);
706
707 DumpUserData(user);
708 DumpRegionData(home);
709
710 }
711
712 public bool IsLocalUser(UUID userID)
713 {
714 CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(userID);
715 return IsLocalUser(uinfo);
716 }
717
569 #endregion 718 #endregion
570 719
720 #region IHyperlink Misc
721
722 protected bool IsComingHome(ForeignUserProfileData userData)
723 {
724 return (userData.UserServerURI == LocalUserServerURI);
725 }
726
727 // Is the user going back to the home region or the home grid?
728 protected bool IsGoingHome(CachedUserInfo uinfo, GridRegion rinfo)
729 {
730 if (uinfo.UserProfile == null)
731 return false;
732
733 if (!(uinfo.UserProfile is ForeignUserProfileData))
734 // it's a home user, can't be outside to return home
735 return false;
736
737 // OK, it's a foreign user with a ForeignUserProfileData
738 // and is going back to exactly the home region.
739 // We can't check if it's going back to a non-home region
740 // of the home grid. That will be dealt with in the
741 // receiving end
742 return (uinfo.UserProfile.HomeRegionID == rinfo.RegionID);
743 }
744
745 protected bool IsLocalUser(CachedUserInfo uinfo)
746 {
747 if (uinfo == null)
748 return false;
749
750 return !(uinfo.UserProfile is ForeignUserProfileData);
751
752 }
753
754 protected bool IsLocalRegion(ulong handle)
755 {
756 return m_LocalScenes.ContainsKey(handle);
757 }
758
759 private void DumpUserData(ForeignUserProfileData userData)
760 {
761 m_log.Info(" ------------ User Data Dump ----------");
762 m_log.Info(" >> Name: " + userData.FirstName + " " + userData.SurName);
763 m_log.Info(" >> HomeID: " + userData.HomeRegionID);
764 m_log.Info(" >> UserServer: " + userData.UserServerURI);
765 m_log.Info(" >> InvServer: " + userData.UserInventoryURI);
766 m_log.Info(" >> AssetServer: " + userData.UserAssetURI);
767 m_log.Info(" ------------ -------------- ----------");
768 }
769
770 private void DumpRegionData(GridRegion rinfo)
771 {
772 m_log.Info(" ------------ Region Data Dump ----------");
773 m_log.Info(" >> handle: " + rinfo.RegionHandle);
774 m_log.Info(" >> coords: " + rinfo.RegionLocX + ", " + rinfo.RegionLocY);
775 m_log.Info(" >> external host name: " + rinfo.ExternalHostName);
776 m_log.Info(" >> http port: " + rinfo.HttpPort);
777 m_log.Info(" >> external EP address: " + rinfo.ExternalEndPoint.Address);
778 m_log.Info(" >> external EP port: " + rinfo.ExternalEndPoint.Port);
779 m_log.Info(" ------------ -------------- ----------");
780 }
781
782
783 #endregion
784
785
571 } 786 }
572} 787}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs
index adf747a..696225c 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs
@@ -824,29 +824,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
824 824
825 public override void SendUserInformation(GridRegion regInfo, AgentCircuitData aCircuit) 825 public override void SendUserInformation(GridRegion regInfo, AgentCircuitData aCircuit)
826 { 826 {
827 try 827 if (m_hyperlinkService != null)
828 { 828 m_hyperlinkService.SendUserInformation(regInfo, aCircuit);
829 if (m_aScene.SceneGridService is HGSceneCommunicationService)
830 {
831 // big hack for now
832 RegionInfo r = new RegionInfo();
833 r.ExternalHostName = regInfo.ExternalHostName;
834 r.HttpPort = regInfo.HttpPort;
835 r.RegionID = regInfo.RegionID;
836 r.RegionLocX = (uint)regInfo.RegionLocX;
837 r.RegionLocY = (uint)regInfo.RegionLocY;
838 ((HGSceneCommunicationService)(m_aScene.SceneGridService)).m_hg.SendUserInformation(r, aCircuit);
839 }
840 }
841 catch // Bad cast
842 { }
843 829
844 } 830 }
845 831
846 public override void AdjustUserInformation(AgentCircuitData aCircuit) 832 public override void AdjustUserInformation(AgentCircuitData aCircuit)
847 { 833 {
848 if (m_aScene.SceneGridService is HGSceneCommunicationService) 834 if (m_hyperlinkService != null)
849 ((HGSceneCommunicationService)(m_aScene.SceneGridService)).m_hg.AdjustUserInformation(aCircuit); 835 m_hyperlinkService.AdjustUserInformation(aCircuit);
850 } 836 }
851 } 837 }
852 838
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index 1c66254..fd1a759 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -525,7 +525,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
525 return true; 525 return true;
526 } 526 }
527 527
528 string userInventoryServerURI = HGNetworkServersInfo.ServerURI(uinfo.UserProfile.UserInventoryURI); 528 if ((uinfo.UserProfile.UserInventoryURI == null) || (uinfo.UserProfile.UserInventoryURI == ""))
529 // this happens in standalone profiles, apparently
530 return true;
531
532 string userInventoryServerURI = Util.ServerURI(uinfo.UserProfile.UserInventoryURI);
533
529 string uri = m_LocalGridInventoryURI.TrimEnd('/'); 534 string uri = m_LocalGridInventoryURI.TrimEnd('/');
530 535
531 if ((userInventoryServerURI == uri) || (userInventoryServerURI == "")) 536 if ((userInventoryServerURI == uri) || (userInventoryServerURI == ""))
@@ -544,7 +549,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
544 if ((uinfo == null) || (uinfo.UserProfile == null)) 549 if ((uinfo == null) || (uinfo.UserProfile == null))
545 return invURI; 550 return invURI;
546 551
547 string userInventoryServerURI = HGNetworkServersInfo.ServerURI(uinfo.UserProfile.UserInventoryURI); 552 string userInventoryServerURI = Util.ServerURI(uinfo.UserProfile.UserInventoryURI);
548 553
549 if ((userInventoryServerURI != null) && 554 if ((userInventoryServerURI != null) &&
550 (userInventoryServerURI != "")) 555 (userInventoryServerURI != ""))
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
index e3661fa..436f332 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
@@ -137,8 +137,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
137 data.Name = info.RegionName; 137 data.Name = info.RegionName;
138 data.RegionFlags = 0; // TODO not used? 138 data.RegionFlags = 0; // TODO not used?
139 data.WaterHeight = 0; // not used 139 data.WaterHeight = 0; // not used
140 data.X = (ushort)info.RegionLocX; 140 data.X = (ushort)(info.RegionLocX / Constants.RegionSize);
141 data.Y = (ushort)info.RegionLocY; 141 data.Y = (ushort)(info.RegionLocY / Constants.RegionSize);
142 blocks.Add(data); 142 blocks.Add(data);
143 } 143 }
144 } 144 }