mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
When teleporting using Hypergrid, show more informative error messages in case of error
This commit is contained in:
@@ -529,14 +529,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
if (reg != null)
|
||||
{
|
||||
finalDestination = GetFinalDestination(reg);
|
||||
string message;
|
||||
finalDestination = GetFinalDestination(reg, out message);
|
||||
|
||||
if (finalDestination == null)
|
||||
{
|
||||
m_log.WarnFormat( "{0} Final destination is having problems. Unable to teleport {1} {2}",
|
||||
LogHeader, sp.Name, sp.UUID);
|
||||
m_log.WarnFormat( "{0} Final destination is having problems. Unable to teleport {1} {2}: {3}",
|
||||
LogHeader, sp.Name, sp.UUID, message);
|
||||
|
||||
sp.ControllingClient.SendTeleportFailed("Problem at destination");
|
||||
sp.ControllingClient.SendTeleportFailed(message);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -557,6 +558,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return;
|
||||
}
|
||||
|
||||
if (message != null)
|
||||
sp.ControllingClient.SendAgentAlertMessage(message, true);
|
||||
|
||||
//
|
||||
// This is it
|
||||
//
|
||||
@@ -1327,8 +1331,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
scene.SendKillObject(new List<uint> { localID });
|
||||
}
|
||||
|
||||
protected virtual GridRegion GetFinalDestination(GridRegion region)
|
||||
protected virtual GridRegion GetFinalDestination(GridRegion region, out string message)
|
||||
{
|
||||
message = null;
|
||||
return region;
|
||||
}
|
||||
|
||||
|
||||
@@ -225,19 +225,20 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
#region HG overrides of IEntiryTransferModule
|
||||
|
||||
protected override GridRegion GetFinalDestination(GridRegion region)
|
||||
protected override GridRegion GetFinalDestination(GridRegion region, out string message)
|
||||
{
|
||||
int flags = Scene.GridService.GetRegionFlags(Scene.RegionInfo.ScopeID, region.RegionID);
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: region {0} flags: {1}", region.RegionName, flags);
|
||||
message = null;
|
||||
|
||||
if ((flags & (int)OpenSim.Framework.RegionFlags.Hyperlink) != 0)
|
||||
{
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region is hyperlink");
|
||||
GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID);
|
||||
GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID, out message);
|
||||
if (real_destination != null)
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination serveruri -> {0}", real_destination.ServerURI);
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination: ServerURI={0}", real_destination.ServerURI);
|
||||
else
|
||||
m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: GetHyperlinkRegion to Gatekeeper {0} failed", region.ServerURI);
|
||||
m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: GetHyperlinkRegion of region {0} from Gatekeeper {1} failed: {2}", region.RegionID, region.ServerURI, message);
|
||||
return real_destination;
|
||||
}
|
||||
|
||||
@@ -533,7 +534,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
GatekeeperServiceConnector gConn = new GatekeeperServiceConnector();
|
||||
GridRegion gatekeeper = new GridRegion();
|
||||
gatekeeper.ServerURI = lm.Gatekeeper;
|
||||
GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID));
|
||||
string message;
|
||||
GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID), out message);
|
||||
|
||||
if (finalDestination != null)
|
||||
{
|
||||
@@ -541,9 +543,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
IEntityTransferModule transferMod = scene.RequestModuleInterface<IEntityTransferModule>();
|
||||
|
||||
if (transferMod != null && sp != null)
|
||||
{
|
||||
if (message != null)
|
||||
sp.ControllingClient.SendAgentAlertMessage(message, true);
|
||||
|
||||
transferMod.DoTeleport(
|
||||
sp, gatekeeper, finalDestination, lm.Position, Vector3.UnitX,
|
||||
(uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
remoteClient.SendTeleportFailed(message);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user