From 04e29c1bacbc1e2df980ae15896a847ce7535da2 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 16 Jan 2010 21:42:44 -0800 Subject: Beginning of rewriting HG. Compiles, and runs, but HG functions not restored yet. --- .../ServiceConnectorsOut/Grid/HGGridConnector.cs | 650 ++------------------- 1 file changed, 43 insertions(+), 607 deletions(-) (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs index de71b56..75eb889 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs @@ -49,12 +49,11 @@ using Nini.Config; namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid { - public class HGGridConnector : ISharedRegionModule, IGridService, IHyperlinkService + public class HGGridConnector : ISharedRegionModule, IGridService { private static readonly ILog m_log = LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); - private static string LocalAssetServerURI, LocalInventoryServerURI, LocalUserServerURI; private bool m_Enabled = false; private bool m_Initialized = false; @@ -63,18 +62,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid private Dictionary m_LocalScenes = new Dictionary(); private IGridService m_GridServiceConnector; - private HypergridServiceConnector m_HypergridServiceConnector; + private IHypergridService m_HypergridService; - // Hyperlink regions are hyperlinks on the map - protected Dictionary m_HyperlinkRegions = new Dictionary(); - - // Known regions are home regions of visiting foreign users. - // They are not on the map as static hyperlinks. They are dynamic hyperlinks, they go away when - // the visitor goes away. They are mapped to X=0 on the map. - // This is key-ed on agent ID - protected Dictionary m_knownRegions = new Dictionary(); - - protected Dictionary m_HyperlinkHandles = new Dictionary(); #region ISharedRegionModule @@ -125,13 +114,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid if (module == String.Empty) { m_log.Error("[HGGRID CONNECTOR]: No GridServiceConnectorModule named in section GridService"); - //return; throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's"); } Object[] args = new Object[] { source }; m_GridServiceConnector = ServerUtils.LoadPlugin(module, args); + string hypergrid = gridConfig.GetString("HypergridService", string.Empty); + if (hypergrid == String.Empty) + { + m_log.Error("[HGGRID CONNECTOR]: No HypergridService named in section GridService"); + throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's"); + } + m_HypergridService = ServerUtils.LoadPlugin(hypergrid, args); + + if (m_GridServiceConnector == null || m_HypergridService == null) + throw new Exception("Unable to proceed. HGGrid services could not be loaded."); } public void PostInitialise() @@ -151,7 +149,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid m_LocalScenes[scene.RegionInfo.RegionHandle] = scene; scene.RegisterModuleInterface(this); - scene.RegisterModuleInterface(this); ((ISharedRegionModule)m_GridServiceConnector).AddRegion(scene); @@ -175,18 +172,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid { m_aScene = scene; - m_HypergridServiceConnector = new HypergridServiceConnector(scene.AssetService); - - HGCommands hgCommands = new HGCommands(this, scene); - MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "link-region", - "link-region :[:] ", - "Link a hypergrid region", hgCommands.RunCommand); - MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "unlink-region", - "unlink-region or : ", - "Unlink a hypergrid region", hgCommands.RunCommand); - MainConsole.Instance.Commands.AddCommand("HGGridServicesConnector", false, "link-mapping", "link-mapping [ ] ", - "Set local coordinate to map HG regions to", hgCommands.RunCommand); - m_Initialized = true; } } @@ -197,50 +182,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid public string RegisterRegion(UUID scopeID, GridRegion regionInfo) { - // Region doesn't exist here. Trying to link remote region - if (regionInfo.RegionID.Equals(UUID.Zero)) - { - m_log.Info("[HGrid]: Linking remote region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort); - ulong regionHandle = 0; - regionInfo.RegionID = m_HypergridServiceConnector.LinkRegion(regionInfo, out regionHandle); - if (!regionInfo.RegionID.Equals(UUID.Zero)) - { - AddHyperlinkRegion(regionInfo, regionHandle); - m_log.Info("[HGrid]: Successfully linked to region_uuid " + regionInfo.RegionID); - - // Try get the map image - m_HypergridServiceConnector.GetMapImage(regionInfo); - return String.Empty; - } - else - { - m_log.Info("[HGrid]: No such region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "(" + regionInfo.InternalEndPoint.Port + ")"); - return "No such region"; - } - // Note that these remote regions aren't registered in localBackend, so return null, no local listeners - } - else // normal grid - return m_GridServiceConnector.RegisterRegion(scopeID, regionInfo); + return m_GridServiceConnector.RegisterRegion(scopeID, regionInfo); } public bool DeregisterRegion(UUID regionID) { - // Try the hyperlink collection - if (m_HyperlinkRegions.ContainsKey(regionID)) - { - RemoveHyperlinkRegion(regionID); - return true; - } - // Try the foreign users home collection - - foreach (GridRegion r in m_knownRegions.Values) - if (r.RegionID == regionID) - { - RemoveHyperlinkHomeRegion(regionID); - return true; - } - - // Finally, try the normal route return m_GridServiceConnector.DeregisterRegion(regionID); } @@ -253,41 +199,27 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) { - // Try the hyperlink collection - if (m_HyperlinkRegions.ContainsKey(regionID)) - return m_HyperlinkRegions[regionID]; - - // Try the foreign users home collection - foreach (GridRegion r in m_knownRegions.Values) - if (r.RegionID == regionID) - return r; - - // Finally, try the normal route - return m_GridServiceConnector.GetRegionByUUID(scopeID, regionID); + GridRegion region = m_GridServiceConnector.GetRegionByUUID(scopeID, regionID); + if (region != null) + return region; + + region = m_HypergridService.GetRegionByUUID(regionID); + + return region; } public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) { int snapX = (int) (x / Constants.RegionSize) * (int)Constants.RegionSize; int snapY = (int) (y / Constants.RegionSize) * (int)Constants.RegionSize; - // Try the hyperlink collection - foreach (GridRegion r in m_HyperlinkRegions.Values) - { - if ((r.RegionLocX == snapX) && (r.RegionLocY == snapY)) - return r; - } - // Try the foreign users home collection - foreach (GridRegion r in m_knownRegions.Values) - { - if ((r.RegionLocX == snapX) && (r.RegionLocY == snapY)) - { - return r; - } - } + GridRegion region = m_GridServiceConnector.GetRegionByPosition(scopeID, x, y); + if (region != null) + return region; + + region = m_HypergridService.GetRegionByPosition(snapX, snapY); - // Finally, try the normal route - return m_GridServiceConnector.GetRegionByPosition(scopeID, x, y); + return region; } public GridRegion GetRegionByName(UUID scopeID, string regionName) @@ -297,551 +229,55 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid if (region != null) return region; - // Try the hyperlink collection - foreach (GridRegion r in m_HyperlinkRegions.Values) - { - if (r.RegionName == regionName) - return r; - } + region = m_HypergridService.GetRegionByName(regionName); - // Try the foreign users home collection - foreach (GridRegion r in m_knownRegions.Values) - { - if (r.RegionName == regionName) - return r; - } - return null; + return region; } public List GetRegionsByName(UUID scopeID, string name, int maxNumber) { - List rinfos = new List(); - if (name == string.Empty) - return rinfos; - - foreach (GridRegion r in m_HyperlinkRegions.Values) - if ((r.RegionName != null) && r.RegionName.ToLower().StartsWith(name.ToLower())) - rinfos.Add(r); + return new List(); + + List rinfos = m_GridServiceConnector.GetRegionsByName(scopeID, name, maxNumber); + + rinfos.AddRange(m_HypergridService.GetRegionsByName(name)); + if (rinfos.Count > maxNumber) + rinfos.RemoveRange(maxNumber - 1, rinfos.Count - maxNumber); - rinfos.AddRange(m_GridServiceConnector.GetRegionsByName(scopeID, name, maxNumber)); return rinfos; } public List GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) { int snapXmin = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize; -// int snapXmax = (int)(xmax / Constants.RegionSize) * (int)Constants.RegionSize; + int snapXmax = (int)(xmax / Constants.RegionSize) * (int)Constants.RegionSize; int snapYmin = (int)(ymin / Constants.RegionSize) * (int)Constants.RegionSize; int snapYmax = (int)(ymax / Constants.RegionSize) * (int)Constants.RegionSize; - List rinfos = new List(); - foreach (GridRegion r in m_HyperlinkRegions.Values) - if ((r.RegionLocX > snapXmin) && (r.RegionLocX < snapYmax) && - (r.RegionLocY > snapYmin) && (r.RegionLocY < snapYmax)) - rinfos.Add(r); + List rinfos = m_GridServiceConnector.GetRegionRange(scopeID, xmin, xmax, ymin, ymax); - rinfos.AddRange(m_GridServiceConnector.GetRegionRange(scopeID, xmin, xmax, ymin, ymax)); + rinfos.AddRange(m_HypergridService.GetRegionRange(snapXmin, snapXmax, snapYmin, snapYmax)); return rinfos; } - #endregion - - #region Auxiliary - - private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle) - { - m_HyperlinkRegions[regionInfo.RegionID] = regionInfo; - m_HyperlinkHandles[regionInfo.RegionID] = regionHandle; - } - - private void RemoveHyperlinkRegion(UUID regionID) - { - m_HyperlinkRegions.Remove(regionID); - m_HyperlinkHandles.Remove(regionID); - } - - private void AddHyperlinkHomeRegion(UUID userID, GridRegion regionInfo, ulong regionHandle) - { - m_knownRegions[userID] = regionInfo; - m_HyperlinkHandles[regionInfo.RegionID] = regionHandle; - } - - private void RemoveHyperlinkHomeRegion(UUID regionID) - { - foreach (KeyValuePair kvp in m_knownRegions) - { - if (kvp.Value.RegionID == regionID) - { - m_knownRegions.Remove(kvp.Key); - } - } - m_HyperlinkHandles.Remove(regionID); - } - #endregion - - #region IHyperlinkService - - private static Random random = new Random(); - - // From the command line link-region - public GridRegion TryLinkRegionToCoords(Scene m_scene, IClientAPI client, string mapName, int xloc, int yloc) - { - string host = "127.0.0.1"; - string portstr; - string regionName = ""; - uint port = 9000; - string[] parts = mapName.Split(new char[] { ':' }); - if (parts.Length >= 1) - { - host = parts[0]; - } - if (parts.Length >= 2) - { - portstr = parts[1]; - //m_log.Debug("-- port = " + portstr); - if (!UInt32.TryParse(portstr, out port)) - regionName = parts[1]; - } - // always take the last one - if (parts.Length >= 3) - { - regionName = parts[2]; - } - - // Sanity check. Don't ever link to this sim. - IPAddress ipaddr = null; - try - { - ipaddr = Util.GetHostFromDNS(host); - } - catch { } - - if ((ipaddr != null) && - !((m_scene.RegionInfo.ExternalEndPoint.Address.Equals(ipaddr)) && (m_scene.RegionInfo.HttpPort == port))) - { - GridRegion regInfo; - bool success = TryCreateLink(m_scene, client, xloc, yloc, regionName, port, host, out regInfo); - if (success) - { - regInfo.RegionName = mapName; - return regInfo; - } - } - - return null; - } - - - // From the map search and secondlife://blah - public GridRegion TryLinkRegion(Scene m_scene, IClientAPI client, string mapName) - { - int xloc = random.Next(0, Int16.MaxValue) * (int) Constants.RegionSize; - return TryLinkRegionToCoords(m_scene, client, mapName, xloc, 0); - } - - // From the command line and the 2 above - public bool TryCreateLink(Scene m_scene, IClientAPI client, int xloc, int yloc, - string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo) - { - m_log.DebugFormat("[HGrid]: Link to {0}:{1}, in {2}-{3}", externalHostName, externalPort, xloc, yloc); - - regInfo = new GridRegion(); - regInfo.RegionName = externalRegionName; - regInfo.HttpPort = externalPort; - regInfo.ExternalHostName = externalHostName; - regInfo.RegionLocX = xloc; - regInfo.RegionLocY = yloc; - - try - { - regInfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)0); - } - catch (Exception e) - { - m_log.Warn("[HGrid]: Wrong format for link-region: " + e.Message); - return false; - } - - // Finally, link it - if (RegisterRegion(UUID.Zero, regInfo) != String.Empty) - { - m_log.Warn("[HGrid]: Unable to link region"); - return false; - } - - int x, y; - if (!Check4096(m_scene, regInfo, out x, out y)) - { - DeregisterRegion(regInfo.RegionID); - if (client != null) - client.SendAlertMessage("Region is too far (" + x + ", " + y + ")"); - m_log.Info("[HGrid]: Unable to link, region is too far (" + x + ", " + y + ")"); - return false; - } - - if (!CheckCoords(m_scene.RegionInfo.RegionLocX, m_scene.RegionInfo.RegionLocY, x, y)) - { - DeregisterRegion(regInfo.RegionID); - if (client != null) - client.SendAlertMessage("Region has incompatible coordinates (" + x + ", " + y + ")"); - m_log.Info("[HGrid]: Unable to link, region has incompatible coordinates (" + x + ", " + y + ")"); - return false; - } - - m_log.Debug("[HGrid]: link region succeeded"); - return true; - } - - public bool TryUnlinkRegion(Scene m_scene, string mapName) - { - GridRegion regInfo = null; - if (mapName.Contains(":")) - { - string host = "127.0.0.1"; - //string portstr; - //string regionName = ""; - uint port = 9000; - string[] parts = mapName.Split(new char[] { ':' }); - if (parts.Length >= 1) - { - host = parts[0]; - } - // if (parts.Length >= 2) - // { - // portstr = parts[1]; - // if (!UInt32.TryParse(portstr, out port)) - // regionName = parts[1]; - // } - // always take the last one - // if (parts.Length >= 3) - // { - // regionName = parts[2]; - // } - foreach (GridRegion r in m_HyperlinkRegions.Values) - if (host.Equals(r.ExternalHostName) && (port == r.HttpPort)) - regInfo = r; - } - else - { - foreach (GridRegion r in m_HyperlinkRegions.Values) - if (r.RegionName.Equals(mapName)) - regInfo = r; - } - if (regInfo != null) - { - return DeregisterRegion(regInfo.RegionID); - } - else - { - m_log.InfoFormat("[HGrid]: Region {0} not found", mapName); - return false; - } - } - - /// - /// Cope with this viewer limitation. - /// - /// - /// - public bool Check4096(Scene m_scene, GridRegion regInfo, out int x, out int y) - { - ulong realHandle = m_HyperlinkHandles[regInfo.RegionID]; - uint ux = 0, uy = 0; - Utils.LongToUInts(realHandle, out ux, out uy); - x = (int)(ux / Constants.RegionSize); - y = (int)(uy / Constants.RegionSize); - - if ((Math.Abs((int)m_scene.RegionInfo.RegionLocX - x) >= 4096) || - (Math.Abs((int)m_scene.RegionInfo.RegionLocY - y) >= 4096)) - { - return false; - } - return true; - } - - public bool CheckCoords(uint thisx, uint thisy, int x, int y) - { - if ((thisx == x) && (thisy == y)) - return false; - return true; - } - - // From the map search - public GridRegion TryLinkRegion(IClientAPI client, string regionDescriptor) - { - return TryLinkRegion((Scene)client.Scene, client, regionDescriptor); - } - - // From the map and secondlife://blah - public GridRegion GetHyperlinkRegion(ulong handle) - { - foreach (GridRegion r in m_HyperlinkRegions.Values) - if (r.RegionHandle == handle) - return r; - foreach (GridRegion r in m_knownRegions.Values) - if (r.RegionHandle == handle) - return r; - return null; - } - - public ulong FindRegionHandle(ulong handle) - { - foreach (GridRegion r in m_HyperlinkRegions.Values) - if ((r.RegionHandle == handle) && (m_HyperlinkHandles.ContainsKey(r.RegionID))) - return m_HyperlinkHandles[r.RegionID]; - - foreach (GridRegion r in m_knownRegions.Values) - if ((r.RegionHandle == handle) && (m_HyperlinkHandles.ContainsKey(r.RegionID))) - return m_HyperlinkHandles[r.RegionID]; - - return handle; - } - - public bool SendUserInformation(GridRegion regInfo, AgentCircuitData agentData) - { - // REFACTORING PROBLEM. This needs to change. Some of this info should go with the agent circuit data. - - //UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, agentData.AgentID); - //if (account == null) - // return false; - - //if ((IsLocalUser(account) && (GetHyperlinkRegion(regInfo.RegionHandle) != null)) || - // (!IsLocalUser(account) && !IsGoingHome(uinfo, regInfo))) - //{ - // m_log.Info("[HGrid]: Local user is going to foreign region or foreign user is going elsewhere"); - - // PresenceInfo pinfo = m_aScene.PresenceService.GetAgent(agentData.SessionID); - // if (pinfo != null) - // { - // // Set the position of the region on the remote grid - // // ulong realHandle = FindRegionHandle(regInfo.RegionHandle); - // uint x = 0, y = 0; - // Utils.LongToUInts(regInfo.RegionHandle, out x, out y); - // GridRegion clonedRegion = new GridRegion(regInfo); - // clonedRegion.RegionLocX = (int)x; - // clonedRegion.RegionLocY = (int)y; - - // // Get the user's home region information and adapt the region handle - // GridRegion home = GetRegionByUUID(m_aScene.RegionInfo.ScopeID, pinfo.HomeRegionID); - // if (m_HyperlinkHandles.ContainsKey(pinfo.HomeRegionID)) - // { - // ulong realHandle = m_HyperlinkHandles[pinfo.HomeRegionID]; - // Utils.LongToUInts(realHandle, out x, out y); - // m_log.DebugFormat("[HGrid]: Foreign user is going elsewhere. Adjusting home handle from {0}-{1} to {2}-{3}", home.RegionLocX, home.RegionLocY, x, y); - // home.RegionLocX = (int)x; - // home.RegionLocY = (int)y; - // } - - // // Get the user's service URLs - // string serverURI = ""; - // if (uinfo.UserProfile is ForeignUserProfileData) - // serverURI = Util.ServerURI(((ForeignUserProfileData)uinfo.UserProfile).UserServerURI); - // string userServer = (serverURI == "") || (serverURI == null) ? LocalUserServerURI : serverURI; - - // string assetServer = Util.ServerURI(uinfo.UserProfile.UserAssetURI); - // if ((assetServer == null) || (assetServer == "")) - // assetServer = LocalAssetServerURI; - - // string inventoryServer = Util.ServerURI(uinfo.UserProfile.UserInventoryURI); - // if ((inventoryServer == null) || (inventoryServer == "")) - // inventoryServer = LocalInventoryServerURI; - - // if (!m_HypergridServiceConnector.InformRegionOfUser(clonedRegion, agentData, home, userServer, assetServer, inventoryServer)) - // { - // m_log.Warn("[HGrid]: Could not inform remote region of transferring user."); - // return false; - // } - // } - // else - // { - // m_log.Warn("[HGrid]: Unable to find local presence of transferring user."); - // return false; - // } - //} - ////if ((uinfo == null) || !IsGoingHome(uinfo, regInfo)) - ////{ - //// m_log.Info("[HGrid]: User seems to be going to foreign region."); - //// if (!InformRegionOfUser(regInfo, agentData)) - //// { - //// m_log.Warn("[HGrid]: Could not inform remote region of transferring user."); - //// return false; - //// } - ////} - ////else - //// m_log.Info("[HGrid]: User seems to be going home " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName); - - //// May need to change agent's name - //if (IsLocalUser(uinfo) && (GetHyperlinkRegion(regInfo.RegionHandle) != null)) - //{ - // agentData.firstname = agentData.firstname + "." + agentData.lastname; - // agentData.lastname = "@" + LocalUserServerURI.Replace("http://", ""); ; //HGNetworkServersInfo.Singleton.LocalUserServerURI; - //} - - return true; - } - - public void AdjustUserInformation(AgentCircuitData agentData) - { - // REFACTORING PROBLEM!!! This needs to change - - //CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(agentData.AgentID); - //if ((uinfo != null) && (uinfo.UserProfile != null) && - // (IsLocalUser(uinfo) || !(uinfo.UserProfile is ForeignUserProfileData))) - //{ - // //m_log.Debug("---------------> Local User!"); - // string[] parts = agentData.firstname.Split(new char[] { '.' }); - // if (parts.Length == 2) - // { - // agentData.firstname = parts[0]; - // agentData.lastname = parts[1]; - // } - //} - ////else - //// m_log.Debug("---------------> Foreign User!"); - } - - // Check if a local user exists with the same UUID as the incoming foreign user - public bool CheckUserAtEntry(UUID userID, UUID sessionID, out bool comingHome) - { - comingHome = false; - - UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, userID); - if (account != null) - { - if (m_aScene.AuthenticationService.Verify(userID, sessionID.ToString(), 30)) - { - // oh, so it's you! welcome back - comingHome = true; - } - else - // can't have a foreigner with a local UUID - return false; - } - - // OK, user can come in - return true; - } - - public void AcceptUser(ForeignUserProfileData user, GridRegion home) - { - // REFACTORING PROBLEM. uh-oh, commenting this breaks HG completely - // Needs to be rewritten - //m_aScene.CommsManager.UserProfileCacheService.PreloadUserCache(user); - - ulong realHandle = home.RegionHandle; - // Change the local coordinates - // X=0 on the map - home.RegionLocX = 0; - home.RegionLocY = random.Next(0, 10000) * (int)Constants.RegionSize; - - AddHyperlinkHomeRegion(user.ID, home, realHandle); - - DumpUserData(user); - DumpRegionData(home); - - } - - public bool IsLocalUser(UUID userID) - { - UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, userID); - return IsLocalUser(account); - } - - #endregion - - #region IHyperlink Misc - - protected bool IsComingHome(ForeignUserProfileData userData) - { - return false; - // REFACTORING PROBLEM - //return (userData.UserServerURI == LocalUserServerURI); - } - - // REFACTORING PROBLEM - //// Is the user going back to the home region or the home grid? - //protected bool IsGoingHome(CachedUserInfo uinfo, GridRegion rinfo) - //{ - // if (uinfo == null) - // return false; - - // if (uinfo.UserProfile == null) - // return false; - - // if (!(uinfo.UserProfile is ForeignUserProfileData)) - // // it's a home user, can't be outside to return home - // return false; - - // // OK, it's a foreign user with a ForeignUserProfileData - // // and is going back to exactly the home region. - // // We can't check if it's going back to a non-home region - // // of the home grid. That will be dealt with in the - // // receiving end - // return (uinfo.UserProfile.HomeRegionID == rinfo.RegionID); - //} - - protected bool IsLocalUser(UserAccount account) - { - return true; - - // REFACTORING PROBLEM - //if (account != null && - // account.ServiceURLs.ContainsKey("HomeURI") && - // account.ServiceURLs["HomeURI"] != null) - - // return (account.ServiceURLs["HomeURI"].ToString() == LocalUserServerURI); - - //return false; - } - - - protected bool IsLocalRegion(ulong handle) - { - return m_LocalScenes.ContainsKey(handle); - } - - private void DumpUserData(ForeignUserProfileData userData) - { - m_log.Info(" ------------ User Data Dump ----------"); - m_log.Info(" >> Name: " + userData.FirstName + " " + userData.SurName); - m_log.Info(" >> HomeID: " + userData.HomeRegionID); - m_log.Info(" >> UserServer: " + userData.UserServerURI); - m_log.Info(" >> InvServer: " + userData.UserInventoryURI); - m_log.Info(" >> AssetServer: " + userData.UserAssetURI); - m_log.Info(" ------------ -------------- ----------"); - } - - private void DumpRegionData(GridRegion rinfo) - { - m_log.Info(" ------------ Region Data Dump ----------"); - m_log.Info(" >> handle: " + rinfo.RegionHandle); - m_log.Info(" >> coords: " + rinfo.RegionLocX + ", " + rinfo.RegionLocY); - m_log.Info(" >> external host name: " + rinfo.ExternalHostName); - m_log.Info(" >> http port: " + rinfo.HttpPort); - m_log.Info(" >> external EP address: " + rinfo.ExternalEndPoint.Address); - m_log.Info(" >> external EP port: " + rinfo.ExternalEndPoint.Port); - m_log.Info(" ------------ -------------- ----------"); - } - - - #endregion - public List GetDefaultRegions(UUID scopeID) { - return null; + return m_GridServiceConnector.GetDefaultRegions(scopeID); } public List GetFallbackRegions(UUID scopeID, int x, int y) { - return null; + return m_GridServiceConnector.GetFallbackRegions(scopeID, x, y); } public int GetRegionFlags(UUID scopeID, UUID regionID) { - return 0; + return m_GridServiceConnector.GetRegionFlags(scopeID, regionID); } + + #endregion } } -- cgit v1.1