aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-06-05 00:29:02 +0000
committerJustin Clarke Casey2008-06-05 00:29:02 +0000
commit73c115702777b62233737cf0de4e8ec4f3878f19 (patch)
tree5d8ec2a260f9341df763bcb391cf27a37ec35bcf /OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
parent* Change archiver 'textures' dir back to 'assets' (diff)
downloadopensim-SC_OLD-73c115702777b62233737cf0de4e8ec4f3878f19.zip
opensim-SC_OLD-73c115702777b62233737cf0de4e8ec4f3878f19.tar.gz
opensim-SC_OLD-73c115702777b62233737cf0de4e8ec4f3878f19.tar.bz2
opensim-SC_OLD-73c115702777b62233737cf0de4e8ec4f3878f19.tar.xz
* exprimental: Export and reimport all items within a prim except Objects
* Not yet ready for public use
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs29
1 files changed, 23 insertions, 6 deletions
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 {