aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs83
1 files changed, 53 insertions, 30 deletions
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index e15ac8c..b7dbb79 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -112,7 +112,7 @@ namespace OpenSim.Services.Connectors.Simulation
112 m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: Creating agent at {0}", destination.ServerURI); 112 m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: Creating agent at {0}", destination.ServerURI);
113 113
114 string uri = destination.ServerURI + AgentPath() + aCircuit.AgentID + "/"; 114 string uri = destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
115 115 OSD tmpOSD;
116 try 116 try
117 { 117 {
118 OSDMap args = aCircuit.PackAgentCircuitData(ctx); 118 OSDMap args = aCircuit.PackAgentCircuitData(ctx);
@@ -120,27 +120,37 @@ namespace OpenSim.Services.Connectors.Simulation
120 PackData(args, source, aCircuit, destination, flags); 120 PackData(args, source, aCircuit, destination, flags);
121 121
122 OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000); 122 OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000);
123 bool success = result["success"].AsBoolean(); 123 tmpOSD = result["success"];
124 if (success && result.ContainsKey("_Result")) 124 bool success = tmpOSD.AsBoolean();
125 if (success && result.TryGetValue("_Result", out tmpOSD) && tmpOSD is OSDMap)
125 { 126 {
126 OSDMap data = (OSDMap)result["_Result"]; 127 OSDMap data = (OSDMap)tmpOSD;
128
129 tmpOSD = data["reason"];
130 reason = tmpOSD.AsString();
127 131
128 reason = data["reason"].AsString(); 132 tmpOSD = data["success"];
129 success = data["success"].AsBoolean(); 133 success = tmpOSD.AsBoolean();
130 return success; 134 return success;
131 } 135 }
132 136
133 // Try the old version, uncompressed 137 // Try the old version, uncompressed
134 result = WebUtil.PostToService(uri, args, 30000, false); 138 result = WebUtil.PostToService(uri, args, 30000, false);
135 139
136 if (result["Success"].AsBoolean()) 140 tmpOSD = result["success"];
141 success = tmpOSD.AsBoolean();
142 if (success)
137 { 143 {
138 if (result.ContainsKey("_Result")) 144 if (result.TryGetValue("_Result", out tmpOSD) && tmpOSD is OSDMap)
139 { 145 {
140 OSDMap data = (OSDMap)result["_Result"]; 146 OSDMap data = (OSDMap)tmpOSD;
147
148 tmpOSD = data["reason"];
149 reason = tmpOSD.AsString();
150
151 tmpOSD = data["success"];
152 success = tmpOSD.AsBoolean();
141 153
142 reason = data["reason"].AsString();
143 success = data["success"].AsBoolean();
144 m_log.WarnFormat( 154 m_log.WarnFormat(
145 "[REMOTE SIMULATION CONNECTOR]: Remote simulator {0} did not accept compressed transfer, suggest updating it.", destination.RegionName); 155 "[REMOTE SIMULATION CONNECTOR]: Remote simulator {0} did not accept compressed transfer, suggest updating it.", destination.RegionName);
146 return success; 156 return success;
@@ -312,34 +322,47 @@ namespace OpenSim.Services.Connectors.Simulation
312 if (agentHomeURI != null) 322 if (agentHomeURI != null)
313 request.Add("agent_home_uri", OSD.FromString(agentHomeURI)); 323 request.Add("agent_home_uri", OSD.FromString(agentHomeURI));
314 324
325 OSD tmpOSD;
315 try 326 try
316 { 327 {
317 OSDMap result = WebUtil.ServiceOSDRequest(uri, request, "QUERYACCESS", 30000, false, false, true); 328 OSDMap result = WebUtil.ServiceOSDRequest(uri, request, "QUERYACCESS", 30000, false, false, true);
318 bool success = result["success"].AsBoolean(); 329
319 if (result.ContainsKey("_Result")) 330 tmpOSD = result["success"];
331 bool success = tmpOSD.AsBoolean();
332
333 bool has_Result = false;
334 if (result.TryGetValue("_Result", out tmpOSD))
320 { 335 {
321 OSDMap data = (OSDMap)result["_Result"]; 336 has_Result = true;
337 OSDMap data = (OSDMap)tmpOSD;
322 338
323 // FIXME: If there is a _Result map then it's the success key here that indicates the true success 339 // FIXME: If there is a _Result map then it's the success key here that indicates the true success
324 // or failure, not the sibling result node. 340 // or failure, not the sibling result node.
325 success = data["success"].AsBoolean(); 341 //nte4.8 crap
342 tmpOSD = data["success"];
343 success = tmpOSD.AsBoolean();
326 344
327 reason = data["reason"].AsString(); 345 tmpOSD = data["reason"];
346 reason = tmpOSD.AsString();
328 // We will need to plumb this and start sing the outbound version as well 347 // We will need to plumb this and start sing the outbound version as well
329 // TODO: lay the pipe for version plumbing 348 // TODO: lay the pipe for version plumbing
330 if (data.ContainsKey("negotiated_inbound_version") && data["negotiated_inbound_version"] != null) 349 if (data.TryGetValue("negotiated_inbound_version", out tmpOSD) && tmpOSD != null)
331 { 350 {
332 ctx.InboundVersion = (float)data["negotiated_inbound_version"].AsReal(); 351 ctx.InboundVersion = (float)tmpOSD.AsReal();
333 ctx.OutboundVersion = (float)data["negotiated_outbound_version"].AsReal(); 352 tmpOSD = data["negotiated_outbound_version"];
353 ctx.OutboundVersion = (float)tmpOSD.AsReal();
334 } 354 }
335 else if (data["version"] != null && data["version"].AsString() != string.Empty) 355 else if (data.TryGetValue("version", out tmpOSD) && tmpOSD != null)
336 { 356 {
337 string versionString = data["version"].AsString(); 357 string versionString = tmpOSD.AsString();
338 String[] parts = versionString.Split(new char[] {'/'}); 358 if(versionString != string.Empty)
339 if (parts.Length > 1)
340 { 359 {
341 ctx.InboundVersion = float.Parse(parts[1], Culture.FormatProvider); 360 String[] parts = versionString.Split(new char[] {'/'});
342 ctx.OutboundVersion = float.Parse(parts[1], Culture.FormatProvider); 361 if (parts.Length > 1)
362 {
363 ctx.InboundVersion = float.Parse(parts[1], Culture.FormatProvider);
364 ctx.OutboundVersion = float.Parse(parts[1], Culture.FormatProvider);
365 }
343 } 366 }
344 } 367 }
345 368
@@ -352,11 +375,11 @@ namespace OpenSim.Services.Connectors.Simulation
352 { 375 {
353 // If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the 376 // If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the
354 // actual failure message 377 // actual failure message
355 if (!result.ContainsKey("_Result")) 378 if (!has_Result)
356 { 379 {
357 if (result.ContainsKey("Message")) 380 if (result.TryGetValue("Message", out tmpOSD))
358 { 381 {
359 string message = result["Message"].AsString(); 382 string message = tmpOSD.AsString();
360 if (message == "Service request failed: [MethodNotAllowed] MethodNotAllowed") // Old style region 383 if (message == "Service request failed: [MethodNotAllowed] MethodNotAllowed") // Old style region
361 { 384 {
362 m_log.Info("[REMOTE SIMULATION CONNECTOR]: The above web util error was caused by a TP to a sim that doesn't support QUERYACCESS and can be ignored"); 385 m_log.Info("[REMOTE SIMULATION CONNECTOR]: The above web util error was caused by a TP to a sim that doesn't support QUERYACCESS and can be ignored");
@@ -376,9 +399,9 @@ namespace OpenSim.Services.Connectors.Simulation
376 399
377 featuresAvailable.Clear(); 400 featuresAvailable.Clear();
378 401
379 if (result.ContainsKey("features")) 402 if (result.TryGetValue("features", out tmpOSD) && tmpOSD is OSDArray)
380 { 403 {
381 OSDArray array = (OSDArray)result["features"]; 404 OSDArray array = (OSDArray)tmpOSD;
382 405
383 foreach (OSD o in array) 406 foreach (OSD o in array)
384 featuresAvailable.Add(new UUID(o.AsString())); 407 featuresAvailable.Add(new UUID(o.AsString()));