aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorJohn Hurliman2009-11-05 13:10:58 -0800
committerJohn Hurliman2009-11-05 13:10:58 -0800
commitafef1ac191d32e9c1514c294b17e404b1d4ae217 (patch)
treec390ef81c9c30922c2e95e32844832919884fd9c /OpenSim/Region/CoreModules/World
parentApplying #4332, optional packet statistics logging (diff)
downloadopensim-SC_OLD-afef1ac191d32e9c1514c294b17e404b1d4ae217.zip
opensim-SC_OLD-afef1ac191d32e9c1514c294b17e404b1d4ae217.tar.gz
opensim-SC_OLD-afef1ac191d32e9c1514c294b17e404b1d4ae217.tar.bz2
opensim-SC_OLD-afef1ac191d32e9c1514c294b17e404b1d4ae217.tar.xz
Changing the AssetBase constructors to avoid initializing assets with an unknown asset type, and log an error if it ever does happen
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs3
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs7
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs10
4 files changed, 10 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index c261943..70a225e 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -332,10 +332,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
332 { 332 {
333 sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; 333 sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
334 334
335 if (assetType == (sbyte)AssetType.Unknown)
336 m_log.WarnFormat("[ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid);
337
335 //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); 338 //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
336 339
337 AssetBase asset = new AssetBase(new UUID(uuid), String.Empty); 340 AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType);
338 asset.Type = assetType;
339 asset.Data = data; 341 asset.Data = data;
340 342
341 // We're relying on the asset service to do the sensible thing and not store the asset if it already 343 // We're relying on the asset service to do the sensible thing and not store the asset if it already
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs
index 5208e7a..2d2c570 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs
@@ -158,9 +158,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
158 158
159 m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); 159 m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename);
160 160
161 AssetBase asset = new AssetBase(new UUID(filename), metadata.Name); 161 AssetBase asset = new AssetBase(new UUID(filename), metadata.Name, metadata.AssetType);
162 asset.Description = metadata.Description; 162 asset.Description = metadata.Description;
163 asset.Type = metadata.AssetType;
164 asset.Data = data; 163 asset.Data = data;
165 164
166 m_cache.Store(asset); 165 m_cache.Store(asset);
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs
index ddac515..2ff635b 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs
@@ -52,16 +52,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
52 52
53 public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename) 53 public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename)
54 { 54 {
55 55 m_asset = new AssetBase(UUID.Zero, pClientFilename, type);
56 m_asset = new AssetBase();
57 m_asset.FullID = UUID.Zero;
58 m_asset.Type = type;
59 m_asset.Data = new byte[0]; 56 m_asset.Data = new byte[0];
60 m_asset.Name = pClientFilename;
61 m_asset.Description = "empty"; 57 m_asset.Description = "empty";
62 m_asset.Local = true; 58 m_asset.Local = true;
63 m_asset.Temporary = true; 59 m_asset.Temporary = true;
64
65 } 60 }
66 61
67 public ulong XferID 62 public ulong XferID
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index f4b54aa..44a651f 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -1077,14 +1077,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1077 1077
1078 m_scene.RegionInfo.RegionSettings.TerrainImageID = TerrainImageUUID; 1078 m_scene.RegionInfo.RegionSettings.TerrainImageID = TerrainImageUUID;
1079 1079
1080 AssetBase asset = new AssetBase(); 1080 AssetBase asset = new AssetBase(
1081 asset.FullID = m_scene.RegionInfo.RegionSettings.TerrainImageID; 1081 m_scene.RegionInfo.RegionSettings.TerrainImageID,
1082 "terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(),
1083 (sbyte)AssetType.Texture);
1082 asset.Data = data; 1084 asset.Data = data;
1083 asset.Name
1084 = "terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString();
1085 asset.Description = m_scene.RegionInfo.RegionName; 1085 asset.Description = m_scene.RegionInfo.RegionName;
1086
1087 asset.Type = 0;
1088 asset.Temporary = temporary; 1086 asset.Temporary = temporary;
1089 m_scene.AssetService.Store(asset); 1087 m_scene.AssetService.Store(asset);
1090 } 1088 }