diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
3 files changed, 16 insertions, 18 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5663048..f46bdf3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2107,7 +2107,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2107 | // | 2107 | // |
2108 | // This workaround is to prevent silent failure of this function. | 2108 | // This workaround is to prevent silent failure of this function. |
2109 | // According to the specification on the SL Wiki, providing a position outside of the | 2109 | // According to the specification on the SL Wiki, providing a position outside of the |
2110 | if (pos.x < 0 || pos.x > Constants.RegionSize || pos.y < 0 || pos.y > Constants.RegionSize) | 2110 | if (pos.x < 0 || pos.x > World.RegionInfo.RegionSizeX || pos.y < 0 || pos.y > World.RegionInfo.RegionSizeY) |
2111 | { | 2111 | { |
2112 | return 0; | 2112 | return 0; |
2113 | } | 2113 | } |
@@ -2117,9 +2117,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2117 | m_host.ParentGroup.IsAttachment || // return FALSE if attachment | 2117 | m_host.ParentGroup.IsAttachment || // return FALSE if attachment |
2118 | ( | 2118 | ( |
2119 | pos.x < -10.0 || // return FALSE if more than 10 meters into a west-adjacent region. | 2119 | pos.x < -10.0 || // return FALSE if more than 10 meters into a west-adjacent region. |
2120 | pos.x > (Constants.RegionSize + 10) || // return FALSE if more than 10 meters into a east-adjacent region. | 2120 | pos.x > (World.RegionInfo.RegionSizeX + 10) || // return FALSE if more than 10 meters into a east-adjacent region. |
2121 | pos.y < -10.0 || // return FALSE if more than 10 meters into a south-adjacent region. | 2121 | pos.y < -10.0 || // return FALSE if more than 10 meters into a south-adjacent region. |
2122 | pos.y > (Constants.RegionSize + 10) || // return FALSE if more than 10 meters into a north-adjacent region. | 2122 | pos.y > (World.RegionInfo.RegionSizeY + 10) || // return FALSE if more than 10 meters into a north-adjacent region. |
2123 | pos.z > Constants.RegionHeight // return FALSE if altitude than 4096m | 2123 | pos.z > Constants.RegionHeight // return FALSE if altitude than 4096m |
2124 | ) | 2124 | ) |
2125 | ) | 2125 | ) |
@@ -4244,10 +4244,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4244 | DataserverPlugin.RegisterRequest(m_host.LocalId, | 4244 | DataserverPlugin.RegisterRequest(m_host.LocalId, |
4245 | m_item.ItemID, item.AssetID.ToString()); | 4245 | m_item.ItemID, item.AssetID.ToString()); |
4246 | 4246 | ||
4247 | Vector3 region = new Vector3( | 4247 | Vector3 region = new Vector3(World.RegionInfo.RegionWorldLocX, World.RegionInfo.RegionWorldLocY, 0); |
4248 | World.RegionInfo.RegionLocX * Constants.RegionSize, | ||
4249 | World.RegionInfo.RegionLocY * Constants.RegionSize, | ||
4250 | 0); | ||
4251 | 4248 | ||
4252 | World.AssetService.Get(item.AssetID.ToString(), this, | 4249 | World.AssetService.Get(item.AssetID.ToString(), this, |
4253 | delegate(string i, object sender, AssetBase a) | 4250 | delegate(string i, object sender, AssetBase a) |
@@ -5481,7 +5478,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5481 | public LSL_Vector llGetRegionCorner() | 5478 | public LSL_Vector llGetRegionCorner() |
5482 | { | 5479 | { |
5483 | m_host.AddScriptLPS(1); | 5480 | m_host.AddScriptLPS(1); |
5484 | return new LSL_Vector(World.RegionInfo.RegionLocX * Constants.RegionSize, World.RegionInfo.RegionLocY * Constants.RegionSize, 0); | 5481 | return new LSL_Vector(World.RegionInfo.RegionWorldLocX, World.RegionInfo.RegionWorldLocY, 0); |
5485 | } | 5482 | } |
5486 | 5483 | ||
5487 | /// <summary> | 5484 | /// <summary> |
@@ -5628,7 +5625,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5628 | LSL_Float mag; | 5625 | LSL_Float mag; |
5629 | if (dir.x > 0) | 5626 | if (dir.x > 0) |
5630 | { | 5627 | { |
5631 | mag = (Constants.RegionSize - pos.x) / dir.x; | 5628 | mag = (World.RegionInfo.RegionSizeX - pos.x) / dir.x; |
5632 | } | 5629 | } |
5633 | else | 5630 | else |
5634 | { | 5631 | { |
@@ -5639,7 +5636,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5639 | 5636 | ||
5640 | edge.y = pos.y + (dir.y * mag); | 5637 | edge.y = pos.y + (dir.y * mag); |
5641 | 5638 | ||
5642 | if (edge.y > Constants.RegionSize || edge.y < 0) | 5639 | if (edge.y > World.RegionInfo.RegionSizeY || edge.y < 0) |
5643 | { | 5640 | { |
5644 | // Y goes out of bounds first | 5641 | // Y goes out of bounds first |
5645 | edge.y = dir.y / Math.Abs(dir.y); | 5642 | edge.y = dir.y / Math.Abs(dir.y); |
@@ -5654,8 +5651,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5654 | 5651 | ||
5655 | List<GridRegion> neighbors = World.GridService.GetNeighbours(World.RegionInfo.ScopeID, World.RegionInfo.RegionID); | 5652 | List<GridRegion> neighbors = World.GridService.GetNeighbours(World.RegionInfo.ScopeID, World.RegionInfo.RegionID); |
5656 | 5653 | ||
5657 | uint neighborX = World.RegionInfo.RegionLocX + (uint)dir.x; | 5654 | uint neighborX = World.RegionInfo.LegacyRegionLocX + (uint)dir.x; |
5658 | uint neighborY = World.RegionInfo.RegionLocY + (uint)dir.y; | 5655 | uint neighborY = World.RegionInfo.LegacyRegionLocY + (uint)dir.y; |
5659 | 5656 | ||
5660 | foreach (GridRegion sri in neighbors) | 5657 | foreach (GridRegion sri in neighbors) |
5661 | { | 5658 | { |
@@ -10770,7 +10767,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10770 | httpHeaders["X-SecondLife-Shard"] = shard; | 10767 | httpHeaders["X-SecondLife-Shard"] = shard; |
10771 | httpHeaders["X-SecondLife-Object-Name"] = m_host.Name; | 10768 | httpHeaders["X-SecondLife-Object-Name"] = m_host.Name; |
10772 | httpHeaders["X-SecondLife-Object-Key"] = m_host.UUID.ToString(); | 10769 | httpHeaders["X-SecondLife-Object-Key"] = m_host.UUID.ToString(); |
10773 | httpHeaders["X-SecondLife-Region"] = string.Format("{0} ({1}, {2})", regionInfo.RegionName, regionInfo.RegionLocX, regionInfo.RegionLocY); | 10770 | httpHeaders["X-SecondLife-Region"] = string.Format("{0} ({1}, {2})", regionInfo.RegionName, regionInfo.LegacyRegionLocX, regionInfo.LegacyRegionLocY); |
10774 | httpHeaders["X-SecondLife-Local-Position"] = string.Format("({0:0.000000}, {1:0.000000}, {2:0.000000})", position.X, position.Y, position.Z); | 10771 | httpHeaders["X-SecondLife-Local-Position"] = string.Format("({0:0.000000}, {1:0.000000}, {2:0.000000})", position.X, position.Y, position.Z); |
10775 | httpHeaders["X-SecondLife-Local-Velocity"] = string.Format("({0:0.000000}, {1:0.000000}, {2:0.000000})", velocity.X, velocity.Y, velocity.Z); | 10772 | httpHeaders["X-SecondLife-Local-Velocity"] = string.Format("({0:0.000000}, {1:0.000000}, {2:0.000000})", velocity.X, velocity.Y, velocity.Z); |
10776 | httpHeaders["X-SecondLife-Local-Rotation"] = string.Format("({0:0.000000}, {1:0.000000}, {2:0.000000}, {3:0.000000})", rotation.X, rotation.Y, rotation.Z, rotation.W); | 10773 | httpHeaders["X-SecondLife-Local-Rotation"] = string.Format("({0:0.000000}, {1:0.000000}, {2:0.000000}, {3:0.000000})", rotation.X, rotation.Y, rotation.Z, rotation.W); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index f4d5562..4fb0856 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -450,7 +450,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
450 | { | 450 | { |
451 | m_host.AddScriptLPS(1); | 451 | m_host.AddScriptLPS(1); |
452 | 452 | ||
453 | if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) | 453 | if (x > (World.RegionInfo.RegionSizeX - 1) || x < 0 || y > (World.RegionInfo.RegionSizeY - 1) || y < 0) |
454 | OSSLError("osSetTerrainHeight: Coordinate out of bounds"); | 454 | OSSLError("osSetTerrainHeight: Coordinate out of bounds"); |
455 | 455 | ||
456 | if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0))) | 456 | if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0))) |
@@ -480,7 +480,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
480 | private LSL_Float GetTerrainHeight(int x, int y) | 480 | private LSL_Float GetTerrainHeight(int x, int y) |
481 | { | 481 | { |
482 | m_host.AddScriptLPS(1); | 482 | m_host.AddScriptLPS(1); |
483 | if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) | 483 | if (x > (World.RegionInfo.RegionSizeX - 1) || x < 0 || y > (World.RegionInfo.RegionSizeY - 1) || y < 0) |
484 | OSSLError("osGetTerrainHeight: Coordinate out of bounds"); | 484 | OSSLError("osGetTerrainHeight: Coordinate out of bounds"); |
485 | 485 | ||
486 | return World.Heightmap[x, y]; | 486 | return World.Heightmap[x, y]; |
@@ -814,7 +814,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
814 | private void TeleportAgent(string agent, int regionX, int regionY, | 814 | private void TeleportAgent(string agent, int regionX, int regionY, |
815 | LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions) | 815 | LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions) |
816 | { | 816 | { |
817 | ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize)); | 817 | // ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize)); |
818 | ulong regionHandle = Util.RegionWorldLocToHandle(Util.RegionToWorldLoc((uint)regionX), Util.RegionToWorldLoc((uint)regionY)); | ||
818 | 819 | ||
819 | m_host.AddScriptLPS(1); | 820 | m_host.AddScriptLPS(1); |
820 | UUID agentId = new UUID(); | 821 | UUID agentId = new UUID(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index c9902e4..e3f3fc7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -721,8 +721,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
721 | Position.y = ((int)Constants.RegionSize - 1); | 721 | Position.y = ((int)Constants.RegionSize - 1); |
722 | if (Position.y < 0) | 722 | if (Position.y < 0) |
723 | Position.y = 0; | 723 | Position.y = 0; |
724 | if (Position.z > 768) | 724 | if (Position.z > Constants.RegionHeight) |
725 | Position.z = 768; | 725 | Position.z = Constants.RegionHeight; |
726 | if (Position.z < 0) | 726 | if (Position.z < 0) |
727 | Position.z = 0; | 727 | Position.z = 0; |
728 | prim.OSSL.llSetPos(Position); | 728 | prim.OSSL.llSetPos(Position); |