Improve teleport log debug and error messages to tell us who is teleporting.

0.7.3-extended
Justin Clark-Casey (justincc) 2012-04-25 00:19:38 +01:00
parent eda6947a22
commit 0d06740148
1 changed files with 13 additions and 4 deletions

View File

@ -167,13 +167,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Reset animations; the viewer does that in teleports. // Reset animations; the viewer does that in teleports.
sp.Animator.ResetAnimations(); sp.Animator.ResetAnimations();
string destinationRegionName = "(not found)";
try try
{ {
if (regionHandle == sp.Scene.RegionInfo.RegionHandle) if (regionHandle == sp.Scene.RegionInfo.RegionHandle)
{ {
destinationRegionName = sp.Scene.RegionInfo.RegionName;
m_log.DebugFormat( m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: RequestTeleportToLocation {0} within {1}", "[ENTITY TRANSFER MODULE]: RequestTeleportToLocation for {0} to {1} within existing region {2}",
position, sp.Scene.RegionInfo.RegionName); sp.Name, position, destinationRegionName);
// Teleport within the same region // Teleport within the same region
if (IsOutsideRegion(sp.Scene, position) || position.Z < 0) if (IsOutsideRegion(sp.Scene, position) || position.Z < 0)
@ -183,6 +187,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_log.WarnFormat( m_log.WarnFormat(
"[ENTITY TRANSFER MODULE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", "[ENTITY TRANSFER MODULE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}",
position, sp.Name, sp.UUID, emergencyPos); position, sp.Name, sp.UUID, emergencyPos);
position = emergencyPos; position = emergencyPos;
} }
@ -227,7 +232,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
sp.ControllingClient.SendTeleportFailed("Problem at destination"); sp.ControllingClient.SendTeleportFailed("Problem at destination");
return; return;
} }
uint curX = 0, curY = 0; uint curX = 0, curY = 0;
Utils.LongToUInts(sp.Scene.RegionInfo.RegionHandle, out curX, out curY); Utils.LongToUInts(sp.Scene.RegionInfo.RegionHandle, out curX, out curY);
int curCellX = (int)(curX / Constants.RegionSize); int curCellX = (int)(curX / Constants.RegionSize);
@ -292,7 +297,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
} }
catch (Exception e) catch (Exception e)
{ {
m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Exception on teleport: {0} {1}", e.Message, e.StackTrace); m_log.ErrorFormat(
"[ENTITY TRANSFER MODULE]: Exception on teleport of {0} from {1}@{2} to {3}@{4}: {5}{6}",
sp.Name, sp.AbsolutePosition, sp.Scene.RegionInfo.RegionName, position, destinationRegionName,
e.Message, e.StackTrace);
sp.ControllingClient.SendTeleportFailed("Internal error"); sp.ControllingClient.SendTeleportFailed("Internal error");
} }
} }