aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie2012-01-30 19:46:55 +0000
committerMelanie2012-01-30 19:46:55 +0000
commitdf9c35bc0f12cfd64414c5cf1c4a7f135884f2ee (patch)
treee56e24d8378cee4b98fb23999927b61968625aaf /OpenSim/Region/CoreModules
parentPickup map overlay tile from RegionSettings.ParcelImageID (diff)
downloadopensim-SC-df9c35bc0f12cfd64414c5cf1c4a7f135884f2ee.zip
opensim-SC-df9c35bc0f12cfd64414c5cf1c4a7f135884f2ee.tar.gz
opensim-SC-df9c35bc0f12cfd64414c5cf1c4a7f135884f2ee.tar.bz2
opensim-SC-df9c35bc0f12cfd64414c5cf1c4a7f135884f2ee.tar.xz
Some plumbing for map overlays
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs35
1 files changed, 20 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index bbf6b05..103d128 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -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, flags & 0xffff);
994 else
995 remoteClient.SendMapBlock(response, 0);
996 } 994 }
997 else 995 else
998 { 996 {
@@ -1012,21 +1010,28 @@ 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 = m_scene.RegionInfo.RegionSettings.ParcelImageID; 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 }
1030 block.Name = r.RegionName; 1035 block.Name = r.RegionName;
1031 block.X = (ushort)(r.RegionLocX / Constants.RegionSize); 1036 block.X = (ushort)(r.RegionLocX / Constants.RegionSize);
1032 block.Y = (ushort)(r.RegionLocY / Constants.RegionSize); 1037 block.Y = (ushort)(r.RegionLocY / Constants.RegionSize);
@@ -1160,7 +1165,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1160 foreach (GridRegion r in regions) 1165 foreach (GridRegion r in regions)
1161 { 1166 {
1162 MapBlockData mapBlock = new MapBlockData(); 1167 MapBlockData mapBlock = new MapBlockData();
1163 MapBlockFromGridRegion(mapBlock, r); 1168 MapBlockFromGridRegion(mapBlock, r, 0);
1164 AssetBase texAsset = m_scene.AssetService.Get(mapBlock.MapImageId.ToString()); 1169 AssetBase texAsset = m_scene.AssetService.Get(mapBlock.MapImageId.ToString());
1165 1170
1166 if (texAsset != null) 1171 if (texAsset != null)