From 4d770082d5dbae95e090c13b12e2c0aad22d8916 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 15 Aug 2014 18:06:04 +0100 Subject: [PATCH] let failed crossing say something abotu reason --- .../EntityTransfer/EntityTransferModule.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 2bbb0a0ef0..cde7f60b75 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1381,10 +1381,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer #region Agent Crossings - public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, out uint xDest, out uint yDest, out string version, out Vector3 newpos) + { + string r = String.Empty; + return GetDestination(scene, agentID, pos, out xDest, out yDest, out version, out newpos, out r); + } + + public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, out uint xDest, out uint yDest, out string version, out Vector3 newpos, out string reason) { version = String.Empty; + reason = String.Empty; newpos = pos; // m_log.DebugFormat( @@ -1498,8 +1504,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } GridRegion neighbourRegion = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); - - string reason; + if (!scene.SimulationService.QueryAccess(neighbourRegion, agentID, newpos, out version, out reason)) { if (r == null) @@ -1525,11 +1530,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer uint y; Vector3 newpos; string version; + string reason; - GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, agent.AbsolutePosition, out x, out y, out version, out newpos); + GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, agent.AbsolutePosition, out x, out y, out version, out newpos, out reason); if (neighbourRegion == null) { - agent.ControllingClient.SendAlertMessage("Cannot region cross into void"); + if (reason == String.Empty) + agent.ControllingClient.SendAlertMessage("Cannot cross to region"); + else + agent.ControllingClient.SendAlertMessage("Cannot cross to region: " + reason); return false; }