aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorOren Hurvitz2014-04-03 12:47:20 +0300
committerOren Hurvitz2014-04-03 14:13:03 +0100
commit6d2893be67fd725090b69f5f31c0985c3d211135 (patch)
tree6dd6ff48ed74f751730930635638b3a54fce4b7f /OpenSim
parentBulletSim: make avatar physical shape to be a rectangle rather than (diff)
downloadopensim-SC_OLD-6d2893be67fd725090b69f5f31c0985c3d211135.zip
opensim-SC_OLD-6d2893be67fd725090b69f5f31c0985c3d211135.tar.gz
opensim-SC_OLD-6d2893be67fd725090b69f5f31c0985c3d211135.tar.bz2
opensim-SC_OLD-6d2893be67fd725090b69f5f31c0985c3d211135.tar.xz
When teleporting using Hypergrid, show more informative error messages in case of error
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs13
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs15
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs22
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs9
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs13
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs13
-rw-r--r--OpenSim/Services/Interfaces/IHypergridServices.cs2
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs3
8 files changed, 74 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
index a34f2d2..317f0e9 100644
--- a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
@@ -239,16 +239,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
239 GatekeeperServiceConnector gConn = new GatekeeperServiceConnector(); 239 GatekeeperServiceConnector gConn = new GatekeeperServiceConnector();
240 GridRegion gatekeeper = new GridRegion(); 240 GridRegion gatekeeper = new GridRegion();
241 gatekeeper.ServerURI = url; 241 gatekeeper.ServerURI = url;
242 GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(im.RegionID)); 242 string message;
243 GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(im.RegionID), out message);
243 if (finalDestination != null) 244 if (finalDestination != null)
244 { 245 {
245 ScenePresence sp = scene.GetScenePresence(client.AgentId); 246 ScenePresence sp = scene.GetScenePresence(client.AgentId);
246 IEntityTransferModule transferMod = scene.RequestModuleInterface<IEntityTransferModule>(); 247 IEntityTransferModule transferMod = scene.RequestModuleInterface<IEntityTransferModule>();
247 248
248 if (transferMod != null && sp != null) 249 if (transferMod != null && sp != null)
250 {
251 if (message != null)
252 sp.ControllingClient.SendAgentAlertMessage(message, true);
253
249 transferMod.DoTeleport( 254 transferMod.DoTeleport(
250 sp, gatekeeper, finalDestination, im.Position + new Vector3(0.5f, 0.5f, 0f), 255 sp, gatekeeper, finalDestination, im.Position + new Vector3(0.5f, 0.5f, 0f),
251 Vector3.UnitX, teleportflags); 256 Vector3.UnitX, teleportflags);
257 }
258 }
259 else
260 {
261 m_log.InfoFormat("[HG LURE MODULE]: Lure failed: {0}", message);
262 client.SendAgentAlertMessage(message, true);
252 } 263 }
253 } 264 }
254 } 265 }
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index caeb4f8..92ea62c 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -529,14 +529,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
529 529
530 if (reg != null) 530 if (reg != null)
531 { 531 {
532 finalDestination = GetFinalDestination(reg); 532 string message;
533 finalDestination = GetFinalDestination(reg, out message);
533 534
534 if (finalDestination == null) 535 if (finalDestination == null)
535 { 536 {
536 m_log.WarnFormat( "{0} Final destination is having problems. Unable to teleport {1} {2}", 537 m_log.WarnFormat( "{0} Final destination is having problems. Unable to teleport {1} {2}: {3}",
537 LogHeader, sp.Name, sp.UUID); 538 LogHeader, sp.Name, sp.UUID, message);
538 539
539 sp.ControllingClient.SendTeleportFailed("Problem at destination"); 540 sp.ControllingClient.SendTeleportFailed(message);
540 return; 541 return;
541 } 542 }
542 543
@@ -557,6 +558,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
557 return; 558 return;
558 } 559 }
559 560
561 if (message != null)
562 sp.ControllingClient.SendAgentAlertMessage(message, true);
563
560 // 564 //
561 // This is it 565 // This is it
562 // 566 //
@@ -1327,8 +1331,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1327 scene.SendKillObject(new List<uint> { localID }); 1331 scene.SendKillObject(new List<uint> { localID });
1328 } 1332 }
1329 1333
1330 protected virtual GridRegion GetFinalDestination(GridRegion region) 1334 protected virtual GridRegion GetFinalDestination(GridRegion region, out string message)
1331 { 1335 {
1336 message = null;
1332 return region; 1337 return region;
1333 } 1338 }
1334 1339
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index e354522..fa05c90 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -225,19 +225,20 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
225 225
226 #region HG overrides of IEntiryTransferModule 226 #region HG overrides of IEntiryTransferModule
227 227
228 protected override GridRegion GetFinalDestination(GridRegion region) 228 protected override GridRegion GetFinalDestination(GridRegion region, out string message)
229 { 229 {
230 int flags = Scene.GridService.GetRegionFlags(Scene.RegionInfo.ScopeID, region.RegionID); 230 int flags = Scene.GridService.GetRegionFlags(Scene.RegionInfo.ScopeID, region.RegionID);
231 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: region {0} flags: {1}", region.RegionName, flags); 231 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: region {0} flags: {1}", region.RegionName, flags);
232 message = null;
232 233
233 if ((flags & (int)OpenSim.Framework.RegionFlags.Hyperlink) != 0) 234 if ((flags & (int)OpenSim.Framework.RegionFlags.Hyperlink) != 0)
234 { 235 {
235 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region is hyperlink"); 236 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region is hyperlink");
236 GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID); 237 GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID, out message);
237 if (real_destination != null) 238 if (real_destination != null)
238 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination serveruri -> {0}", real_destination.ServerURI); 239 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination: ServerURI={0}", real_destination.ServerURI);
239 else 240 else
240 m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: GetHyperlinkRegion to Gatekeeper {0} failed", region.ServerURI); 241 m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: GetHyperlinkRegion of region {0} from Gatekeeper {1} failed: {2}", region.RegionID, region.ServerURI, message);
241 return real_destination; 242 return real_destination;
242 } 243 }
243 244
@@ -533,7 +534,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
533 GatekeeperServiceConnector gConn = new GatekeeperServiceConnector(); 534 GatekeeperServiceConnector gConn = new GatekeeperServiceConnector();
534 GridRegion gatekeeper = new GridRegion(); 535 GridRegion gatekeeper = new GridRegion();
535 gatekeeper.ServerURI = lm.Gatekeeper; 536 gatekeeper.ServerURI = lm.Gatekeeper;
536 GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID)); 537 string message;
538 GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID), out message);
537 539
538 if (finalDestination != null) 540 if (finalDestination != null)
539 { 541 {
@@ -541,9 +543,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
541 IEntityTransferModule transferMod = scene.RequestModuleInterface<IEntityTransferModule>(); 543 IEntityTransferModule transferMod = scene.RequestModuleInterface<IEntityTransferModule>();
542 544
543 if (transferMod != null && sp != null) 545 if (transferMod != null && sp != null)
546 {
547 if (message != null)
548 sp.ControllingClient.SendAgentAlertMessage(message, true);
549
544 transferMod.DoTeleport( 550 transferMod.DoTeleport(
545 sp, gatekeeper, finalDestination, lm.Position, Vector3.UnitX, 551 sp, gatekeeper, finalDestination, lm.Position, Vector3.UnitX,
546 (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark)); 552 (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark));
553 }
554 }
555 else
556 {
557 remoteClient.SendTeleportFailed(message);
558 return;
547 } 559 }
548 560
549 } 561 }
diff --git a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs
index f25e6e0..a89d7f7 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs
@@ -94,11 +94,14 @@ namespace OpenSim.Server.Handlers.Hypergrid
94 UUID regionID = UUID.Zero; 94 UUID regionID = UUID.Zero;
95 UUID.TryParse(regionID_str, out regionID); 95 UUID.TryParse(regionID_str, out regionID);
96 96
97 GridRegion regInfo = m_GatekeeperService.GetHyperlinkRegion(regionID); 97 string message;
98 GridRegion regInfo = m_GatekeeperService.GetHyperlinkRegion(regionID, out message);
98 99
99 Hashtable hash = new Hashtable(); 100 Hashtable hash = new Hashtable();
100 if (regInfo == null) 101 if (regInfo == null)
102 {
101 hash["result"] = "false"; 103 hash["result"] = "false";
104 }
102 else 105 else
103 { 106 {
104 hash["result"] = "true"; 107 hash["result"] = "true";
@@ -112,6 +115,10 @@ namespace OpenSim.Server.Handlers.Hypergrid
112 hash["http_port"] = regInfo.HttpPort.ToString(); 115 hash["http_port"] = regInfo.HttpPort.ToString();
113 hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString(); 116 hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString();
114 } 117 }
118
119 if (message != null)
120 hash["message"] = message;
121
115 XmlRpcResponse response = new XmlRpcResponse(); 122 XmlRpcResponse response = new XmlRpcResponse();
116 response.Value = hash; 123 response.Value = hash;
117 return response; 124 return response;
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index 5d7dcfd..8b1cc27 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -202,7 +202,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
202 return mapTile; 202 return mapTile;
203 } 203 }
204 204
205 public GridRegion GetHyperlinkRegion(GridRegion gatekeeper, UUID regionID) 205 public GridRegion GetHyperlinkRegion(GridRegion gatekeeper, UUID regionID, out string message)
206 { 206 {
207 Hashtable hash = new Hashtable(); 207 Hashtable hash = new Hashtable();
208 hash["region_uuid"] = regionID.ToString(); 208 hash["region_uuid"] = regionID.ToString();
@@ -219,12 +219,14 @@ namespace OpenSim.Services.Connectors.Hypergrid
219 } 219 }
220 catch (Exception e) 220 catch (Exception e)
221 { 221 {
222 message = "Error contacting grid.";
222 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Exception " + e.Message); 223 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Exception " + e.Message);
223 return null; 224 return null;
224 } 225 }
225 226
226 if (response.IsFault) 227 if (response.IsFault)
227 { 228 {
229 message = "Error contacting grid.";
228 m_log.ErrorFormat("[GATEKEEPER SERVICE CONNECTOR]: remote call returned an error: {0}", response.FaultString); 230 m_log.ErrorFormat("[GATEKEEPER SERVICE CONNECTOR]: remote call returned an error: {0}", response.FaultString);
229 return null; 231 return null;
230 } 232 }
@@ -236,6 +238,14 @@ namespace OpenSim.Services.Connectors.Hypergrid
236 { 238 {
237 bool success = false; 239 bool success = false;
238 Boolean.TryParse((string)hash["result"], out success); 240 Boolean.TryParse((string)hash["result"], out success);
241
242 if (hash["message"] != null)
243 message = (string)hash["message"];
244 else if (success)
245 message = null;
246 else
247 message = "The teleport destination could not be found."; // probably the dest grid is old and doesn't send 'message', but the most common problem is that the region is unavailable
248
239 if (success) 249 if (success)
240 { 250 {
241 GridRegion region = new GridRegion(); 251 GridRegion region = new GridRegion();
@@ -305,6 +315,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
305 } 315 }
306 catch (Exception e) 316 catch (Exception e)
307 { 317 {
318 message = "Error parsing response from grid.";
308 m_log.Error("[GATEKEEPER SERVICE CONNECTOR]: Got exception while parsing hyperlink response " + e.StackTrace); 319 m_log.Error("[GATEKEEPER SERVICE CONNECTOR]: Got exception while parsing hyperlink response " + e.StackTrace);
309 return null; 320 return null;
310 } 321 }
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 7a0228b..e9d41c7 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -204,15 +204,26 @@ namespace OpenSim.Services.HypergridService
204 return true; 204 return true;
205 } 205 }
206 206
207 public GridRegion GetHyperlinkRegion(UUID regionID) 207 public GridRegion GetHyperlinkRegion(UUID regionID, out string message)
208 { 208 {
209 m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to get hyperlink region {0}", regionID); 209 m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to get hyperlink region {0}", regionID);
210 message = null;
210 211
211 if (!m_AllowTeleportsToAnyRegion) 212 if (!m_AllowTeleportsToAnyRegion)
213 {
212 // Don't even check the given regionID 214 // Don't even check the given regionID
215 message = "Teleporting to the default region.";
213 return m_DefaultGatewayRegion; 216 return m_DefaultGatewayRegion;
217 }
214 218
215 GridRegion region = m_GridService.GetRegionByUUID(m_ScopeID, regionID); 219 GridRegion region = m_GridService.GetRegionByUUID(m_ScopeID, regionID);
220
221 if (region == null)
222 {
223 message = "The teleport destination could not be found.";
224 return null;
225 }
226
216 return region; 227 return region;
217 } 228 }
218 229
diff --git a/OpenSim/Services/Interfaces/IHypergridServices.cs b/OpenSim/Services/Interfaces/IHypergridServices.cs
index bece4c7..a846bad 100644
--- a/OpenSim/Services/Interfaces/IHypergridServices.cs
+++ b/OpenSim/Services/Interfaces/IHypergridServices.cs
@@ -37,7 +37,7 @@ namespace OpenSim.Services.Interfaces
37 public interface IGatekeeperService 37 public interface IGatekeeperService
38 { 38 {
39 bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason); 39 bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason);
40 GridRegion GetHyperlinkRegion(UUID regionID); 40 GridRegion GetHyperlinkRegion(UUID regionID, out string message);
41 41
42 bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason); 42 bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason);
43 43
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index b61b5e8..6d6e3d6 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -750,9 +750,10 @@ namespace OpenSim.Services.LLLoginService
750 UUID regionID; 750 UUID regionID;
751 ulong handle; 751 ulong handle;
752 string imageURL = string.Empty, reason = string.Empty; 752 string imageURL = string.Empty, reason = string.Empty;
753 string message;
753 if (m_GatekeeperConnector.LinkRegion(gatekeeper, out regionID, out handle, out domainName, out imageURL, out reason)) 754 if (m_GatekeeperConnector.LinkRegion(gatekeeper, out regionID, out handle, out domainName, out imageURL, out reason))
754 { 755 {
755 GridRegion destination = m_GatekeeperConnector.GetHyperlinkRegion(gatekeeper, regionID); 756 GridRegion destination = m_GatekeeperConnector.GetHyperlinkRegion(gatekeeper, regionID, out message);
756 return destination; 757 return destination;
757 } 758 }
758 759