diff options
author | Robert Adams | 2013-12-26 22:45:59 -0800 |
---|---|---|
committer | Robert Adams | 2013-12-26 22:45:59 -0800 |
commit | 2d2bea4aa75ff6e82384f0842fe3719bf946b1cc (patch) | |
tree | 9c1429ad59674925944ece4ec366888794e91822 /OpenSim/Region/CoreModules/World/WorldMap | |
parent | varregion: add lots of DEBUG level log messages. Especially for teleport. (diff) | |
download | opensim-SC_OLD-2d2bea4aa75ff6e82384f0842fe3719bf946b1cc.zip opensim-SC_OLD-2d2bea4aa75ff6e82384f0842fe3719bf946b1cc.tar.gz opensim-SC_OLD-2d2bea4aa75ff6e82384f0842fe3719bf946b1cc.tar.bz2 opensim-SC_OLD-2d2bea4aa75ff6e82384f0842fe3719bf946b1cc.tar.xz |
varregion: many more updates removing the constant RegionSize and replacing
with a passed region size. This time in the map code and grid services code.
Diffstat (limited to 'OpenSim/Region/CoreModules/World/WorldMap')
-rw-r--r-- | OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 37 |
2 files changed, 19 insertions, 22 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index 708a9a2..1fb1aba 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | |||
@@ -184,8 +184,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
184 | data.Name = info.RegionName; | 184 | data.Name = info.RegionName; |
185 | data.RegionFlags = 0; // TODO not used? | 185 | data.RegionFlags = 0; // TODO not used? |
186 | data.WaterHeight = 0; // not used | 186 | data.WaterHeight = 0; // not used |
187 | data.X = (ushort)(info.RegionLocX / Constants.RegionSize); | 187 | data.X = (ushort)Util.WorldToRegionLoc((uint)info.RegionLocX); |
188 | data.Y = (ushort)(info.RegionLocY / Constants.RegionSize); | 188 | data.Y = (ushort)Util.WorldToRegionLoc((uint)info.RegionLocY); |
189 | blocks.Add(data); | 189 | blocks.Add(data); |
190 | } | 190 | } |
191 | } | 191 | } |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index cd315b1..4badb12 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -277,11 +277,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
277 | { | 277 | { |
278 | List<MapBlockData> mapBlocks = new List<MapBlockData>(); ; | 278 | List<MapBlockData> mapBlocks = new List<MapBlockData>(); ; |
279 | 279 | ||
280 | // Get regions that are within 8 regions of here | ||
280 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, | 281 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, |
281 | (int)(m_scene.RegionInfo.RegionLocX - 8) * (int)Constants.RegionSize, | 282 | (int)Util.RegionToWorldLoc(m_scene.RegionInfo.RegionLocX - 8), |
282 | (int)(m_scene.RegionInfo.RegionLocX + 8) * (int)Constants.RegionSize, | 283 | (int)Util.RegionToWorldLoc(m_scene.RegionInfo.RegionLocX + 8), |
283 | (int)(m_scene.RegionInfo.RegionLocY - 8) * (int)Constants.RegionSize, | 284 | (int)Util.RegionToWorldLoc(m_scene.RegionInfo.RegionLocY - 8), |
284 | (int)(m_scene.RegionInfo.RegionLocY + 8) * (int)Constants.RegionSize); | 285 | (int)Util.RegionToWorldLoc(m_scene.RegionInfo.RegionLocY + 8) ); |
285 | foreach (GridRegion r in regions) | 286 | foreach (GridRegion r in regions) |
286 | { | 287 | { |
287 | MapBlockData block = new MapBlockData(); | 288 | MapBlockData block = new MapBlockData(); |
@@ -1011,17 +1012,15 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1011 | // on an unloaded square. | 1012 | // on an unloaded square. |
1012 | // But make sure: Look whether the one we requested is in there | 1013 | // But make sure: Look whether the one we requested is in there |
1013 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, | 1014 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, |
1014 | minX * (int)Constants.RegionSize, | 1015 | (int)Util.RegionToWorldLoc((uint)minX), (int)Util.RegionToWorldLoc((uint)maxX), |
1015 | maxX * (int)Constants.RegionSize, | 1016 | (int)Util.RegionToWorldLoc((uint)minY), (int)Util.RegionToWorldLoc((uint)maxY) ); |
1016 | minY * (int)Constants.RegionSize, | ||
1017 | maxY * (int)Constants.RegionSize); | ||
1018 | 1017 | ||
1019 | if (regions != null) | 1018 | if (regions != null) |
1020 | { | 1019 | { |
1021 | foreach (GridRegion r in regions) | 1020 | foreach (GridRegion r in regions) |
1022 | { | 1021 | { |
1023 | if ((r.RegionLocX == minX * (int)Constants.RegionSize) && | 1022 | if (r.RegionLocX == Util.RegionToWorldLoc((uint)minX) |
1024 | (r.RegionLocY == minY * (int)Constants.RegionSize)) | 1023 | && r.RegionLocY == Util.RegionToWorldLoc((uint)minY) ) |
1025 | { | 1024 | { |
1026 | // found it => add it to response | 1025 | // found it => add it to response |
1027 | MapBlockData block = new MapBlockData(); | 1026 | MapBlockData block = new MapBlockData(); |
@@ -1055,10 +1054,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1055 | { | 1054 | { |
1056 | List<MapBlockData> mapBlocks = new List<MapBlockData>(); | 1055 | List<MapBlockData> mapBlocks = new List<MapBlockData>(); |
1057 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, | 1056 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, |
1058 | (minX - 4) * (int)Constants.RegionSize, | 1057 | (int)Util.RegionToWorldLoc((uint)(minX - 4)), (int)Util.RegionToWorldLoc((uint)(maxX + 4)), |
1059 | (maxX + 4) * (int)Constants.RegionSize, | 1058 | (int)Util.RegionToWorldLoc((uint)(minY - 4)), (int)Util.RegionToWorldLoc((uint)(maxY + 4)) ); |
1060 | (minY - 4) * (int)Constants.RegionSize, | ||
1061 | (maxY + 4) * (int)Constants.RegionSize); | ||
1062 | foreach (GridRegion r in regions) | 1059 | foreach (GridRegion r in regions) |
1063 | { | 1060 | { |
1064 | MapBlockData block = new MapBlockData(); | 1061 | MapBlockData block = new MapBlockData(); |
@@ -1086,8 +1083,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1086 | break; | 1083 | break; |
1087 | } | 1084 | } |
1088 | block.Name = r.RegionName; | 1085 | block.Name = r.RegionName; |
1089 | block.X = (ushort)(r.RegionLocX / Constants.RegionSize); | 1086 | block.X = (ushort)Util.WorldToRegionLoc((uint)r.RegionLocX); |
1090 | block.Y = (ushort)(r.RegionLocY / Constants.RegionSize); | 1087 | block.Y = (ushort)Util.WorldToRegionLoc((uint)r.RegionLocY); |
1091 | } | 1088 | } |
1092 | 1089 | ||
1093 | public Hashtable OnHTTPThrottled(Hashtable keysvals) | 1090 | public Hashtable OnHTTPThrottled(Hashtable keysvals) |
@@ -1218,10 +1215,10 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1218 | 1215 | ||
1219 | List<MapBlockData> mapBlocks = new List<MapBlockData>(); | 1216 | List<MapBlockData> mapBlocks = new List<MapBlockData>(); |
1220 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, | 1217 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, |
1221 | (int)(m_scene.RegionInfo.RegionLocX - 9) * (int)Constants.RegionSize, | 1218 | (int)Util.RegionToWorldLoc(m_scene.RegionInfo.RegionLocX - 9), |
1222 | (int)(m_scene.RegionInfo.RegionLocX + 9) * (int)Constants.RegionSize, | 1219 | (int)Util.RegionToWorldLoc(m_scene.RegionInfo.RegionLocX + 9), |
1223 | (int)(m_scene.RegionInfo.RegionLocY - 9) * (int)Constants.RegionSize, | 1220 | (int)Util.RegionToWorldLoc(m_scene.RegionInfo.RegionLocY - 9), |
1224 | (int)(m_scene.RegionInfo.RegionLocY + 9) * (int)Constants.RegionSize); | 1221 | (int)Util.RegionToWorldLoc(m_scene.RegionInfo.RegionLocY + 9)); |
1225 | List<AssetBase> textures = new List<AssetBase>(); | 1222 | List<AssetBase> textures = new List<AssetBase>(); |
1226 | List<Image> bitImages = new List<Image>(); | 1223 | List<Image> bitImages = new List<Image>(); |
1227 | 1224 | ||