From a27d33cb634c78425eaa34cb5efd113e131baa51 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 26 Nov 2009 12:16:42 +0000 Subject: Remove the old remoting-type interregion code for prim/script crossing --- .../Framework/Scenes/SceneCommunicationService.cs | 72 ---------------------- 1 file changed, 72 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 76c6cab..3892769 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -85,7 +85,6 @@ namespace OpenSim.Region.Framework.Scenes /// /// A Prim will arrive shortly /// - public event ExpectPrimDelegate OnExpectPrim; public event CloseAgentConnection OnCloseAgentConnection; /// @@ -116,7 +115,6 @@ namespace OpenSim.Region.Framework.Scenes private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser; - private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection; private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion; //private RegionUp handlerRegionUp = null; // OnRegionUp; @@ -147,30 +145,6 @@ namespace OpenSim.Region.Framework.Scenes /// Thrown if region registration fails. public void RegisterRegion(IInterregionCommsOut comms_out, RegionInfo regionInfos) { - //m_interregionCommsOut = comms_out; - - //m_regionInfo = regionInfos; - //m_commsProvider.GridService.gdebugRegionName = regionInfos.RegionName; - //regionCommsHost = m_commsProvider.GridService.RegisterRegion(m_regionInfo); - - //if (regionCommsHost != null) - //{ - // //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got" + regionCommsHost.ToString()); - - // regionCommsHost.debugRegionName = regionInfos.RegionName; - // regionCommsHost.OnExpectPrim += IncomingPrimCrossing; - // regionCommsHost.OnExpectUser += NewUserConnection; - // regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing; - // regionCommsHost.OnCloseAgentConnection += CloseConnection; - // regionCommsHost.OnRegionUp += newRegionUp; - // regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate; - // regionCommsHost.OnLogOffUser += GridLogOffUser; - // regionCommsHost.OnGetLandData += FetchLandData; - //} - //else - //{ - // //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got null"); - //} } /// @@ -179,31 +153,6 @@ namespace OpenSim.Region.Framework.Scenes /// public void Close() { - - //if (regionCommsHost != null) - //{ - // regionCommsHost.OnLogOffUser -= GridLogOffUser; - // regionCommsHost.OnChildAgentUpdate -= ChildAgentUpdate; - // regionCommsHost.OnRegionUp -= newRegionUp; - // regionCommsHost.OnExpectUser -= NewUserConnection; - // regionCommsHost.OnExpectPrim -= IncomingPrimCrossing; - // regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing; - // regionCommsHost.OnCloseAgentConnection -= CloseConnection; - // regionCommsHost.OnGetLandData -= FetchLandData; - - // try - // { - // m_commsProvider.GridService.DeregisterRegion(m_regionInfo); - // } - // catch (Exception e) - // { - // m_log.ErrorFormat( - // "[GRID]: Deregistration of region {0} from the grid failed - {1}. Continuing", - // m_regionInfo.RegionName, e); - // } - - // regionCommsHost = null; - //} } #region CommsManager Event handlers @@ -263,27 +212,6 @@ namespace OpenSim.Region.Framework.Scenes } } - /// - /// We have a new prim from a neighbor - /// - /// unique ID for the primative - /// XML2 encoded data of the primative - /// An Int that represents the version of the XMLMethod - /// True if the prim was accepted, false if it was not - protected bool IncomingPrimCrossing(UUID primID, String objXMLData, int XMLMethod) - { - handlerExpectPrim = OnExpectPrim; - if (handlerExpectPrim != null) - { - return handlerExpectPrim(primID, objXMLData, XMLMethod); - } - else - { - return false; - } - - } - protected void PrimCrossing(UUID primID, Vector3 position, bool isPhysical) { handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion; -- cgit v1.1 From 7371c7662a05d2c1dae1c110905817bb873cf934 Mon Sep 17 00:00:00 2001 From: CasperW Date: Sat, 26 Dec 2009 18:14:12 +0100 Subject: Fix for landing points. Only one scenario is not fully covered by this change, and that is people who teleport from neighbouring regions, who won't get affected by the landing point. --- .../Framework/Scenes/SceneCommunicationService.cs | 47 +++++++++++++++++----- 1 file changed, 36 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index e649139..0a02d39 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -706,17 +706,42 @@ namespace OpenSim.Region.Framework.Scenes { m_log.DebugFormat( "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation {0} within {1}", - position, m_regionInfo.RegionName); - - // Teleport within the same region - if (IsOutsideRegion(avatar.Scene, position) || position.Z < 0) - { - Vector3 emergencyPos = new Vector3(128, 128, 128); - - m_log.WarnFormat( - "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", - position, avatar.Name, avatar.UUID, emergencyPos); - position = emergencyPos; + position, m_regionInfo.RegionName); + + // Teleport within the same region + if (IsOutsideRegion(avatar.Scene, position) || position.Z < 0) + { + Vector3 emergencyPos = new Vector3(128, 128, 128); + + m_log.WarnFormat( + "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", + position, avatar.Name, avatar.UUID, emergencyPos); + position = emergencyPos; + } + + Vector3 currentPos = avatar.AbsolutePosition; + ILandObject srcLand = m_scene.LandChannel.GetLandObject(currentPos.X, currentPos.Y); + ILandObject destLand = m_scene.LandChannel.GetLandObject(position.X, position.Y); + if (srcLand != null && destLand != null && (teleportFlags & (uint)TeleportFlags.ViaLure) == 0 && (teleportFlags & (uint)TeleportFlags.ViaGodlikeLure) == 0) + { + if (srcLand.LandData.LocalID == destLand.LandData.LocalID) + { + //TPing within the same parcel. If the landing point is restricted, block the TP. + //Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni. + if (destLand.LandData.LandingType == (byte)1 && destLand.LandData.UserLocation != Vector3.Zero && avatar.GodLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar.UUID) && destLand.LandData.OwnerID != avatar.UUID) + { + avatar.ControllingClient.SendAgentAlertMessage("Can't TP to the destination; landing point set.", false); + position = currentPos; + } + } + else + { + //Tping to a different parcel. Respect the landing point on the destination parcel. + if (destLand.LandData.LandingType == (byte)1 && destLand.LandData.UserLocation != Vector3.Zero && avatar.GodLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar.UUID) && destLand.LandData.OwnerID != avatar.UUID) + { + position = destLand.LandData.UserLocation; + } + } } // TODO: Get proper AVG Height -- cgit v1.1 From ae9362636e1a95c32f7bcf1225e939b44c37a4a0 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 4 Feb 2010 17:00:16 +0000 Subject: Line endings cleanup --- .../Framework/Scenes/SceneCommunicationService.cs | 72 +++++++++++----------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 6a3c386..545183b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -699,42 +699,42 @@ namespace OpenSim.Region.Framework.Scenes { m_log.DebugFormat( "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation {0} within {1}", - position, m_regionInfo.RegionName); - - // Teleport within the same region - if (IsOutsideRegion(avatar.Scene, position) || position.Z < 0) - { - Vector3 emergencyPos = new Vector3(128, 128, 128); - - m_log.WarnFormat( - "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", - position, avatar.Name, avatar.UUID, emergencyPos); - position = emergencyPos; - } - - Vector3 currentPos = avatar.AbsolutePosition; - ILandObject srcLand = m_scene.LandChannel.GetLandObject(currentPos.X, currentPos.Y); - ILandObject destLand = m_scene.LandChannel.GetLandObject(position.X, position.Y); - if (srcLand != null && destLand != null && (teleportFlags & (uint)TeleportFlags.ViaLure) == 0 && (teleportFlags & (uint)TeleportFlags.ViaGodlikeLure) == 0) - { - if (srcLand.LandData.LocalID == destLand.LandData.LocalID) - { - //TPing within the same parcel. If the landing point is restricted, block the TP. - //Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni. - if (destLand.LandData.LandingType == (byte)1 && destLand.LandData.UserLocation != Vector3.Zero && avatar.GodLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar.UUID) && destLand.LandData.OwnerID != avatar.UUID) - { - avatar.ControllingClient.SendAgentAlertMessage("Can't TP to the destination; landing point set.", false); - position = currentPos; - } - } - else - { - //Tping to a different parcel. Respect the landing point on the destination parcel. - if (destLand.LandData.LandingType == (byte)1 && destLand.LandData.UserLocation != Vector3.Zero && avatar.GodLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar.UUID) && destLand.LandData.OwnerID != avatar.UUID) - { - position = destLand.LandData.UserLocation; - } - } + position, m_regionInfo.RegionName); + + // Teleport within the same region + if (IsOutsideRegion(avatar.Scene, position) || position.Z < 0) + { + Vector3 emergencyPos = new Vector3(128, 128, 128); + + m_log.WarnFormat( + "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", + position, avatar.Name, avatar.UUID, emergencyPos); + position = emergencyPos; + } + + Vector3 currentPos = avatar.AbsolutePosition; + ILandObject srcLand = m_scene.LandChannel.GetLandObject(currentPos.X, currentPos.Y); + ILandObject destLand = m_scene.LandChannel.GetLandObject(position.X, position.Y); + if (srcLand != null && destLand != null && (teleportFlags & (uint)TeleportFlags.ViaLure) == 0 && (teleportFlags & (uint)TeleportFlags.ViaGodlikeLure) == 0) + { + if (srcLand.LandData.LocalID == destLand.LandData.LocalID) + { + //TPing within the same parcel. If the landing point is restricted, block the TP. + //Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni. + if (destLand.LandData.LandingType == (byte)1 && destLand.LandData.UserLocation != Vector3.Zero && avatar.GodLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar.UUID) && destLand.LandData.OwnerID != avatar.UUID) + { + avatar.ControllingClient.SendAgentAlertMessage("Can't TP to the destination; landing point set.", false); + position = currentPos; + } + } + else + { + //Tping to a different parcel. Respect the landing point on the destination parcel. + if (destLand.LandData.LandingType == (byte)1 && destLand.LandData.UserLocation != Vector3.Zero && avatar.GodLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar.UUID) && destLand.LandData.OwnerID != avatar.UUID) + { + position = destLand.LandData.UserLocation; + } + } } // TODO: Get proper AVG Height -- cgit v1.1 From efd481085135f60d8f6d3e4615591a26ec3f05f6 Mon Sep 17 00:00:00 2001 From: CasperW Date: Thu, 25 Feb 2010 12:04:51 +0100 Subject: Disable blocking teleports within the same parcel for now; it's not implemented correctly. Will review soon. --- OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 9ceab19..5f84252 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -722,8 +722,10 @@ namespace OpenSim.Region.Framework.Scenes //Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni. if (destLand.LandData.LandingType == (byte)1 && destLand.LandData.UserLocation != Vector3.Zero && avatar.GodLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar.UUID) && destLand.LandData.OwnerID != avatar.UUID) { - avatar.ControllingClient.SendAgentAlertMessage("Can't TP to the destination; landing point set.", false); - position = currentPos; + //Disabling this behaviour for now pending review. ~CasperW + + //avatar.ControllingClient.SendAgentAlertMessage("Can't TP to the destination; landing point set.", false); + //position = currentPos; } } else -- cgit v1.1 From 1c040d8c1ed5ee1ba1e80aa1d248a9b06d1790a5 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Tue, 18 May 2010 03:24:43 -0700 Subject: Fix to the scenario where we send an agent to a neighbouring sim (via teleport), then tell our neighbours to close the agents.. thereby disconnecting the user. Added a new CloseChildAgent method in lieu of CloseAgent. This has been a long standing problem - with any luck this will cure it. --- OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 9d0e6f4..6309cd9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -281,7 +281,7 @@ namespace OpenSim.Region.Framework.Scenes uint x = 0, y = 0; Utils.LongToUInts(regionHandle, out x, out y); GridRegion destination = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); - m_scene.SimulationService.CloseAgent(destination, agentID); + m_scene.SimulationService.CloseChildAgent(destination, agentID); } private void SendCloseChildAgentCompleted(IAsyncResult iar) -- cgit v1.1 From 478d83539244157992b1849648e5e4cf758543e0 Mon Sep 17 00:00:00 2001 From: sacha Date: Sat, 7 Aug 2010 21:04:16 +0000 Subject: removing more stains ... --- OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index a9ecde8..59e4037 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -168,7 +168,7 @@ namespace OpenSim.Region.Framework.Scenes if (neighbour != null) { - m_log.DebugFormat("[INTERGRID]: Successfully informed neighbour {0}-{1} that I'm here", x / Constants.RegionSize, y / Constants.RegionSize); + // m_log.DebugFormat("[INTERGRID]: Successfully informed neighbour {0}-{1} that I'm here", x / Constants.RegionSize, y / Constants.RegionSize); m_scene.EventManager.TriggerOnRegionUp(neighbour); } else @@ -183,7 +183,7 @@ namespace OpenSim.Region.Framework.Scenes //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); List neighbours = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID); - m_log.DebugFormat("[INTERGRID]: Informing {0} neighbours that this region is up", neighbours.Count); + //m_log.DebugFormat("[INTERGRID]: Informing {0} neighbours that this region is up", neighbours.Count); foreach (GridRegion n in neighbours) { InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; @@ -267,7 +267,7 @@ namespace OpenSim.Region.Framework.Scenes protected void SendCloseChildAgentAsync(UUID agentID, ulong regionHandle) { - m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle); + //m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle); // let's do our best, but there's not much we can do if the neighbour doesn't accept. //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); -- cgit v1.1 From 52dd547863c0cdd22f53f0efcaef11ae096855a0 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 8 Oct 2010 11:31:52 +0200 Subject: Make SendKillObject send multiple localIDs in one packet. This avoids the halting visual behavior of large group deletes and eliminates the packet flood --- OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 1293d5d..632646d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -44,8 +44,6 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.Framework.Scenes { - public delegate void KiPrimitiveDelegate(uint localID); - public delegate void RemoveKnownRegionsFromAvatarList(UUID avatarID, List regionlst); /// @@ -113,8 +111,6 @@ namespace OpenSim.Region.Framework.Scenes // private LogOffUser handlerLogOffUser = null; // private GetLandData handlerGetLandData = null; // OnGetLandData - public KiPrimitiveDelegate KiPrimitive; - public SceneCommunicationService() { } -- cgit v1.1 From 04e450e2bc065bd6049939129d0eacc851e014ba Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 31 Dec 2010 16:05:59 +0100 Subject: Fix child agent scoping --- OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 632646d..c8af4c3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -189,7 +189,7 @@ namespace OpenSim.Region.Framework.Scenes } } - public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, ulong regionHandle); + public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, UUID scopeID, ulong regionHandle); /// /// This informs all neighboring regions about the settings of it's child agent. @@ -198,7 +198,7 @@ namespace OpenSim.Region.Framework.Scenes /// This contains information, such as, Draw Distance, Camera location, Current Position, Current throttle settings, etc. /// /// - private void SendChildAgentDataUpdateAsync(AgentPosition cAgentData, ulong regionHandle) + private void SendChildAgentDataUpdateAsync(AgentPosition cAgentData, UUID scopeID, ulong regionHandle) { //m_log.Info("[INTERGRID]: Informing neighbors about my agent in " + m_regionInfo.RegionName); try @@ -241,7 +241,7 @@ namespace OpenSim.Region.Framework.Scenes if (regionHandle != m_regionInfo.RegionHandle) { SendChildAgentDataUpdateDelegate d = SendChildAgentDataUpdateAsync; - d.BeginInvoke(cAgentData, regionHandle, + d.BeginInvoke(cAgentData, m_regionInfo.ScopeID, regionHandle, SendChildAgentDataUpdateCompleted, d); } @@ -269,7 +269,7 @@ namespace OpenSim.Region.Framework.Scenes //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); uint x = 0, y = 0; Utils.LongToUInts(regionHandle, out x, out y); - GridRegion destination = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); + GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); m_scene.SimulationService.CloseChildAgent(destination, agentID); } -- cgit v1.1 From 07dead7dcb8b0f2a27a50748e4a460d9669903fc Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sun, 29 Mar 2015 14:25:12 -0700 Subject: varregion: any conversions of use of Constants.RegionSize converted into Util.cs routines to convert region coords to and from world coords or handles. --- OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 52f46f2..a2625c4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -52,6 +52,7 @@ namespace OpenSim.Region.Framework.Scenes public class SceneCommunicationService //one instance per region { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static string LogHeader = "[SCENE COMMUNICATION SERVICE]"; protected RegionInfo m_regionInfo; protected Scene m_scene; @@ -100,7 +101,7 @@ namespace OpenSim.Region.Framework.Scenes { m_log.WarnFormat( "[SCENE COMMUNICATION SERVICE]: Region {0} failed to inform neighbour at {1}-{2} that it is up.", - m_scene.Name, x / Constants.RegionSize, y / Constants.RegionSize); + m_scene.Name, Util.WorldToRegionLoc(x), Util.WorldToRegionLoc(y)); } } @@ -166,7 +167,7 @@ namespace OpenSim.Region.Framework.Scenes // we only want to send one update to each simulator; the simulator will // hand it off to the regions where a child agent exists, this does assume // that the region position is cached or performance will degrade - Utils.LongToUInts(regionHandle, out x, out y); + Util.RegionHandleToWorldLoc(regionHandle, out x, out y); GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); if (dest == null) continue; @@ -206,7 +207,7 @@ namespace OpenSim.Region.Framework.Scenes //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); uint x = 0, y = 0; - Utils.LongToUInts(regionHandle, out x, out y); + Util.RegionHandleToWorldLoc(regionHandle, out x, out y); GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); @@ -226,6 +227,8 @@ namespace OpenSim.Region.Framework.Scenes { foreach (ulong handle in regionslst) { + // We must take a copy here since handle acts like a reference when used in an iterator. + // This leads to race conditions if directly passed to SendCloseChildAgent with more than one neighbour region. ulong handleCopy = handle; Util.FireAndForget((o) => { SendCloseChildAgent(agentID, handleCopy, auth_code); }); } -- cgit v1.1