diff options
-rw-r--r-- | OpenSim/Data/MySQL/Resources/GridStore.migrations | 9 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 48 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IGridService.cs | 9 |
3 files changed, 46 insertions, 20 deletions
diff --git a/OpenSim/Data/MySQL/Resources/GridStore.migrations b/OpenSim/Data/MySQL/Resources/GridStore.migrations index eda6dbb..98ba8c5 100644 --- a/OpenSim/Data/MySQL/Resources/GridStore.migrations +++ b/OpenSim/Data/MySQL/Resources/GridStore.migrations | |||
@@ -94,3 +94,12 @@ BEGIN; | |||
94 | alter table regions modify column regionName varchar(128) default NULL; | 94 | alter table regions modify column regionName varchar(128) default NULL; |
95 | 95 | ||
96 | COMMIT; | 96 | COMMIT; |
97 | |||
98 | :VERSION 9 # ------------ | ||
99 | |||
100 | BEGIN; | ||
101 | |||
102 | alter table regions add column `parcelMapTexture` varchar(36) default NULL; | ||
103 | |||
104 | COMMIT; | ||
105 | |||
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 9a763ee..37296af 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) |
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index 2b0b947..cdcb961 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs | |||
@@ -190,6 +190,7 @@ namespace OpenSim.Services.Interfaces | |||
190 | public UUID ScopeID = UUID.Zero; | 190 | public UUID ScopeID = UUID.Zero; |
191 | 191 | ||
192 | public UUID TerrainImage = UUID.Zero; | 192 | public UUID TerrainImage = UUID.Zero; |
193 | public UUID ParcelImage = UUID.Zero; | ||
193 | public byte Access; | 194 | public byte Access; |
194 | public int Maturity; | 195 | public int Maturity; |
195 | public string RegionSecret = string.Empty; | 196 | public string RegionSecret = string.Empty; |
@@ -236,6 +237,7 @@ namespace OpenSim.Services.Interfaces | |||
236 | RegionID = ConvertFrom.RegionID; | 237 | RegionID = ConvertFrom.RegionID; |
237 | ServerURI = ConvertFrom.ServerURI; | 238 | ServerURI = ConvertFrom.ServerURI; |
238 | TerrainImage = ConvertFrom.RegionSettings.TerrainImageID; | 239 | TerrainImage = ConvertFrom.RegionSettings.TerrainImageID; |
240 | ParcelImage = ConvertFrom.RegionSettings.ParcelImageID; | ||
239 | Access = ConvertFrom.AccessLevel; | 241 | Access = ConvertFrom.AccessLevel; |
240 | Maturity = ConvertFrom.RegionSettings.Maturity; | 242 | Maturity = ConvertFrom.RegionSettings.Maturity; |
241 | RegionSecret = ConvertFrom.regionSecret; | 243 | RegionSecret = ConvertFrom.regionSecret; |
@@ -253,6 +255,7 @@ namespace OpenSim.Services.Interfaces | |||
253 | RegionID = ConvertFrom.RegionID; | 255 | RegionID = ConvertFrom.RegionID; |
254 | ServerURI = ConvertFrom.ServerURI; | 256 | ServerURI = ConvertFrom.ServerURI; |
255 | TerrainImage = ConvertFrom.TerrainImage; | 257 | TerrainImage = ConvertFrom.TerrainImage; |
258 | ParcelImage = ConvertFrom.ParcelImage; | ||
256 | Access = ConvertFrom.Access; | 259 | Access = ConvertFrom.Access; |
257 | Maturity = ConvertFrom.Maturity; | 260 | Maturity = ConvertFrom.Maturity; |
258 | RegionSecret = ConvertFrom.RegionSecret; | 261 | RegionSecret = ConvertFrom.RegionSecret; |
@@ -281,7 +284,7 @@ namespace OpenSim.Services.Interfaces | |||
281 | 284 | ||
282 | public override int GetHashCode() | 285 | public override int GetHashCode() |
283 | { | 286 | { |
284 | return RegionID.GetHashCode() ^ TerrainImage.GetHashCode(); | 287 | return RegionID.GetHashCode() ^ TerrainImage.GetHashCode() ^ ParcelImage.GetHashCode(); |
285 | } | 288 | } |
286 | 289 | ||
287 | #endregion | 290 | #endregion |
@@ -363,6 +366,7 @@ namespace OpenSim.Services.Interfaces | |||
363 | kvp["serverURI"] = ServerURI; | 366 | kvp["serverURI"] = ServerURI; |
364 | kvp["serverPort"] = InternalEndPoint.Port.ToString(); | 367 | kvp["serverPort"] = InternalEndPoint.Port.ToString(); |
365 | kvp["regionMapTexture"] = TerrainImage.ToString(); | 368 | kvp["regionMapTexture"] = TerrainImage.ToString(); |
369 | kvp["parcelMapTexture"] = ParcelImage.ToString(); | ||
366 | kvp["access"] = Access.ToString(); | 370 | kvp["access"] = Access.ToString(); |
367 | kvp["regionSecret"] = RegionSecret; | 371 | kvp["regionSecret"] = RegionSecret; |
368 | kvp["owner_uuid"] = EstateOwner.ToString(); | 372 | kvp["owner_uuid"] = EstateOwner.ToString(); |
@@ -421,6 +425,9 @@ namespace OpenSim.Services.Interfaces | |||
421 | if (kvp.ContainsKey("regionMapTexture")) | 425 | if (kvp.ContainsKey("regionMapTexture")) |
422 | UUID.TryParse((string)kvp["regionMapTexture"], out TerrainImage); | 426 | UUID.TryParse((string)kvp["regionMapTexture"], out TerrainImage); |
423 | 427 | ||
428 | if (kvp.ContainsKey("parcelMapTexture")) | ||
429 | UUID.TryParse((string)kvp["parcelMapTexture"], out ParcelImage); | ||
430 | |||
424 | if (kvp.ContainsKey("access")) | 431 | if (kvp.ContainsKey("access")) |
425 | Access = Byte.Parse((string)kvp["access"]); | 432 | Access = Byte.Parse((string)kvp["access"]); |
426 | 433 | ||