From a4caedceae4e4ceb4a2987b392a5aa8abc83a8c6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 31 Jul 2016 01:56:44 +0100 Subject: [PATCH] rename a few things to reduce confusion between regions wold location and grid location (a lot more elsewhere) --- OpenSim/Framework/Util.cs | 8 +++++--- .../Framework/EntityTransfer/EntityTransferModule.cs | 2 +- .../Shared/Api/Implementation/OSSL_Api.cs | 12 ++++++------ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 1b3a4c3599..ccbe75efc6 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -377,9 +377,11 @@ namespace OpenSim.Framework return Utils.UIntsToLong(X, Y); } - public static ulong RegionLocToHandle(uint X, uint Y) + public static ulong RegionGridLocToHandle(uint X, uint Y) { - return Utils.UIntsToLong(Util.RegionToWorldLoc(X), Util.RegionToWorldLoc(Y)); + ulong handle = X << 40; // shift to higher half and mult by 256) + handle |= (Y << 8); // mult by 256) + return handle; } public static void RegionHandleToWorldLoc(ulong handle, out uint X, out uint Y) @@ -1303,7 +1305,7 @@ namespace OpenSim.Framework } catch (Exception e) { - m_log.WarnFormat("[UTILS]: Exception copying configuration file {0} to {1}: {2}", exampleConfigFile, configFile, e.Message); + m_log.WarnFormat("[UTILS]: Exception copying configuration file {0} to {1}: {2}", configFile, exampleConfigFile, e.Message); return false; } } diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index efc714fae0..9ee23d65bb 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1588,7 +1588,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer agent.Scene.RequestTeleportLocation( agent.ControllingClient, - Util.RegionLocToHandle(regionX, regionY), + Util.RegionGridLocToHandle(regionX, regionY), position, agent.Lookat, (uint)Constants.TeleportFlags.ViaLocation); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 319f14c3bf..e525a2e134 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -852,19 +852,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } - public void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) + public void osTeleportAgent(string agent, int regionGridX, int regionGridY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { // High because there is no security check. High griefer potential // CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent"); - TeleportAgent(agent, regionX, regionY, position, lookat, false); + TeleportAgent(agent, regionGridX, regionGridY, position, lookat, false); } - private void TeleportAgent(string agent, int regionX, int regionY, + private void TeleportAgent(string agent, int regionGridX, int regionGridY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions) { - ulong regionHandle = Util.RegionLocToHandle((uint)regionX, (uint)regionY); + ulong regionHandle = Util.RegionGridLocToHandle((uint)regionGridX, (uint)regionGridY); m_host.AddScriptLPS(1); UUID agentId = new UUID(); @@ -917,11 +917,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api osTeleportOwner(World.RegionInfo.RegionName, position, lookat); } - public void osTeleportOwner(int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) + public void osTeleportOwner(int regionGridX, int regionGridY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); - TeleportAgent(m_host.OwnerID.ToString(), regionX, regionY, position, lookat, true); + TeleportAgent(m_host.OwnerID.ToString(), regionGridX, regionGridY, position, lookat, true); } ///