From 9f18e3ba80a6469b7ff03c7cca595a0a3b999592 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sun, 22 Mar 2015 21:53:02 -0700 Subject: Varregion: first cut at removing Border class checks for region crossings. Added Scene.PositionIsInCurrentRegion(pos) to sense when new position needs some crossing work. Many changes made to EntityTransferModule to accomodate new crossing sense logic. --- .../World/SceneCommands/SceneCommandsModule.cs | 33 +--------------------- 1 file changed, 1 insertion(+), 32 deletions(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs index 29b39e0..6cbccc0 100644 --- a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs +++ b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs @@ -116,37 +116,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments + "If teleport is true then some extra teleport debug information is logged.\n" + "If updates is true then any frame which exceeds double the maximum desired frame time is logged.", HandleDebugSceneSetCommand); - - scene.AddCommand( - "Regions", - this, "show borders", "show borders", "Show border information for regions", HandleShowBordersCommand); - } - - private void HandleShowBordersCommand(string module, string[] args) - { - StringBuilder sb = new StringBuilder(); - sb.AppendFormat("Borders for {0}:\n", m_scene.Name); - - ConsoleDisplayTable cdt = new ConsoleDisplayTable(); - cdt.AddColumn("Cross Direction", 15); - cdt.AddColumn("Line", 34); - cdt.AddColumn("Trigger Region", 14); - - foreach (Border b in m_scene.NorthBorders) - cdt.AddRow(b.CrossDirection, b.BorderLine, string.Format("{0}, {1}", b.TriggerRegionX, b.TriggerRegionY)); - - foreach (Border b in m_scene.EastBorders) - cdt.AddRow(b.CrossDirection, b.BorderLine, string.Format("{0}, {1}", b.TriggerRegionX, b.TriggerRegionY)); - - foreach (Border b in m_scene.SouthBorders) - cdt.AddRow(b.CrossDirection, b.BorderLine, string.Format("{0}, {1}", b.TriggerRegionX, b.TriggerRegionY)); - - foreach (Border b in m_scene.WestBorders) - cdt.AddRow(b.CrossDirection, b.BorderLine, string.Format("{0}, {1}", b.TriggerRegionX, b.TriggerRegionY)); - - cdt.AddToStringBuilder(sb); - - MainConsole.Instance.Output(sb.ToString()); } private void HandleDebugSceneGetCommand(string module, string[] args) @@ -263,4 +232,4 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments } } } -} \ No newline at end of file +} -- 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. --- .../Agent/InternetRelayClientView/Server/IRCClientView.cs | 2 +- OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs | 2 ++ OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs | 2 ++ OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs | 4 ++-- .../OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs | 5 ++++- .../OptionalModules/World/TreePopulator/TreePopulatorModule.cs | 4 ++-- 6 files changed, 13 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index ed1503c..3750494 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -518,7 +518,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server public Vector3 StartPos { - get { return new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 50); } + get { return new Vector3(m_scene.RegionInfo.RegionSizeX * 0.5f, m_scene.RegionInfo.RegionSizeY * 0.5f, 50f); } set { } } diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs index c5cba8e..f5bd44d 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs @@ -52,6 +52,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat // Local constants + // This computation is not the real region center if the region is larger than 256. + // This computation isn't fixed because there is not a handle back to the region. private static readonly Vector3 CenterOfRegion = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 20); private static readonly char[] CS_SPACE = { ' ' }; diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs index d4fe5e0..5505001 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs @@ -44,6 +44,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + // This computation is not the real region center if the region is larger than 256. + // This computation isn't fixed because there is not a handle back to the region. private static readonly OpenMetaverse.Vector3 CenterOfRegion = new OpenMetaverse.Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 20); private const int DEBUG_CHANNEL = 2147483647; diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs index a375da9..0bf23f1 100644 --- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs +++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs @@ -122,8 +122,8 @@ namespace OpenSim.Region.OptionalModules private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene) { - if (newPoint.X < -1f || newPoint.X > (float)(Constants.RegionSize + 1) || - newPoint.Y < -1f || newPoint.Y > (float)(Constants.RegionSize + 1)) + if (newPoint.X < -1f || newPoint.X > (scene.RegionInfo.RegionSizeX + 1) || + newPoint.Y < -1f || newPoint.Y > (scene.RegionInfo.RegionSizeY) ) return true; SceneObjectPart obj = scene.GetSceneObjectPart(objectID); diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs index eb386fe..296ab87 100644 --- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs @@ -170,7 +170,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady c.Channel = m_channelNotify; c.Message += numScriptsFailed.ToString() + "," + message; c.Type = ChatTypeEnum.Region; - c.Position = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 30); + if (m_scene != null) + c.Position = new Vector3((m_scene.RegionInfo.RegionSizeX * 0.5f), (m_scene.RegionInfo.RegionSizeY * 0.5f), 30); + else + c.Position = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 30); c.Sender = null; c.SenderUUID = UUID.Zero; c.Scene = m_scene; diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs index 8144870..e4a3382 100644 --- a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs +++ b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs @@ -748,8 +748,8 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator position.X = s_tree.AbsolutePosition.X + (float)randX; position.Y = s_tree.AbsolutePosition.Y + (float)randY; - if (position.X <= ((int)Constants.RegionSize - 1) && position.X >= 0 && - position.Y <= ((int)Constants.RegionSize - 1) && position.Y >= 0 && + if (position.X <= (m_scene.RegionInfo.RegionSizeX - 1) && position.X >= 0 && + position.Y <= (m_scene.RegionInfo.RegionSizeY - 1) && position.Y >= 0 && Util.GetDistanceTo(position, copse.m_seed_point) <= copse.m_range) { UUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner; -- cgit v1.1