diff options
author | onefang | 2019-05-19 21:24:15 +1000 |
---|---|---|
committer | onefang | 2019-05-19 21:24:15 +1000 |
commit | 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch) | |
tree | a9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Services/Connectors/Hypergrid | |
parent | Add a build script. (diff) | |
download | opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2 opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz |
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Services/Connectors/Hypergrid')
4 files changed, 41 insertions, 19 deletions
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 | |||
73 | return "foreignobject/"; | 73 | return "foreignobject/"; |
74 | } | 74 | } |
75 | 75 | ||
76 | public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason) | 76 | 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) |
77 | { | 77 | { |
78 | regionID = UUID.Zero; | 78 | regionID = UUID.Zero; |
79 | imageURL = string.Empty; | 79 | imageURL = string.Empty; |
80 | realHandle = 0; | 80 | realHandle = 0; |
81 | externalName = string.Empty; | 81 | externalName = string.Empty; |
82 | reason = string.Empty; | 82 | reason = string.Empty; |
83 | sizeX = (int)Constants.RegionSize; | ||
84 | sizeY = (int)Constants.RegionSize; | ||
83 | 85 | ||
84 | Hashtable hash = new Hashtable(); | 86 | Hashtable hash = new Hashtable(); |
85 | hash["region_name"] = info.RegionName; | 87 | hash["region_name"] = info.RegionName; |
@@ -134,8 +136,15 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
134 | externalName = (string)hash["external_name"]; | 136 | externalName = (string)hash["external_name"]; |
135 | //m_log.Debug(">> HERE, externalName: " + externalName); | 137 | //m_log.Debug(">> HERE, externalName: " + externalName); |
136 | } | 138 | } |
139 | if (hash["size_x"] != null) | ||
140 | { | ||
141 | Int32.TryParse((string)hash["size_x"], out sizeX); | ||
142 | } | ||
143 | if (hash["size_y"] != null) | ||
144 | { | ||
145 | Int32.TryParse((string)hash["size_y"], out sizeY); | ||
146 | } | ||
137 | } | 147 | } |
138 | |||
139 | } | 148 | } |
140 | catch (Exception e) | 149 | catch (Exception e) |
141 | { | 150 | { |
@@ -160,14 +169,15 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
160 | 169 | ||
161 | try | 170 | try |
162 | { | 171 | { |
163 | WebClient c = new WebClient(); | 172 | //m_log.Debug("JPEG: " + imageURL); |
164 | string name = regionID.ToString(); | 173 | string name = regionID.ToString(); |
165 | filename = Path.Combine(storagePath, name + ".jpg"); | 174 | filename = Path.Combine(storagePath, name + ".jpg"); |
166 | m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: Map image at {0}, cached at {1}", imageURL, filename); | 175 | m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: Map image at {0}, cached at {1}", imageURL, filename); |
167 | if (!File.Exists(filename)) | 176 | if (!File.Exists(filename)) |
168 | { | 177 | { |
169 | m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: downloading..."); | 178 | m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: downloading..."); |
170 | c.DownloadFile(imageURL, filename); | 179 | using(WebClient c = new WebClient()) |
180 | c.DownloadFile(imageURL, filename); | ||
171 | } | 181 | } |
172 | else | 182 | else |
173 | { | 183 | { |
@@ -189,11 +199,10 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
189 | 199 | ||
190 | ass.Data = imageData; | 200 | ass.Data = imageData; |
191 | 201 | ||
192 | mapTile = ass.FullID; | ||
193 | |||
194 | // finally | ||
195 | m_AssetService.Store(ass); | 202 | m_AssetService.Store(ass); |
196 | 203 | ||
204 | // finally | ||
205 | mapTile = ass.FullID; | ||
197 | } | 206 | } |
198 | catch // LEGIT: Catching problems caused by OpenJPEG p/invoke | 207 | catch // LEGIT: Catching problems caused by OpenJPEG p/invoke |
199 | { | 208 | { |
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 | |||
277 | { | 277 | { |
278 | reply = SynchronousRestFormsRequester.MakeRequest("POST", | 278 | reply = SynchronousRestFormsRequester.MakeRequest("POST", |
279 | uri, | 279 | uri, |
280 | ServerUtils.BuildQueryString(sendData), 15); | 280 | ServerUtils.BuildQueryString(sendData), |
281 | 15, | ||
282 | null, | ||
283 | false); | ||
281 | } | 284 | } |
282 | catch (Exception e) | 285 | catch (Exception e) |
283 | { | 286 | { |
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; | |||
33 | 33 | ||
34 | namespace OpenSim.Services.Connectors | 34 | namespace OpenSim.Services.Connectors |
35 | { | 35 | { |
36 | public class HeloServicesConnector | 36 | public class HeloServicesConnector |
37 | { | 37 | { |
38 | private static readonly ILog m_log = | 38 | private static readonly ILog m_log = |
39 | LogManager.GetLogger( | 39 | 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 | |||
70 | { | 70 | { |
71 | Uri m_Uri = new Uri(m_ServerURL); | 71 | Uri m_Uri = new Uri(m_ServerURL); |
72 | IPAddress ip = Util.GetHostFromDNS(m_Uri.Host); | 72 | IPAddress ip = Util.GetHostFromDNS(m_Uri.Host); |
73 | m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); | 73 | if(ip != null) |
74 | if (!m_ServerURL.EndsWith("/")) | 74 | { |
75 | m_ServerURL += "/"; | 75 | m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); |
76 | if (!m_ServerURL.EndsWith("/")) | ||
77 | m_ServerURL += "/"; | ||
78 | } | ||
79 | else | ||
80 | m_log.DebugFormat("[USER AGENT CONNECTOR]: Failed to resolv address of {0}", url); | ||
76 | } | 81 | } |
77 | catch (Exception e) | 82 | catch (Exception e) |
78 | { | 83 | { |
@@ -113,7 +118,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
113 | return "homeagent/"; | 118 | return "homeagent/"; |
114 | } | 119 | } |
115 | 120 | ||
116 | // The Login service calls this interface with fromLogin=true | 121 | // The Login service calls this interface with fromLogin=true |
117 | // Sims call it with fromLogin=false | 122 | // Sims call it with fromLogin=false |
118 | // Either way, this is verified by the handler | 123 | // Either way, this is verified by the handler |
119 | public bool LoginAgentToGrid(GridRegion source, AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, bool fromLogin, out string reason) | 124 | 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 | |||
138 | Console.WriteLine(" >>> LoginAgentToGrid <<< " + home.ServerURI); | 143 | Console.WriteLine(" >>> LoginAgentToGrid <<< " + home.ServerURI); |
139 | 144 | ||
140 | uint flags = fromLogin ? (uint)TeleportFlags.ViaLogin : (uint)TeleportFlags.ViaHome; | 145 | uint flags = fromLogin ? (uint)TeleportFlags.ViaLogin : (uint)TeleportFlags.ViaHome; |
141 | return CreateAgent(source, home, aCircuit, flags, out reason); | 146 | EntityTransferContext ctx = new EntityTransferContext(); |
147 | return CreateAgent(source, home, aCircuit, flags, ctx, out reason); | ||
142 | } | 148 | } |
143 | 149 | ||
144 | 150 | ||
@@ -158,7 +164,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
158 | } | 164 | } |
159 | 165 | ||
160 | public void SetClientToken(UUID sessionID, string token) | 166 | public void SetClientToken(UUID sessionID, string token) |
161 | { | 167 | { |
162 | // no-op | 168 | // no-op |
163 | } | 169 | } |
164 | 170 | ||
@@ -415,7 +421,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
415 | 421 | ||
416 | XmlRpcRequest request = new XmlRpcRequest("get_online_friends", paramList); | 422 | XmlRpcRequest request = new XmlRpcRequest("get_online_friends", paramList); |
417 | // string reason = string.Empty; | 423 | // string reason = string.Empty; |
418 | 424 | ||
419 | // Send and get reply | 425 | // Send and get reply |
420 | List<UUID> online = new List<UUID>(); | 426 | List<UUID> online = new List<UUID>(); |
421 | XmlRpcResponse response = null; | 427 | XmlRpcResponse response = null; |
@@ -496,7 +502,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
496 | hash["userID"] = userID.ToString(); | 502 | hash["userID"] = userID.ToString(); |
497 | 503 | ||
498 | hash = CallServer("get_server_urls", hash); | 504 | hash = CallServer("get_server_urls", hash); |
499 | 505 | ||
500 | Dictionary<string, object> serverURLs = new Dictionary<string, object>(); | 506 | Dictionary<string, object> serverURLs = new Dictionary<string, object>(); |
501 | foreach (object key in hash.Keys) | 507 | foreach (object key in hash.Keys) |
502 | { | 508 | { |
@@ -515,7 +521,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
515 | Hashtable hash = new Hashtable(); | 521 | Hashtable hash = new Hashtable(); |
516 | hash["userID"] = userID.ToString(); | 522 | hash["userID"] = userID.ToString(); |
517 | 523 | ||
518 | hash = CallServer("locate_user", hash); | 524 | hash = CallServer("locate_user", hash); |
519 | 525 | ||
520 | string url = string.Empty; | 526 | string url = string.Empty; |
521 | 527 | ||
@@ -571,7 +577,11 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
571 | XmlRpcResponse response = null; | 577 | XmlRpcResponse response = null; |
572 | try | 578 | try |
573 | { | 579 | { |
574 | response = request.Send(m_ServerURL, 10000); | 580 | // We can not use m_ServerURL here anymore because it causes |
581 | // the HTTP request to be built without a host name. This messes | ||
582 | // with OSGrid's NGINX and can make OSGrid avatars unable to TP | ||
583 | // to other grids running recent mono. | ||
584 | response = request.Send(m_ServerURLHost, 10000); | ||
575 | } | 585 | } |
576 | catch (Exception e) | 586 | catch (Exception e) |
577 | { | 587 | { |