aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorUbitUmarov2016-07-31 01:56:44 +0100
committerUbitUmarov2016-07-31 01:56:44 +0100
commita4caedceae4e4ceb4a2987b392a5aa8abc83a8c6 (patch)
tree68022bc8a14702e6ab6a60f94a7b0bb6bc175180 /OpenSim
parent cleanup to go break something else (diff)
downloadopensim-SC_OLD-a4caedceae4e4ceb4a2987b392a5aa8abc83a8c6.zip
opensim-SC_OLD-a4caedceae4e4ceb4a2987b392a5aa8abc83a8c6.tar.gz
opensim-SC_OLD-a4caedceae4e4ceb4a2987b392a5aa8abc83a8c6.tar.bz2
opensim-SC_OLD-a4caedceae4e4ceb4a2987b392a5aa8abc83a8c6.tar.xz
rename a few things to reduce confusion between regions wold location and grid location (a lot more elsewhere)
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Util.cs8
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs12
3 files changed, 12 insertions, 10 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 1b3a4c3..ccbe75e 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -377,9 +377,11 @@ namespace OpenSim.Framework
377 return Utils.UIntsToLong(X, Y); 377 return Utils.UIntsToLong(X, Y);
378 } 378 }
379 379
380 public static ulong RegionLocToHandle(uint X, uint Y) 380 public static ulong RegionGridLocToHandle(uint X, uint Y)
381 { 381 {
382 return Utils.UIntsToLong(Util.RegionToWorldLoc(X), Util.RegionToWorldLoc(Y)); 382 ulong handle = X << 40; // shift to higher half and mult by 256)
383 handle |= (Y << 8); // mult by 256)
384 return handle;
383 } 385 }
384 386
385 public static void RegionHandleToWorldLoc(ulong handle, out uint X, out uint Y) 387 public static void RegionHandleToWorldLoc(ulong handle, out uint X, out uint Y)
@@ -1303,7 +1305,7 @@ namespace OpenSim.Framework
1303 } 1305 }
1304 catch (Exception e) 1306 catch (Exception e)
1305 { 1307 {
1306 m_log.WarnFormat("[UTILS]: Exception copying configuration file {0} to {1}: {2}", exampleConfigFile, configFile, e.Message); 1308 m_log.WarnFormat("[UTILS]: Exception copying configuration file {0} to {1}: {2}", configFile, exampleConfigFile, e.Message);
1307 return false; 1309 return false;
1308 } 1310 }
1309 } 1311 }
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index efc714f..9ee23d6 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
1588 1588
1589 agent.Scene.RequestTeleportLocation( 1589 agent.Scene.RequestTeleportLocation(
1590 agent.ControllingClient, 1590 agent.ControllingClient,
1591 Util.RegionLocToHandle(regionX, regionY), 1591 Util.RegionGridLocToHandle(regionX, regionY),
1592 position, 1592 position,
1593 agent.Lookat, 1593 agent.Lookat,
1594 (uint)Constants.TeleportFlags.ViaLocation); 1594 (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 319f14c..e525a2e 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
852 } 852 }
853 } 853 }
854 854
855 public void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 855 public void osTeleportAgent(string agent, int regionGridX, int regionGridY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
856 { 856 {
857 // High because there is no security check. High griefer potential 857 // High because there is no security check. High griefer potential
858 // 858 //
859 CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent"); 859 CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent");
860 860
861 TeleportAgent(agent, regionX, regionY, position, lookat, false); 861 TeleportAgent(agent, regionGridX, regionGridY, position, lookat, false);
862 } 862 }
863 863
864 private void TeleportAgent(string agent, int regionX, int regionY, 864 private void TeleportAgent(string agent, int regionGridX, int regionGridY,
865 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions) 865 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions)
866 { 866 {
867 ulong regionHandle = Util.RegionLocToHandle((uint)regionX, (uint)regionY); 867 ulong regionHandle = Util.RegionGridLocToHandle((uint)regionGridX, (uint)regionGridY);
868 868
869 m_host.AddScriptLPS(1); 869 m_host.AddScriptLPS(1);
870 UUID agentId = new UUID(); 870 UUID agentId = new UUID();
@@ -917,11 +917,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
917 osTeleportOwner(World.RegionInfo.RegionName, position, lookat); 917 osTeleportOwner(World.RegionInfo.RegionName, position, lookat);
918 } 918 }
919 919
920 public void osTeleportOwner(int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 920 public void osTeleportOwner(int regionGridX, int regionGridY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
921 { 921 {
922 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); 922 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner");
923 923
924 TeleportAgent(m_host.OwnerID.ToString(), regionX, regionY, position, lookat, true); 924 TeleportAgent(m_host.OwnerID.ToString(), regionGridX, regionGridY, position, lookat, true);
925 } 925 }
926 926
927 ///<summary> 927 ///<summary>