From 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 19 May 2019 21:24:15 +1000 Subject: Dump OpenSim 0.9.0.1 into it's own branch. --- .../Hypergrid/GatekeeperServiceConnector.cs | 23 ++++++++++++----- .../Hypergrid/HGFriendsServicesConnector.cs | 5 +++- .../Connectors/Hypergrid/HeloServicesConnector.cs | 2 +- .../Hypergrid/UserAgentServiceConnector.cs | 30 ++++++++++++++-------- 4 files changed, 41 insertions(+), 19 deletions(-) (limited to 'OpenSim/Services/Connectors/Hypergrid') diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index b1663ee..e814c45 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) { @@ -160,14 +169,15 @@ namespace OpenSim.Services.Connectors.Hypergrid try { - WebClient c = new WebClient(); + //m_log.Debug("JPEG: " + imageURL); string name = regionID.ToString(); filename = Path.Combine(storagePath, name + ".jpg"); m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: Map image at {0}, cached at {1}", imageURL, filename); if (!File.Exists(filename)) { m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: downloading..."); - c.DownloadFile(imageURL, filename); + using(WebClient c = new WebClient()) + c.DownloadFile(imageURL, filename); } else { @@ -189,11 +199,10 @@ namespace OpenSim.Services.Connectors.Hypergrid ass.Data = imageData; - mapTile = ass.FullID; - - // finally m_AssetService.Store(ass); + // finally + mapTile = ass.FullID; } catch // LEGIT: Catching problems caused by OpenJPEG p/invoke { diff --git a/OpenSim/Services/Connectors/Hypergrid/HGFriendsServicesConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HGFriendsServicesConnector.cs index 622d4e1..8b31fa2 100644 --- a/OpenSim/Services/Connectors/Hypergrid/HGFriendsServicesConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/HGFriendsServicesConnector.cs @@ -277,7 +277,10 @@ namespace OpenSim.Services.Connectors.Hypergrid { reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, - ServerUtils.BuildQueryString(sendData), 15); + ServerUtils.BuildQueryString(sendData), + 15, + null, + false); } catch (Exception e) { diff --git a/OpenSim/Services/Connectors/Hypergrid/HeloServicesConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HeloServicesConnector.cs index b5e6d69..91e1740 100644 --- a/OpenSim/Services/Connectors/Hypergrid/HeloServicesConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/HeloServicesConnector.cs @@ -33,7 +33,7 @@ using Nini.Config; namespace OpenSim.Services.Connectors { - public class HeloServicesConnector + public class HeloServicesConnector { private static readonly ILog m_log = LogManager.GetLogger( diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 8abd046..f2bb52a 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -70,9 +70,14 @@ namespace OpenSim.Services.Connectors.Hypergrid { Uri m_Uri = new Uri(m_ServerURL); IPAddress ip = Util.GetHostFromDNS(m_Uri.Host); - m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); - if (!m_ServerURL.EndsWith("/")) - m_ServerURL += "/"; + if(ip != null) + { + m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); + if (!m_ServerURL.EndsWith("/")) + m_ServerURL += "/"; + } + else + m_log.DebugFormat("[USER AGENT CONNECTOR]: Failed to resolv address of {0}", url); } catch (Exception e) { @@ -113,7 +118,7 @@ namespace OpenSim.Services.Connectors.Hypergrid return "homeagent/"; } - // The Login service calls this interface with fromLogin=true + // The Login service calls this interface with fromLogin=true // Sims call it with fromLogin=false // Either way, this is verified by the handler public bool LoginAgentToGrid(GridRegion source, AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, bool fromLogin, out string reason) @@ -138,7 +143,8 @@ namespace OpenSim.Services.Connectors.Hypergrid Console.WriteLine(" >>> LoginAgentToGrid <<< " + home.ServerURI); uint flags = fromLogin ? (uint)TeleportFlags.ViaLogin : (uint)TeleportFlags.ViaHome; - return CreateAgent(source, home, aCircuit, flags, out reason); + EntityTransferContext ctx = new EntityTransferContext(); + return CreateAgent(source, home, aCircuit, flags, ctx, out reason); } @@ -158,7 +164,7 @@ namespace OpenSim.Services.Connectors.Hypergrid } public void SetClientToken(UUID sessionID, string token) - { + { // no-op } @@ -415,7 +421,7 @@ namespace OpenSim.Services.Connectors.Hypergrid XmlRpcRequest request = new XmlRpcRequest("get_online_friends", paramList); // string reason = string.Empty; - + // Send and get reply List online = new List(); XmlRpcResponse response = null; @@ -496,7 +502,7 @@ namespace OpenSim.Services.Connectors.Hypergrid hash["userID"] = userID.ToString(); hash = CallServer("get_server_urls", hash); - + Dictionary serverURLs = new Dictionary(); foreach (object key in hash.Keys) { @@ -515,7 +521,7 @@ namespace OpenSim.Services.Connectors.Hypergrid Hashtable hash = new Hashtable(); hash["userID"] = userID.ToString(); - hash = CallServer("locate_user", hash); + hash = CallServer("locate_user", hash); string url = string.Empty; @@ -571,7 +577,11 @@ namespace OpenSim.Services.Connectors.Hypergrid XmlRpcResponse response = null; try { - response = request.Send(m_ServerURL, 10000); + // We can not use m_ServerURL here anymore because it causes + // the HTTP request to be built without a host name. This messes + // with OSGrid's NGINX and can make OSGrid avatars unable to TP + // to other grids running recent mono. + response = request.Send(m_ServerURLHost, 10000); } catch (Exception e) { -- cgit v1.1