aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-01-30 21:34:40 +0000
committerJustin Clark-Casey (justincc)2012-01-30 21:34:40 +0000
commitdbc039783b9e7c6fd35b7a4ddeae130b8472e47f (patch)
tree74efd0d057166de50970b88275ac4dca92bebf4a /OpenSim
parentlock SceneObjectGroupsByFullID in SceneGraph.ForEachSOG() to stop failure if ... (diff)
parentPatch in the rest of the maptile stuff (diff)
downloadopensim-SC-dbc039783b9e7c6fd35b7a4ddeae130b8472e47f.zip
opensim-SC-dbc039783b9e7c6fd35b7a4ddeae130b8472e47f.tar.gz
opensim-SC-dbc039783b9e7c6fd35b7a4ddeae130b8472e47f.tar.bz2
opensim-SC-dbc039783b9e7c6fd35b7a4ddeae130b8472e47f.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/MySQL/Resources/GridStore.migrations9
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs48
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs9
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;
94alter table regions modify column regionName varchar(128) default NULL; 94alter table regions modify column regionName varchar(128) default NULL;
95 95
96COMMIT; 96COMMIT;
97
98:VERSION 9 # ------------
99
100BEGIN;
101
102alter table regions add column `parcelMapTexture` varchar(36) default NULL;
103
104COMMIT;
105
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)
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 7137f9a..d809996 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
@@ -359,6 +362,7 @@ namespace OpenSim.Services.Interfaces
359 kvp["serverURI"] = ServerURI; 362 kvp["serverURI"] = ServerURI;
360 kvp["serverPort"] = InternalEndPoint.Port.ToString(); 363 kvp["serverPort"] = InternalEndPoint.Port.ToString();
361 kvp["regionMapTexture"] = TerrainImage.ToString(); 364 kvp["regionMapTexture"] = TerrainImage.ToString();
365 kvp["parcelMapTexture"] = ParcelImage.ToString();
362 kvp["access"] = Access.ToString(); 366 kvp["access"] = Access.ToString();
363 kvp["regionSecret"] = RegionSecret; 367 kvp["regionSecret"] = RegionSecret;
364 kvp["owner_uuid"] = EstateOwner.ToString(); 368 kvp["owner_uuid"] = EstateOwner.ToString();
@@ -411,6 +415,9 @@ namespace OpenSim.Services.Interfaces
411 if (kvp.ContainsKey("regionMapTexture")) 415 if (kvp.ContainsKey("regionMapTexture"))
412 UUID.TryParse((string)kvp["regionMapTexture"], out TerrainImage); 416 UUID.TryParse((string)kvp["regionMapTexture"], out TerrainImage);
413 417
418 if (kvp.ContainsKey("parcelMapTexture"))
419 UUID.TryParse((string)kvp["parcelMapTexture"], out ParcelImage);
420
414 if (kvp.ContainsKey("access")) 421 if (kvp.ContainsKey("access"))
415 Access = Byte.Parse((string)kvp["access"]); 422 Access = Byte.Parse((string)kvp["access"]);
416 423