aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-05-31 21:20:04 +0000
committerJustin Clarke Casey2008-05-31 21:20:04 +0000
commitabaf8e7a370f0ba932412232504d906507b2d745 (patch)
treeb5c1b28e2a8d9cdf1491e03dd5d41235cf387aad
parentMantis#1428. Thank you kindly, fdg for a patch that solves: (diff)
downloadopensim-SC_OLD-abaf8e7a370f0ba932412232504d906507b2d745.zip
opensim-SC_OLD-abaf8e7a370f0ba932412232504d906507b2d745.tar.gz
opensim-SC_OLD-abaf8e7a370f0ba932412232504d906507b2d745.tar.bz2
opensim-SC_OLD-abaf8e7a370f0ba932412232504d906507b2d745.tar.xz
* Put in preparatory code to restore whole prim textures on archive load
* No user functionality yet
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs7
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs27
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequest.cs4
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
28using OpenSim.Framework;
28using OpenSim.Region.Environment.Scenes; 29using OpenSim.Region.Environment.Scenes;
29using OpenSim.Region.Environment.Modules.World.Serialiser; 30using OpenSim.Region.Environment.Modules.World.Serialiser;
30using System; 31using System;
31using System.IO; 32using System.IO;
32using System.Reflection; 33using System.Reflection;
34using libsecondlife;
33using log4net; 35using log4net;
34 36
35namespace OpenSim.Region.Environment.Modules.World.Archiver 37namespace 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 {