aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
diff options
context:
space:
mode:
authorDiva Canto2010-05-09 13:39:56 -0700
committerDiva Canto2010-05-09 13:39:56 -0700
commitb233a4b2cab3a39f9edc17130cd7c2f2f807d6bb (patch)
tree0f895f8334a1f98f3ed9f273906f989314400ce5 /OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
parentAdd Delete handler to SQLite (NG) (diff)
downloadopensim-SC_OLD-b233a4b2cab3a39f9edc17130cd7c2f2f807d6bb.zip
opensim-SC_OLD-b233a4b2cab3a39f9edc17130cd7c2f2f807d6bb.tar.gz
opensim-SC_OLD-b233a4b2cab3a39f9edc17130cd7c2f2f807d6bb.tar.bz2
opensim-SC_OLD-b233a4b2cab3a39f9edc17130cd7c2f2f807d6bb.tar.xz
* Fixed spamming the assets table with map tiles. The tile image ID is now stored in regionsettings. Upon generation of a new tile image, the old one is deleted. Tested for SQLite and MySql standalone.
* Fixed small bug with map search where the local sim regions weren't found.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs31
1 files changed, 14 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 2b0e83f..ac6a633 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -1000,7 +1000,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1000 return responsemap; 1000 return responsemap;
1001 } 1001 }
1002 1002
1003 public void LazySaveGeneratedMaptile(byte[] data, bool temporary) 1003 public void RegenerateMaptile(byte[] data)
1004 { 1004 {
1005 // Overwrites the local Asset cache with new maptile data 1005 // Overwrites the local Asset cache with new maptile data
1006 // Assets are single write, this causes the asset server to ignore this update, 1006 // Assets are single write, this causes the asset server to ignore this update,
@@ -1010,7 +1010,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1010 // map tile while protecting the (grid) asset database from bloat caused by a new asset each 1010 // map tile while protecting the (grid) asset database from bloat caused by a new asset each
1011 // time a mapimage is generated! 1011 // time a mapimage is generated!
1012 1012
1013 UUID lastMapRegionUUID = m_scene.RegionInfo.lastMapUUID; 1013 UUID lastMapRegionUUID = m_scene.RegionInfo.RegionSettings.TerrainImageID;
1014 1014
1015 int lastMapRefresh = 0; 1015 int lastMapRefresh = 0;
1016 int twoDays = 172800; 1016 int twoDays = 172800;
@@ -1030,21 +1030,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1030 { 1030 {
1031 } 1031 }
1032 1032
1033 UUID TerrainImageUUID = UUID.Random(); 1033 m_log.Debug("[MAPTILE]: STORING MAPTILE IMAGE");
1034 1034
1035 if (lastMapRegionUUID == UUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch()) 1035 m_scene.RegionInfo.RegionSettings.TerrainImageID = UUID.Random();
1036 {
1037 m_scene.RegionInfo.SaveLastMapUUID(TerrainImageUUID);
1038
1039 m_log.Debug("[MAPTILE]: STORING MAPTILE IMAGE");
1040 }
1041 else
1042 {
1043 TerrainImageUUID = lastMapRegionUUID;
1044 m_log.Debug("[MAPTILE]: REUSING OLD MAPTILE IMAGE ID");
1045 }
1046
1047 m_scene.RegionInfo.RegionSettings.TerrainImageID = TerrainImageUUID;
1048 1036
1049 AssetBase asset = new AssetBase( 1037 AssetBase asset = new AssetBase(
1050 m_scene.RegionInfo.RegionSettings.TerrainImageID, 1038 m_scene.RegionInfo.RegionSettings.TerrainImageID,
@@ -1053,8 +1041,17 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1053 m_scene.RegionInfo.RegionID.ToString()); 1041 m_scene.RegionInfo.RegionID.ToString());
1054 asset.Data = data; 1042 asset.Data = data;
1055 asset.Description = m_scene.RegionInfo.RegionName; 1043 asset.Description = m_scene.RegionInfo.RegionName;
1056 asset.Temporary = temporary; 1044 asset.Temporary = false;
1045 asset.Flags = AssetFlags.Maptile;
1046
1047 // Store the new one
1048 m_log.DebugFormat("[WORLDMAP]: Storing map tile {0}", asset.ID);
1057 m_scene.AssetService.Store(asset); 1049 m_scene.AssetService.Store(asset);
1050 m_scene.RegionInfo.RegionSettings.Save();
1051
1052 // Delete the old one
1053 m_log.DebugFormat("[WORLDMAP]: Deleting old map tile {0}", lastMapRegionUUID);
1054 m_scene.AssetService.Delete(lastMapRegionUUID.ToString());
1058 } 1055 }
1059 1056
1060 private void MakeRootAgent(ScenePresence avatar) 1057 private void MakeRootAgent(ScenePresence avatar)