diff options
3 files changed, 35 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs index 7df6033..d98814b 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs | |||
@@ -35,7 +35,12 @@ 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 = "assets/"; | 38 | public static readonly string ASSETS_PATH = "assets/"; |
39 | |||
40 | /// <summary> | ||
41 | /// Extension used for texture assets in archive | ||
42 | /// </summary> | ||
43 | public static readonly string TEXTURE_EXTENSION = ".jp2"; | ||
39 | 44 | ||
40 | /// <summary> | 45 | /// <summary> |
41 | /// Path for the prims file | 46 | /// Path for the prims file |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index d3f0cbc..6ad9fb8 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -25,11 +25,13 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using OpenSim.Framework; | ||
28 | using OpenSim.Region.Environment.Scenes; | 29 | using OpenSim.Region.Environment.Scenes; |
29 | using OpenSim.Region.Environment.Modules.World.Serialiser; | 30 | using OpenSim.Region.Environment.Modules.World.Serialiser; |
30 | using System; | 31 | using System; |
31 | using System.IO; | 32 | using System.IO; |
32 | using System.Reflection; | 33 | using System.Reflection; |
34 | using libsecondlife; | ||
33 | using log4net; | 35 | using log4net; |
34 | 36 | ||
35 | namespace OpenSim.Region.Environment.Modules.World.Archiver | 37 | namespace OpenSim.Region.Environment.Modules.World.Archiver |
@@ -66,12 +68,35 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
66 | byte[] data; | 68 | byte[] data; |
67 | while ((data = archive.ReadEntry(out filePath)) != null) | 69 | while ((data = archive.ReadEntry(out filePath)) != null) |
68 | { | 70 | { |
69 | m_log.DebugFormat("[ARCHIVER]: Successfully read {0} ({1} bytes) from archive {2}", filePath, data.Length, m_loadPath); | 71 | m_log.DebugFormat( |
72 | "[ARCHIVER]: Successfully read {0} ({1} bytes) from archive {2}", filePath, data.Length, m_loadPath); | ||
70 | 73 | ||
71 | if (filePath.Equals(ArchiveConstants.PRIMS_PATH)) | 74 | if (filePath.Equals(ArchiveConstants.PRIMS_PATH)) |
72 | { | 75 | { |
73 | serializedPrims = m_asciiEncoding.GetString(data); | 76 | serializedPrims = m_asciiEncoding.GetString(data); |
74 | } | 77 | } |
78 | /* | ||
79 | else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) | ||
80 | { | ||
81 | // Right now we're nastily obtaining the lluuid from the filename | ||
82 | string rawId = filePath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); | ||
83 | rawId = rawId.Remove(rawId.Length - ArchiveConstants.TEXTURE_EXTENSION.Length); | ||
84 | |||
85 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", rawId); | ||
86 | |||
87 | // Not preserving asset name or description as of yet | ||
88 | AssetBase asset = new AssetBase(new LLUUID(rawId), "imported name"); | ||
89 | asset.Description = "imported description"; | ||
90 | |||
91 | // Only importing textures right now | ||
92 | asset.Type = (sbyte)AssetType.Texture; | ||
93 | asset.InvType = (sbyte)InventoryType.Texture; | ||
94 | |||
95 | asset.Data = data; | ||
96 | |||
97 | m_scene.AssetCache.AddAsset(asset); | ||
98 | } | ||
99 | */ | ||
75 | } | 100 | } |
76 | 101 | ||
77 | m_log.DebugFormat("[ARCHIVER]: Reached end of archive"); | 102 | m_log.DebugFormat("[ARCHIVER]: Reached end of archive"); |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequest.cs index d936df5..c9a7f07 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequest.cs | |||
@@ -112,7 +112,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
112 | { | 112 | { |
113 | if (assets[uuid] != null) | 113 | if (assets[uuid] != null) |
114 | { | 114 | { |
115 | archive.AddFile(ArchiveConstants.ASSETS_PATH + uuid.ToString() + ".jp2", assets[uuid].Data); | 115 | archive.AddFile( |
116 | ArchiveConstants.ASSETS_PATH + uuid.ToString() + ArchiveConstants.TEXTURE_EXTENSION, | ||
117 | assets[uuid].Data); | ||
116 | } | 118 | } |
117 | else | 119 | else |
118 | { | 120 | { |