change a wrong error message and avoid a null ref (that may happen due to needed time delays)

melanie
UbitUmarov 2016-12-02 22:56:14 +00:00
parent 1fdd71f856
commit 6a8b8f3168
1 changed files with 11 additions and 13 deletions

View File

@ -2093,19 +2093,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
spScene.SimulationService.UpdateAgent(neighbour, agentpos); spScene.SimulationService.UpdateAgent(neighbour, agentpos);
} }
} }
catch (ArgumentOutOfRangeException)
{
m_log.ErrorFormat(
"[ENTITY TRANSFER MODULE]: Neighbour Regions response included the current region in the neighbour list. The following region will not display to the client: {0} for region {1} ({2}, {3}).",
neighbour.ExternalHostName,
neighbour.RegionHandle,
neighbour.RegionLocX,
neighbour.RegionLocY);
}
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat( m_log.ErrorFormat(
"[ENTITY TRANSFER MODULE]: Could not resolve external hostname {0} for region {1} ({2}, {3}). {4}", "[ENTITY TRANSFER MODULE]: Error creating child agent at {0} ({1} ({2}, {3}). {4}",
neighbour.ExternalHostName, neighbour.ExternalHostName,
neighbour.RegionHandle, neighbour.RegionHandle,
neighbour.RegionLocX, neighbour.RegionLocX,
@ -2279,24 +2270,28 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
/// <param name="a"></param> /// <param name="a"></param>
/// <param name="regionHandle"></param> /// <param name="regionHandle"></param>
/// <param name="endPoint"></param> /// <param name="endPoint"></param>
private void InformClientOfNeighbourAsync(ScenePresence sp, AgentCircuitData a, GridRegion reg, private void InformClientOfNeighbourAsync(ScenePresence sp, AgentCircuitData agentCircData, GridRegion reg,
IPEndPoint endPoint, bool newAgent) IPEndPoint endPoint, bool newAgent)
{ {
if (newAgent) if (newAgent)
{ {
// we may already had lost this sp
if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened
return;
Scene scene = sp.Scene; Scene scene = sp.Scene;
m_log.DebugFormat( m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Informing {0} {1} about neighbour {2} {3} at ({4},{5})", "[ENTITY TRANSFER MODULE]: Informing {0} {1} about neighbour {2} {3} at ({4},{5})",
sp.Name, sp.UUID, reg.RegionName, endPoint, reg.RegionCoordX, reg.RegionCoordY); sp.Name, sp.UUID, reg.RegionName, endPoint, reg.RegionCoordX, reg.RegionCoordY);
string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath); string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(agentCircData.CapsPath);
string reason = String.Empty; string reason = String.Empty;
EntityTransferContext ctx = new EntityTransferContext(); EntityTransferContext ctx = new EntityTransferContext();
bool regionAccepted = scene.SimulationService.CreateAgent(reg, reg, a, (uint)TeleportFlags.Default, ctx, out reason); bool regionAccepted = scene.SimulationService.CreateAgent(reg, reg, agentCircData, (uint)TeleportFlags.Default, ctx, out reason);
if (regionAccepted) if (regionAccepted)
{ {
@ -2306,6 +2301,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (m_eqModule != null) if (m_eqModule != null)
{ {
#region IP Translation for NAT #region IP Translation for NAT
if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened
return;
IClientIPEndpoint ipepClient; IClientIPEndpoint ipepClient;
if (sp.ClientView.TryGet(out ipepClient)) if (sp.ClientView.TryGet(out ipepClient))
{ {