From 4c2ece3bcb7a28c746ef42b7cc6939571e0ede3b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 20 Nov 2016 04:22:00 +0000 Subject: [PATCH] HG LinkRegion receive region size also. Useless since olde r gatekeepers dont send it --- .../Hypergrid/GatekeeperServiceConnector.cs | 13 +++++++++++-- OpenSim/Services/GridService/HypergridLinker.cs | 8 ++++++-- OpenSim/Services/LLLoginService/LLLoginService.cs | 5 ++++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index aad3bd220a..eef492d4b4 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs @@ -73,13 +73,15 @@ namespace OpenSim.Services.Connectors.Hypergrid return "foreignobject/"; } - public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason) + public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason, out int sizeX, out int sizeY) { regionID = UUID.Zero; imageURL = string.Empty; realHandle = 0; externalName = string.Empty; reason = string.Empty; + sizeX = (int)Constants.RegionSize; + sizeY = (int)Constants.RegionSize; Hashtable hash = new Hashtable(); hash["region_name"] = info.RegionName; @@ -134,8 +136,15 @@ namespace OpenSim.Services.Connectors.Hypergrid externalName = (string)hash["external_name"]; //m_log.Debug(">> HERE, externalName: " + externalName); } + if (hash["size_x"] != null) + { + Int32.TryParse((string)hash["size_x"], out sizeX); + } + if (hash["size_y"] != null) + { + Int32.TryParse((string)hash["size_y"], out sizeY); + } } - } catch (Exception e) { diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 2af617a4f4..db33b1a486 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -198,7 +198,7 @@ namespace OpenSim.Services.GridService mapName = mapName.Trim(); - if (!mapName.StartsWith("http")) + if (!mapName.StartsWith("http") && !!mapName.StartsWith("https")) { // Formats: grid.example.com:8002:region name // grid.example.com:region name @@ -365,7 +365,9 @@ namespace OpenSim.Services.GridService UUID regionID = UUID.Zero; string externalName = string.Empty; string imageURL = string.Empty; - if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out externalName, out imageURL, out reason)) + int sizeX = (int)Constants.RegionSize; + int sizeY = (int)Constants.RegionSize; + if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out externalName, out imageURL, out reason, out sizeX, out sizeY)) return false; if (regionID == UUID.Zero) @@ -397,6 +399,8 @@ namespace OpenSim.Services.GridService // } regInfo.RegionID = regionID; + regInfo.RegionSizeX = sizeX; + regInfo.RegionSizeY = sizeY; if (externalName == string.Empty) regInfo.RegionName = regInfo.ServerURI; diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 1ea17b502c..6d63959a2a 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -785,7 +785,10 @@ namespace OpenSim.Services.LLLoginService ulong handle; string imageURL = string.Empty, reason = string.Empty; string message; - if (m_GatekeeperConnector.LinkRegion(gatekeeper, out regionID, out handle, out domainName, out imageURL, out reason)) + int sizeX = (int)Constants.RegionSize; + int sizeY = (int)Constants.RegionSize; + + if (m_GatekeeperConnector.LinkRegion(gatekeeper, out regionID, out handle, out domainName, out imageURL, out reason, out sizeX, out sizeY)) { string homeURI = null; if (account.ServiceURLs != null && account.ServiceURLs.ContainsKey("HomeURI"))