aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequest.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs29
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs12
4 files changed, 34 insertions, 13 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs
index 872eb77..5bc1952 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs
@@ -35,7 +35,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
35 /// <summary> 35 /// <summary>
36 /// Path for the assets held in an archive 36 /// Path for the assets held in an archive
37 /// </summary> 37 /// </summary>
38 public static readonly string ASSETS_PATH = "textures/"; 38 public static readonly string ASSETS_PATH = "assets/";
39 39
40 /// <summary> 40 /// <summary>
41 /// Extension used for texture assets in archive 41 /// Extension used for texture assets in archive
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequest.cs
index 41f230c..0a710b8 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequest.cs
@@ -92,9 +92,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
92 92
93 foreach (TaskInventoryItem tit in part.TaskInventory.Values) 93 foreach (TaskInventoryItem tit in part.TaskInventory.Values)
94 { 94 {
95 if (tit.Type == (int)InventoryType.Texture) 95 if (tit.Type != (int)InventoryType.Object)
96 { 96 {
97 m_log.DebugFormat("[ARCHIVER]: Recording texture {0} in object {1}", tit.AssetID, part.UUID); 97 m_log.DebugFormat("[ARCHIVER]: Recording asset {0} in object {1}", tit.AssetID, part.UUID);
98 textureUuids[tit.AssetID] = 1; 98 textureUuids[tit.AssetID] = 1;
99 } 99 }
100 } 100 }
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
index ed5f0e7..2a041dd 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
@@ -78,13 +78,21 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
78 78
79 foreach (LLUUID uuid in m_assets.Keys) 79 foreach (LLUUID uuid in m_assets.Keys)
80 { 80 {
81 if (m_assets[uuid] != null) 81 AssetBase asset = m_assets[uuid];
82
83 if (asset != null)
82 { 84 {
83 xtw.WriteStartElement("asset"); 85 xtw.WriteStartElement("asset");
84 86
85 AssetBase asset = m_assets[uuid]; 87 string extension = string.Empty;
88
89 if ((sbyte)AssetType.Texture == asset.Type)
90 {
91 extension = ArchiveConstants.TEXTURE_EXTENSION;
92 }
93
94 xtw.WriteElementString("filename", uuid.ToString() + extension);
86 95
87 xtw.WriteElementString("filename", uuid.ToString() + ArchiveConstants.TEXTURE_EXTENSION);
88 xtw.WriteElementString("name", asset.Name); 96 xtw.WriteElementString("name", asset.Name);
89 xtw.WriteElementString("description", asset.Description); 97 xtw.WriteElementString("description", asset.Description);
90 xtw.WriteElementString("asset-type", asset.Type.ToString()); 98 xtw.WriteElementString("asset-type", asset.Type.ToString());
@@ -113,11 +121,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
113 121
114 foreach (LLUUID uuid in m_assets.Keys) 122 foreach (LLUUID uuid in m_assets.Keys)
115 { 123 {
116 if (m_assets[uuid] != null) 124 AssetBase asset = m_assets[uuid];
125
126 if (asset != null)
117 { 127 {
128 string extension = string.Empty;
129
130 if ((sbyte)AssetType.Texture == asset.Type)
131 {
132 extension = ArchiveConstants.TEXTURE_EXTENSION;
133 }
134
118 archive.AddFile( 135 archive.AddFile(
119 ArchiveConstants.ASSETS_PATH + uuid.ToString() + ArchiveConstants.TEXTURE_EXTENSION, 136 ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension,
120 m_assets[uuid].Data); 137 asset.Data);
121 } 138 }
122 else 139 else
123 { 140 {
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs
index 9e63ccf..0c56ae3 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs
@@ -97,7 +97,6 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
97 reader.ReadStartElement("assets"); 97 reader.ReadStartElement("assets");
98 reader.Read(); 98 reader.Read();
99 99
100 m_log.DebugFormat("next node {0}", reader.Name);
101 while (reader.Name.Equals("asset")) 100 while (reader.Name.Equals("asset"))
102 { 101 {
103 reader.Read(); 102 reader.Read();
@@ -150,11 +149,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
150 { 149 {
151 AssetMetadata metadata = m_metadata[filename]; 150 AssetMetadata metadata = m_metadata[filename];
152 151
153 string rawId = filename.Remove(filename.Length - ArchiveConstants.TEXTURE_EXTENSION.Length); 152 string extension = String.Empty;
153
154 if ((sbyte)AssetType.Texture == metadata.AssetType)
155 {
156 filename = filename.Remove(filename.Length - ArchiveConstants.TEXTURE_EXTENSION.Length);
157 }
154 158
155 m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", rawId); 159 m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename);
156 160
157 AssetBase asset = new AssetBase(new LLUUID(rawId), metadata.Name); 161 AssetBase asset = new AssetBase(new LLUUID(filename), metadata.Name);
158 asset.Description = metadata.Description; 162 asset.Description = metadata.Description;
159 asset.Type = metadata.AssetType; 163 asset.Type = metadata.AssetType;
160 asset.InvType = metadata.InventoryType; 164 asset.InvType = metadata.InventoryType;