aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2015-09-18 02:00:10 +0100
committerUbitUmarov2015-09-18 02:00:10 +0100
commit87ad573ec25b830d68a7b81a06a93b888301647a (patch)
treeb817c618b00c9755ea7c5716617af8c70ec73482
parentsync remote responses for mapItens with the local ones, but sending all valid... (diff)
downloadopensim-SC_OLD-87ad573ec25b830d68a7b81a06a93b888301647a.zip
opensim-SC_OLD-87ad573ec25b830d68a7b81a06a93b888301647a.tar.gz
opensim-SC_OLD-87ad573ec25b830d68a7b81a06a93b888301647a.tar.bz2
opensim-SC_OLD-87ad573ec25b830d68a7b81a06a93b888301647a.tar.xz
MapBlockFromGridRegion and Map2BlockFromGridRegion are the same thing
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs21
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs57
-rw-r--r--OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs1
3 files changed, 16 insertions, 63 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
index ab2e064..3a0bdc3 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
@@ -201,23 +201,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
201 data = new MapBlockData(); 201 data = new MapBlockData();
202 data.Agents = 0; 202 data.Agents = 0;
203 data.Access = info.Access; 203 data.Access = info.Access;
204 if (flags == 2) // V2 sends this 204 MapBlockData block = new MapBlockData();
205 { 205 WorldMap.MapBlockFromGridRegion(block, info, flags);
206 List<MapBlockData> datas = WorldMap.Map2BlockFromGridRegion(info, flags);
207 // ugh! V2-3 is very sensitive about the result being
208 // exactly the same as the requested name
209 206
210 if (regionInfos.Count == 1 && needOriginalName) 207 if (flags == 2 && regionInfos.Count == 1 && needOriginalName)
211 datas.ForEach(d => d.Name = mapNameOrig); 208 block.Name = mapNameOrig;
212 209 blocks.Add(block);
213 blocks.AddRange(datas);
214 }
215 else
216 {
217 MapBlockData block = new MapBlockData();
218 WorldMap.MapBlockFromGridRegion(block,info, flags);
219 blocks.Add(block);
220 }
221 } 210 }
222 } 211 }
223 212
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 59a3499..4c2751f 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -1100,18 +1100,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1100 if (r == null) 1100 if (r == null)
1101 continue; 1101 continue;
1102 MapBlockData block = new MapBlockData(); 1102 MapBlockData block = new MapBlockData();
1103 if ((flag & 2) == 2) 1103 MapBlockFromGridRegion(block, r, flag);
1104 { 1104 mapBlocks.Add(block);
1105 List<MapBlockData> blocks = Map2BlockFromGridRegion(r, flag); 1105 allBlocks.Add(block);
1106 mapBlocks.AddRange(blocks);
1107 allBlocks.AddRange(blocks);
1108 }
1109 else
1110 {
1111 MapBlockFromGridRegion(block, r, flag);
1112 mapBlocks.Add(block);
1113 allBlocks.Add(block);
1114 }
1115 1106
1116 if (mapBlocks.Count >= 10) 1107 if (mapBlocks.Count >= 10)
1117 { 1108 {
@@ -1128,6 +1119,14 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1128 1119
1129 public void MapBlockFromGridRegion(MapBlockData block, GridRegion r, uint flag) 1120 public void MapBlockFromGridRegion(MapBlockData block, GridRegion r, uint flag)
1130 { 1121 {
1122 if (r == null)
1123 {
1124// block.Access = (byte)SimAccess.Down;
1125 block.Access = (byte)SimAccess.NonExistent;
1126 block.MapImageId = UUID.Zero;
1127 return;
1128 }
1129
1131 block.Access = r.Access; 1130 block.Access = r.Access;
1132 switch (flag) 1131 switch (flag)
1133 { 1132 {
@@ -1146,41 +1145,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1146 block.Y = (ushort)(r.RegionLocY / Constants.RegionSize); 1145 block.Y = (ushort)(r.RegionLocY / Constants.RegionSize);
1147 block.SizeX = (ushort)r.RegionSizeX; 1146 block.SizeX = (ushort)r.RegionSizeX;
1148 block.SizeY = (ushort)r.RegionSizeY; 1147 block.SizeY = (ushort)r.RegionSizeY;
1149 }
1150 1148
1151 public List<MapBlockData> Map2BlockFromGridRegion(GridRegion r, uint flag)
1152 {
1153 List<MapBlockData> blocks = new List<MapBlockData>();
1154 MapBlockData block = new MapBlockData();
1155 if (r == null)
1156 {
1157 block.Access = (byte)SimAccess.Down;
1158 block.MapImageId = UUID.Zero;
1159 blocks.Add(block);
1160 }
1161 else
1162 {
1163 block.Access = r.Access;
1164 switch (flag & 0xffff)
1165 {
1166 case 0:
1167 block.MapImageId = r.TerrainImage;
1168 break;
1169 case 2:
1170 block.MapImageId = r.ParcelImage;
1171 break;
1172 default:
1173 block.MapImageId = UUID.Zero;
1174 break;
1175 }
1176 block.Name = r.RegionName;
1177 block.X = (ushort)(r.RegionLocX / Constants.RegionSize);
1178 block.Y = (ushort)(r.RegionLocY / Constants.RegionSize);
1179 block.SizeX = (ushort)r.RegionSizeX;
1180 block.SizeY = (ushort)r.RegionSizeY;
1181 blocks.Add(block);
1182 }
1183 return blocks;
1184 } 1149 }
1185 1150
1186 public Hashtable OnHTTPThrottled(Hashtable keysvals) 1151 public Hashtable OnHTTPThrottled(Hashtable keysvals)
diff --git a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
index e9cf4ad..ee7c4ec 100644
--- a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
@@ -36,7 +36,6 @@ namespace OpenSim.Region.Framework.Interfaces
36 /// Generate a map tile for the scene. a terrain texture for this scene 36 /// Generate a map tile for the scene. a terrain texture for this scene
37 /// </summary> 37 /// </summary>
38 void GenerateMaptile(); 38 void GenerateMaptile();
39 List<MapBlockData> Map2BlockFromGridRegion(GridRegion r, uint flag);
40 void MapBlockFromGridRegion(MapBlockData block, GridRegion r, uint flag); 39 void MapBlockFromGridRegion(MapBlockData block, GridRegion r, uint flag);
41 } 40 }
42} 41}