aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorTeravus Ovares2008-06-14 02:39:27 +0000
committerTeravus Ovares2008-06-14 02:39:27 +0000
commit6bea792436521c1635eed73a002975f4334c9354 (patch)
treeb4a443457851d845f82e93c577e04ce9e85e4660 /OpenSim/Region
parentsave_assets_to_file path shouldn't always assume uploaded (diff)
downloadopensim-SC_OLD-6bea792436521c1635eed73a002975f4334c9354.zip
opensim-SC_OLD-6bea792436521c1635eed73a002975f4334c9354.tar.gz
opensim-SC_OLD-6bea792436521c1635eed73a002975f4334c9354.tar.bz2
opensim-SC_OLD-6bea792436521c1635eed73a002975f4334c9354.tar.xz
* Enables maptile display in grid mode for simulators that are not on the same instance.
* Only generates a new maptile after a refresh interval * Maptile names have the UnixTimeSinceEpoch that they were generated and the regionUUID they're from, so you can know which ones are no longer necessary. * Updates RegionInfo, so backup your /bin/Region/*.xml files.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs2
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs1
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs81
4 files changed, 82 insertions, 6 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index f96c29b..6d74903 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -511,7 +511,7 @@ namespace OpenSim
511 511
512 //moved these here as the terrain texture has to be created after the modules are initialized 512 //moved these here as the terrain texture has to be created after the modules are initialized
513 // and has to happen before the region is registered with the grid. 513 // and has to happen before the region is registered with the grid.
514 scene.CreateTerrainTexture(true); 514 scene.CreateTerrainTexture(false);
515 515
516 try 516 try
517 { 517 {
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 5cbe04e..0b2aa52 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1224,6 +1224,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1224 { 1224 {
1225 mapReply.Data[i] = new MapBlockReplyPacket.DataBlock(); 1225 mapReply.Data[i] = new MapBlockReplyPacket.DataBlock();
1226 mapReply.Data[i].MapImageID = mapBlocks2[i].MapImageId; 1226 mapReply.Data[i].MapImageID = mapBlocks2[i].MapImageId;
1227 //m_log.Warn(mapBlocks2[i].MapImageId.ToString());
1227 mapReply.Data[i].X = mapBlocks2[i].X; 1228 mapReply.Data[i].X = mapBlocks2[i].X;
1228 mapReply.Data[i].Y = mapBlocks2[i].Y; 1229 mapReply.Data[i].Y = mapBlocks2[i].Y;
1229 mapReply.Data[i].WaterHeight = mapBlocks2[i].WaterHeight; 1230 mapReply.Data[i].WaterHeight = mapBlocks2[i].WaterHeight;
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
index e2b7fb2..9d8bbfc 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
@@ -389,7 +389,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
389 m_tainted = false; 389 m_tainted = false;
390 m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised()); 390 m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised());
391 m_scene.SaveTerrain(); 391 m_scene.SaveTerrain();
392 m_scene.CreateTerrainTexture(true); 392
393 // Clients who look at the map will never see changes after they looked at the map, so i've commented this out.
394 //m_scene.CreateTerrainTexture(true);
393 } 395 }
394 } 396 }
395 397
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index e70fbe2..a7535e1 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1287,12 +1287,51 @@ namespace OpenSim.Region.Environment.Scenes
1287 return; 1287 return;
1288 } 1288 }
1289 1289
1290 m_regInfo.EstateSettings.terrainImageID = LLUUID.Random(); 1290
1291
1292 LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID;
1293
1294 int lastMapRefresh = 0;
1295 int twoDays = 172800;
1296 int RefreshSeconds = twoDays;
1297
1298 try
1299 {
1300 lastMapRefresh = Convert.ToInt32(m_regInfo.lastMapRefresh);
1301 } catch (ArgumentException)
1302 {}
1303 catch (FormatException)
1304 {}
1305 catch (OverflowException)
1306 {}
1307
1308 LLUUID TerrainImageLLUUID = LLUUID.Random();
1309
1310 if (lastMapRegionUUID == LLUUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch())
1311 {
1312
1313 m_regInfo.SaveLastMapUUID(TerrainImageLLUUID);
1314
1315 m_log.Warn("[MAPTILE]: STORING MAPTILE IMAGE");
1316 //Extra protection.. probably not needed.
1317
1318 }
1319 else
1320 {
1321 TerrainImageLLUUID = lastMapRegionUUID;
1322 m_log.Warn("[MAPTILE]: REUSING OLD MAPTILE IMAGE ID");
1323 }
1324
1325
1326
1327 m_regInfo.EstateSettings.terrainImageID = TerrainImageLLUUID;
1328
1291 AssetBase asset = new AssetBase(); 1329 AssetBase asset = new AssetBase();
1292 asset.FullID = m_regInfo.EstateSettings.terrainImageID; 1330 asset.FullID = m_regInfo.EstateSettings.terrainImageID;
1293 asset.Data = data; 1331 asset.Data = data;
1294 asset.Name = "terrainImage"; 1332 asset.Name = "terrainImage_" + m_regInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString();
1295 asset.Description = RegionInfo.RegionName; 1333 asset.Description = RegionInfo.RegionName;
1334
1296 asset.Type = 0; 1335 asset.Type = 0;
1297 asset.Temporary = temporary; 1336 asset.Temporary = temporary;
1298 AssetCache.AddAsset(asset); 1337 AssetCache.AddAsset(asset);
@@ -1302,11 +1341,45 @@ namespace OpenSim.Region.Environment.Scenes
1302 byte[] data = terrain.WriteJpeg2000Image("defaultstripe.png"); 1341 byte[] data = terrain.WriteJpeg2000Image("defaultstripe.png");
1303 if (data != null) 1342 if (data != null)
1304 { 1343 {
1305 m_regInfo.EstateSettings.terrainImageID = LLUUID.Random(); 1344 LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID;
1345
1346 int lastMapRefresh = 0;
1347 int twoDays = 172800;
1348 int RefreshSeconds = twoDays;
1349
1350 try
1351 {
1352 lastMapRefresh = Convert.ToInt32(m_regInfo.lastMapRefresh);
1353 }
1354 catch (ArgumentException)
1355 { }
1356 catch (FormatException)
1357 { }
1358 catch (OverflowException)
1359 { }
1360
1361 LLUUID TerrainImageLLUUID = LLUUID.Random();
1362
1363 if (lastMapRegionUUID == LLUUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch())
1364 {
1365
1366 m_regInfo.SaveLastMapUUID(TerrainImageLLUUID);
1367
1368 //m_log.Warn(terrainImageID);
1369 //Extra protection.. probably not needed.
1370
1371 }
1372 else
1373 {
1374 TerrainImageLLUUID = lastMapRegionUUID;
1375 }
1376
1377 m_regInfo.EstateSettings.terrainImageID = TerrainImageLLUUID;
1378
1306 AssetBase asset = new AssetBase(); 1379 AssetBase asset = new AssetBase();
1307 asset.FullID = m_regInfo.EstateSettings.terrainImageID; 1380 asset.FullID = m_regInfo.EstateSettings.terrainImageID;
1308 asset.Data = data; 1381 asset.Data = data;
1309 asset.Name = "terrainImage"; 1382 asset.Name = "terrainImage_" + m_regInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString();
1310 asset.Description = RegionInfo.RegionName; 1383 asset.Description = RegionInfo.RegionName;
1311 asset.Type = 0; 1384 asset.Type = 0;
1312 asset.Temporary = temporary; 1385 asset.Temporary = temporary;