aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs48
1 files changed, 29 insertions, 19 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index eac2743..ac95598 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -263,7 +263,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
263 foreach (GridRegion r in regions) 263 foreach (GridRegion r in regions)
264 { 264 {
265 MapBlockData block = new MapBlockData(); 265 MapBlockData block = new MapBlockData();
266 MapBlockFromGridRegion(block, r); 266 MapBlockFromGridRegion(block, r, 0);
267 mapBlocks.Add(block); 267 mapBlocks.Add(block);
268 } 268 }
269 avatarPresence.ControllingClient.SendMapBlock(mapBlocks, 0); 269 avatarPresence.ControllingClient.SendMapBlock(mapBlocks, 0);
@@ -955,8 +955,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
955 { 955 {
956 List<MapBlockData> response = new List<MapBlockData>(); 956 List<MapBlockData> response = new List<MapBlockData>();
957 957
958 // this should return one mapblock at most. 958 // this should return one mapblock at most. It is triggered by a click
959 // (diva note: why?? in that case we should GetRegionByPosition) 959 // on an unloaded square.
960 // But make sure: Look whether the one we requested is in there 960 // But make sure: Look whether the one we requested is in there
961 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, 961 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
962 minX * (int)Constants.RegionSize, 962 minX * (int)Constants.RegionSize,
@@ -973,7 +973,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
973 { 973 {
974 // found it => add it to response 974 // found it => add it to response
975 MapBlockData block = new MapBlockData(); 975 MapBlockData block = new MapBlockData();
976 MapBlockFromGridRegion(block, r); 976 MapBlockFromGridRegion(block, r, flag);
977 response.Add(block); 977 response.Add(block);
978 break; 978 break;
979 } 979 }
@@ -989,10 +989,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
989 block.Access = 254; // means 'simulator is offline' 989 block.Access = 254; // means 'simulator is offline'
990 response.Add(block); 990 response.Add(block);
991 } 991 }
992 if ((flag & 2) == 2) // V2 !!! 992 // The lower 16 bits are an unsigned int16
993 remoteClient.SendMapBlock(response, 2); 993 remoteClient.SendMapBlock(response, flag & 0xffff);
994 else
995 remoteClient.SendMapBlock(response, 0);
996 } 994 }
997 else 995 else
998 { 996 {
@@ -1012,21 +1010,29 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1012 foreach (GridRegion r in regions) 1010 foreach (GridRegion r in regions)
1013 { 1011 {
1014 MapBlockData block = new MapBlockData(); 1012 MapBlockData block = new MapBlockData();
1015 MapBlockFromGridRegion(block, r); 1013 MapBlockFromGridRegion(block, r, flag);
1016 mapBlocks.Add(block); 1014 mapBlocks.Add(block);
1017 } 1015 }
1018 if ((flag & 2) == 2) // V2 !!! 1016 remoteClient.SendMapBlock(mapBlocks, flag & 0xffff);
1019 remoteClient.SendMapBlock(mapBlocks, 2);
1020 else
1021 remoteClient.SendMapBlock(mapBlocks, 0);
1022 1017
1023 return mapBlocks; 1018 return mapBlocks;
1024 } 1019 }
1025 1020
1026 protected void MapBlockFromGridRegion(MapBlockData block, GridRegion r) 1021 protected void MapBlockFromGridRegion(MapBlockData block, GridRegion r, uint flag)
1027 { 1022 {
1028 block.Access = r.Access; 1023 block.Access = r.Access;
1029 block.MapImageId = r.TerrainImage; 1024 switch (flag & 0xffff)
1025 {
1026 case 0:
1027 block.MapImageId = m_scene.RegionInfo.RegionSettings.ParcelImageID;
1028 break;
1029 case 2:
1030 block.MapImageId = m_scene.RegionInfo.RegionSettings.ParcelImageID;
1031 break;
1032 default:
1033 block.MapImageId = UUID.Zero;
1034 break;
1035 }
1030 block.Name = r.RegionName; 1036 block.Name = r.RegionName;
1031 block.X = (ushort)(r.RegionLocX / Constants.RegionSize); 1037 block.X = (ushort)(r.RegionLocX / Constants.RegionSize);
1032 block.Y = (ushort)(r.RegionLocY / Constants.RegionSize); 1038 block.Y = (ushort)(r.RegionLocY / Constants.RegionSize);
@@ -1160,7 +1166,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1160 foreach (GridRegion r in regions) 1166 foreach (GridRegion r in regions)
1161 { 1167 {
1162 MapBlockData mapBlock = new MapBlockData(); 1168 MapBlockData mapBlock = new MapBlockData();
1163 MapBlockFromGridRegion(mapBlock, r); 1169 MapBlockFromGridRegion(mapBlock, r, 0);
1164 AssetBase texAsset = m_scene.AssetService.Get(mapBlock.MapImageId.ToString()); 1170 AssetBase texAsset = m_scene.AssetService.Get(mapBlock.MapImageId.ToString());
1165 1171
1166 if (texAsset != null) 1172 if (texAsset != null)
@@ -1342,6 +1348,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1342 m_log.Debug("[WORLDMAP]: STORING MAPTILE IMAGE"); 1348 m_log.Debug("[WORLDMAP]: STORING MAPTILE IMAGE");
1343 1349
1344 UUID terrainImageID = UUID.Random(); 1350 UUID terrainImageID = UUID.Random();
1351 UUID parcelImageID = UUID.Zero; // UUID.Random();
1345 1352
1346 AssetBase asset = new AssetBase( 1353 AssetBase asset = new AssetBase(
1347 terrainImageID, 1354 terrainImageID,
@@ -1358,13 +1365,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1358 m_scene.AssetService.Store(asset); 1365 m_scene.AssetService.Store(asset);
1359 1366
1360 // Switch to the new one 1367 // Switch to the new one
1361 UUID lastMapRegionUUID = m_scene.RegionInfo.RegionSettings.TerrainImageID; 1368 UUID lastTerrainImageID = m_scene.RegionInfo.RegionSettings.TerrainImageID;
1369 UUID lastParcelImageID = m_scene.RegionInfo.RegionSettings.TerrainImageID;
1362 m_scene.RegionInfo.RegionSettings.TerrainImageID = terrainImageID; 1370 m_scene.RegionInfo.RegionSettings.TerrainImageID = terrainImageID;
1371 m_scene.RegionInfo.RegionSettings.ParcelImageID = parcelImageID;
1363 m_scene.RegionInfo.RegionSettings.Save(); 1372 m_scene.RegionInfo.RegionSettings.Save();
1364 1373
1365 // Delete the old one 1374 // Delete the old one
1366 m_log.DebugFormat("[WORLDMAP]: Deleting old map tile {0}", lastMapRegionUUID); 1375 // m_log.DebugFormat("[WORLDMAP]: Deleting old map tile {0}", lastTerrainImageID);
1367 m_scene.AssetService.Delete(lastMapRegionUUID.ToString()); 1376 m_scene.AssetService.Delete(lastTerrainImageID.ToString());
1377 m_scene.AssetService.Delete(lastParcelImageID.ToString());
1368 } 1378 }
1369 1379
1370 private void MakeRootAgent(ScenePresence avatar) 1380 private void MakeRootAgent(ScenePresence avatar)