diff options
author | Robert Adams | 2013-09-19 12:14:21 -0700 |
---|---|---|
committer | Robert Adams | 2013-09-28 07:33:52 -0700 |
commit | 317c04fe1714631d851684e3bb294f02056bcd07 (patch) | |
tree | a4e935d869c9cb2d79f545f9b6dd1f73b01a7053 /OpenSim/Region/CoreModules/Framework | |
parent | minor: Disable logging left active on regression test TestSameSimulatorIsolat... (diff) | |
download | opensim-SC-317c04fe1714631d851684e3bb294f02056bcd07.zip opensim-SC-317c04fe1714631d851684e3bb294f02056bcd07.tar.gz opensim-SC-317c04fe1714631d851684e3bb294f02056bcd07.tar.bz2 opensim-SC-317c04fe1714631d851684e3bb294f02056bcd07.tar.xz |
VarRegion: change RegionInfo storage of region coordinates from region
count number to integer world coordinates.
Added new methods RegionWorldLoc[XY].
Refactored name of 'RegionLoc*' to 'LegacyRegionLoc*' throughout OpenSim.
Kept old 'RegionLoc*' entrypoint to RegionInfo for downward compatability
of external region management packages.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index aa8a4db..eb1b271 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -494,8 +494,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
494 | } | 494 | } |
495 | 495 | ||
496 | // Check that these are not the same coordinates | 496 | // Check that these are not the same coordinates |
497 | if (finalDestination.RegionLocX == sp.Scene.RegionInfo.RegionLocX && | 497 | if (finalDestination.RegionLocX == sp.Scene.RegionInfo.LegacyRegionLocX && |
498 | finalDestination.RegionLocY == sp.Scene.RegionInfo.RegionLocY) | 498 | finalDestination.RegionLocY == sp.Scene.RegionInfo.LegacyRegionLocY) |
499 | { | 499 | { |
500 | // Can't do. Viewer crashes | 500 | // Can't do. Viewer crashes |
501 | sp.ControllingClient.SendTeleportFailed("Space warp! You would crash. Move to a different region and try again."); | 501 | sp.ControllingClient.SendTeleportFailed("Space warp! You would crash. Move to a different region and try again."); |
@@ -567,8 +567,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
567 | // destRegionX, destRegionY, finalDestination.RegionID, finalDestination.ServerURI); | 567 | // destRegionX, destRegionY, finalDestination.RegionID, finalDestination.ServerURI); |
568 | 568 | ||
569 | // Insanely, RegionLoc on RegionInfo is the 256m map co-ord whilst GridRegion.RegionLoc is the raw meters position. | 569 | // Insanely, RegionLoc on RegionInfo is the 256m map co-ord whilst GridRegion.RegionLoc is the raw meters position. |
570 | return Math.Abs(sourceRegion.RegionLocX - destRegion.RegionCoordX) <= MaxTransferDistance | 570 | return Math.Abs(sourceRegion.LegacyRegionLocX - destRegion.RegionCoordX) <= MaxTransferDistance |
571 | && Math.Abs(sourceRegion.RegionLocY - destRegion.RegionCoordY) <= MaxTransferDistance; | 571 | && Math.Abs(sourceRegion.LegacyRegionLocY - destRegion.RegionCoordY) <= MaxTransferDistance; |
572 | } | 572 | } |
573 | 573 | ||
574 | /// <summary> | 574 | /// <summary> |
@@ -635,7 +635,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
635 | string.Format( | 635 | string.Format( |
636 | "Can't teleport to {0} ({1},{2}) from {3} ({4},{5}), destination is more than {6} regions way", | 636 | "Can't teleport to {0} ({1},{2}) from {3} ({4},{5}), destination is more than {6} regions way", |
637 | finalDestination.RegionName, finalDestination.RegionCoordX, finalDestination.RegionCoordY, | 637 | finalDestination.RegionName, finalDestination.RegionCoordX, finalDestination.RegionCoordY, |
638 | sourceRegion.RegionName, sourceRegion.RegionLocX, sourceRegion.RegionLocY, | 638 | sourceRegion.RegionName, sourceRegion.LegacyRegionLocX, sourceRegion.LegacyRegionLocY, |
639 | MaxTransferDistance)); | 639 | MaxTransferDistance)); |
640 | 640 | ||
641 | return; | 641 | return; |
@@ -1374,8 +1374,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1374 | // "[ENTITY TRANSFER MODULE]: Crossing agent {0} at pos {1} in {2}", agent.Name, pos, scene.Name); | 1374 | // "[ENTITY TRANSFER MODULE]: Crossing agent {0} at pos {1} in {2}", agent.Name, pos, scene.Name); |
1375 | 1375 | ||
1376 | Vector3 newpos = new Vector3(pos.X, pos.Y, pos.Z); | 1376 | Vector3 newpos = new Vector3(pos.X, pos.Y, pos.Z); |
1377 | uint neighbourx = scene.RegionInfo.RegionLocX; | 1377 | uint neighbourx = scene.RegionInfo.LegacyRegionLocX; |
1378 | uint neighboury = scene.RegionInfo.RegionLocY; | 1378 | uint neighboury = scene.RegionInfo.LegacyRegionLocY; |
1379 | const float boundaryDistance = 1.7f; | 1379 | const float boundaryDistance = 1.7f; |
1380 | Vector3 northCross = new Vector3(0, boundaryDistance, 0); | 1380 | Vector3 northCross = new Vector3(0, boundaryDistance, 0); |
1381 | Vector3 southCross = new Vector3(0, -1 * boundaryDistance, 0); | 1381 | Vector3 southCross = new Vector3(0, -1 * boundaryDistance, 0); |
@@ -1408,8 +1408,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1408 | neighbourx = b.TriggerRegionX; | 1408 | neighbourx = b.TriggerRegionX; |
1409 | 1409 | ||
1410 | Vector3 newposition = pos; | 1410 | Vector3 newposition = pos; |
1411 | newposition.X += (scene.RegionInfo.RegionLocX - neighbourx) * Constants.RegionSize; | 1411 | newposition.X += (scene.RegionInfo.LegacyRegionLocX - neighbourx) * Constants.RegionSize; |
1412 | newposition.Y += (scene.RegionInfo.RegionLocY - neighboury) * Constants.RegionSize; | 1412 | newposition.Y += (scene.RegionInfo.LegacyRegionLocY - neighboury) * Constants.RegionSize; |
1413 | agent.ControllingClient.SendAgentAlertMessage( | 1413 | agent.ControllingClient.SendAgentAlertMessage( |
1414 | String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false); | 1414 | String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false); |
1415 | InformClientToInitiateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene); | 1415 | InformClientToInitiateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene); |
@@ -1431,8 +1431,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1431 | neighbourx = ba.TriggerRegionX; | 1431 | neighbourx = ba.TriggerRegionX; |
1432 | 1432 | ||
1433 | Vector3 newposition = pos; | 1433 | Vector3 newposition = pos; |
1434 | newposition.X += (scene.RegionInfo.RegionLocX - neighbourx) * Constants.RegionSize; | 1434 | newposition.X += (scene.RegionInfo.LegacyRegionLocX - neighbourx) * Constants.RegionSize; |
1435 | newposition.Y += (scene.RegionInfo.RegionLocY - neighboury) * Constants.RegionSize; | 1435 | newposition.Y += (scene.RegionInfo.LegacyRegionLocY - neighboury) * Constants.RegionSize; |
1436 | agent.ControllingClient.SendAgentAlertMessage( | 1436 | agent.ControllingClient.SendAgentAlertMessage( |
1437 | String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false); | 1437 | String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false); |
1438 | InformClientToInitiateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene); | 1438 | InformClientToInitiateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene); |
@@ -1462,8 +1462,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1462 | neighboury = ba.TriggerRegionY; | 1462 | neighboury = ba.TriggerRegionY; |
1463 | neighbourx = ba.TriggerRegionX; | 1463 | neighbourx = ba.TriggerRegionX; |
1464 | Vector3 newposition = pos; | 1464 | Vector3 newposition = pos; |
1465 | newposition.X += (scene.RegionInfo.RegionLocX - neighbourx) * Constants.RegionSize; | 1465 | newposition.X += (scene.RegionInfo.LegacyRegionLocX - neighbourx) * Constants.RegionSize; |
1466 | newposition.Y += (scene.RegionInfo.RegionLocY - neighboury) * Constants.RegionSize; | 1466 | newposition.Y += (scene.RegionInfo.LegacyRegionLocY - neighboury) * Constants.RegionSize; |
1467 | agent.ControllingClient.SendAgentAlertMessage( | 1467 | agent.ControllingClient.SendAgentAlertMessage( |
1468 | String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false); | 1468 | String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false); |
1469 | InformClientToInitiateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene); | 1469 | InformClientToInitiateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene); |
@@ -1492,8 +1492,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1492 | neighboury = b.TriggerRegionY; | 1492 | neighboury = b.TriggerRegionY; |
1493 | neighbourx = b.TriggerRegionX; | 1493 | neighbourx = b.TriggerRegionX; |
1494 | Vector3 newposition = pos; | 1494 | Vector3 newposition = pos; |
1495 | newposition.X += (scene.RegionInfo.RegionLocX - neighbourx) * Constants.RegionSize; | 1495 | newposition.X += (scene.RegionInfo.LegacyRegionLocX - neighbourx) * Constants.RegionSize; |
1496 | newposition.Y += (scene.RegionInfo.RegionLocY - neighboury) * Constants.RegionSize; | 1496 | newposition.Y += (scene.RegionInfo.LegacyRegionLocY - neighboury) * Constants.RegionSize; |
1497 | agent.ControllingClient.SendAgentAlertMessage( | 1497 | agent.ControllingClient.SendAgentAlertMessage( |
1498 | String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false); | 1498 | String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false); |
1499 | InformClientToInitiateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene); | 1499 | InformClientToInitiateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene); |
@@ -1901,7 +1901,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1901 | 1901 | ||
1902 | if (m_regionInfo != null) | 1902 | if (m_regionInfo != null) |
1903 | { | 1903 | { |
1904 | neighbours = RequestNeighbours(sp, m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); | 1904 | neighbours = RequestNeighbours(sp, m_regionInfo.LegacyRegionLocX, m_regionInfo.LegacyRegionLocY); |
1905 | } | 1905 | } |
1906 | else | 1906 | else |
1907 | { | 1907 | { |
@@ -2057,8 +2057,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2057 | 2057 | ||
2058 | Vector3 CalculateOffset(ScenePresence sp, GridRegion neighbour) | 2058 | Vector3 CalculateOffset(ScenePresence sp, GridRegion neighbour) |
2059 | { | 2059 | { |
2060 | int rRegionX = (int)sp.Scene.RegionInfo.RegionLocX; | 2060 | int rRegionX = (int)sp.Scene.RegionInfo.LegacyRegionLocX; |
2061 | int rRegionY = (int)sp.Scene.RegionInfo.RegionLocY; | 2061 | int rRegionY = (int)sp.Scene.RegionInfo.LegacyRegionLocY; |
2062 | int tRegionX = neighbour.RegionLocX / (int)Constants.RegionSize; | 2062 | int tRegionX = neighbour.RegionLocX / (int)Constants.RegionSize; |
2063 | int tRegionY = neighbour.RegionLocY / (int)Constants.RegionSize; | 2063 | int tRegionY = neighbour.RegionLocY / (int)Constants.RegionSize; |
2064 | int shiftx = (rRegionX - tRegionX) * (int)Constants.RegionSize; | 2064 | int shiftx = (rRegionX - tRegionX) * (int)Constants.RegionSize; |
@@ -2161,10 +2161,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2161 | extent.X = ((int)extent.X / (int)Constants.RegionSize); | 2161 | extent.X = ((int)extent.X / (int)Constants.RegionSize); |
2162 | extent.Y = ((int)extent.Y / (int)Constants.RegionSize); | 2162 | extent.Y = ((int)extent.Y / (int)Constants.RegionSize); |
2163 | 2163 | ||
2164 | swCorner.X = Scene.RegionInfo.RegionLocX - 1; | 2164 | swCorner.X = Scene.RegionInfo.LegacyRegionLocX - 1; |
2165 | swCorner.Y = Scene.RegionInfo.RegionLocY - 1; | 2165 | swCorner.Y = Scene.RegionInfo.LegacyRegionLocY - 1; |
2166 | neCorner.X = Scene.RegionInfo.RegionLocX + extent.X; | 2166 | neCorner.X = Scene.RegionInfo.LegacyRegionLocX + extent.X; |
2167 | neCorner.Y = Scene.RegionInfo.RegionLocY + extent.Y; | 2167 | neCorner.Y = Scene.RegionInfo.LegacyRegionLocY + extent.Y; |
2168 | } | 2168 | } |
2169 | 2169 | ||
2170 | /// <summary> | 2170 | /// <summary> |
@@ -2301,8 +2301,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2301 | return; | 2301 | return; |
2302 | } | 2302 | } |
2303 | 2303 | ||
2304 | int thisx = (int)scene.RegionInfo.RegionLocX; | 2304 | int thisx = (int)scene.RegionInfo.LegacyRegionLocX; |
2305 | int thisy = (int)scene.RegionInfo.RegionLocY; | 2305 | int thisy = (int)scene.RegionInfo.LegacyRegionLocY; |
2306 | Vector3 EastCross = new Vector3(0.1f, 0, 0); | 2306 | Vector3 EastCross = new Vector3(0.1f, 0, 0); |
2307 | Vector3 WestCross = new Vector3(-0.1f, 0, 0); | 2307 | Vector3 WestCross = new Vector3(-0.1f, 0, 0); |
2308 | Vector3 NorthCross = new Vector3(0, 0.1f, 0); | 2308 | Vector3 NorthCross = new Vector3(0, 0.1f, 0); |