diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index 6a3b519..f92e955 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -45,8 +45,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
45 | 45 | ||
46 | protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); | 46 | protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); |
47 | 47 | ||
48 | private Scene m_scene; | 48 | protected Scene m_scene; |
49 | private string m_loadPath; | 49 | protected string m_loadPath; |
50 | 50 | ||
51 | public ArchiveReadRequest(Scene scene, string loadPath) | 51 | public ArchiveReadRequest(Scene scene, string loadPath) |
52 | { | 52 | { |
@@ -59,6 +59,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
59 | protected void DearchiveRegion() | 59 | protected void DearchiveRegion() |
60 | { | 60 | { |
61 | TarArchiveReader archive = new TarArchiveReader(m_loadPath); | 61 | TarArchiveReader archive = new TarArchiveReader(m_loadPath); |
62 | AssetsDearchiver dearchiver = new AssetsDearchiver(m_scene.AssetCache); | ||
62 | 63 | ||
63 | string serializedPrims = string.Empty; | 64 | string serializedPrims = string.Empty; |
64 | 65 | ||
@@ -75,28 +76,18 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
75 | { | 76 | { |
76 | serializedPrims = m_asciiEncoding.GetString(data); | 77 | serializedPrims = m_asciiEncoding.GetString(data); |
77 | } | 78 | } |
79 | else if (filePath.Equals(ArchiveConstants.ASSETS_METADATA_PATH)) | ||
80 | { | ||
81 | string xml = m_asciiEncoding.GetString(data); | ||
82 | dearchiver.AddAssetMetadata(xml); | ||
83 | } | ||
78 | else if (filePath.StartsWith(ArchiveConstants.TEXTURES_PATH)) | 84 | else if (filePath.StartsWith(ArchiveConstants.TEXTURES_PATH)) |
79 | { | 85 | { |
80 | // Right now we're nastily obtaining the lluuid from the filename | 86 | dearchiver.AddAssetData(filePath, data); |
81 | string rawId = filePath.Remove(0, ArchiveConstants.TEXTURES_PATH.Length); | ||
82 | rawId = rawId.Remove(rawId.Length - ArchiveConstants.TEXTURE_EXTENSION.Length); | ||
83 | |||
84 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", rawId); | ||
85 | |||
86 | // Not preserving asset name or description as of yet | ||
87 | AssetBase asset = new AssetBase(new LLUUID(rawId), "imported name"); | ||
88 | asset.Description = "imported description"; | ||
89 | |||
90 | asset.Type = (sbyte)AssetType.Texture; | ||
91 | asset.InvType = (sbyte)InventoryType.Texture; | ||
92 | |||
93 | asset.Data = data; | ||
94 | |||
95 | m_scene.AssetCache.AddAsset(asset); | ||
96 | } | 87 | } |
97 | } | 88 | } |
98 | 89 | ||
99 | m_log.DebugFormat("[ARCHIVER]: Reached end of archive"); | 90 | m_log.Debug("[ARCHIVER]: Reached end of archive"); |
100 | 91 | ||
101 | archive.Close(); | 92 | archive.Close(); |
102 | 93 | ||