diff options
author | Jeff Ames | 2008-08-18 00:39:10 +0000 |
---|---|---|
committer | Jeff Ames | 2008-08-18 00:39:10 +0000 |
commit | 6ef9d4da901a346c232458317cca6268da888e2e (patch) | |
tree | dd1d935b10f34f261839da9f9879c02322e8ede7 /OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs | |
parent | Update svn properties, minor formatting cleanup. (diff) | |
download | opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.zip opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.gz opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.bz2 opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.xz |
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs index 0341a70..26d4797 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs | |||
@@ -61,8 +61,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
61 | 61 | ||
62 | public ArchiveWriteRequestExecution( | 62 | public ArchiveWriteRequestExecution( |
63 | List<SceneObjectGroup> sceneObjects, | 63 | List<SceneObjectGroup> sceneObjects, |
64 | ITerrainModule terrainModule, | 64 | ITerrainModule terrainModule, |
65 | IRegionSerialiser serialiser, | 65 | IRegionSerialiser serialiser, |
66 | string sceneName, | 66 | string sceneName, |
67 | string savePath) | 67 | string savePath) |
68 | { | 68 | { |
@@ -79,37 +79,37 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
79 | { | 79 | { |
80 | m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); | 80 | m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); |
81 | } | 81 | } |
82 | 82 | ||
83 | m_log.InfoFormat( | 83 | m_log.InfoFormat( |
84 | "[ARCHIVER]: Received {0} of {1} assets requested", assetsFound.Count, assetsFound.Count + assetsNotFoundUuids.Count); | 84 | "[ARCHIVER]: Received {0} of {1} assets requested", assetsFound.Count, assetsFound.Count + assetsNotFoundUuids.Count); |
85 | 85 | ||
86 | TarArchiveWriter archive = new TarArchiveWriter(); | 86 | TarArchiveWriter archive = new TarArchiveWriter(); |
87 | 87 | ||
88 | // Write out control file | 88 | // Write out control file |
89 | archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile()); | 89 | archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile()); |
90 | 90 | ||
91 | // Write out terrain | 91 | // Write out terrain |
92 | string terrainPath = String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_sceneName); | 92 | string terrainPath = String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_sceneName); |
93 | MemoryStream ms = new MemoryStream(); | 93 | MemoryStream ms = new MemoryStream(); |
94 | m_terrainModule.SaveToStream(terrainPath, ms); | 94 | m_terrainModule.SaveToStream(terrainPath, ms); |
95 | archive.AddFile(terrainPath, ms.ToArray()); | 95 | archive.AddFile(terrainPath, ms.ToArray()); |
96 | ms.Close(); | 96 | ms.Close(); |
97 | 97 | ||
98 | // Write out scene object metadata | 98 | // Write out scene object metadata |
99 | foreach (SceneObjectGroup sceneObject in m_sceneObjects) | 99 | foreach (SceneObjectGroup sceneObject in m_sceneObjects) |
100 | { | 100 | { |
101 | //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); | 101 | //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); |
102 | 102 | ||
103 | LLVector3 position = sceneObject.AbsolutePosition; | 103 | LLVector3 position = sceneObject.AbsolutePosition; |
104 | 104 | ||
105 | string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); | 105 | string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); |
106 | string filename | 106 | string filename |
107 | = string.Format( | 107 | = string.Format( |
108 | "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml", | 108 | "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml", |
109 | ArchiveConstants.OBJECTS_PATH, sceneObject.Name, | 109 | ArchiveConstants.OBJECTS_PATH, sceneObject.Name, |
110 | Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), | 110 | Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), |
111 | sceneObject.UUID); | 111 | sceneObject.UUID); |
112 | 112 | ||
113 | archive.AddFile(filename, serializedObject); | 113 | archive.AddFile(filename, serializedObject); |
114 | } | 114 | } |
115 | 115 | ||
@@ -120,8 +120,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
120 | archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress)); | 120 | archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress)); |
121 | 121 | ||
122 | m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath); | 122 | m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath); |
123 | } | 123 | } |
124 | 124 | ||
125 | /// <summary> | 125 | /// <summary> |
126 | /// Create the control file for this archive | 126 | /// Create the control file for this archive |
127 | /// </summary> | 127 | /// </summary> |
@@ -136,13 +136,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
136 | xtw.WriteAttributeString("major_version", "0"); | 136 | xtw.WriteAttributeString("major_version", "0"); |
137 | xtw.WriteAttributeString("minor_version", "1"); | 137 | xtw.WriteAttributeString("minor_version", "1"); |
138 | xtw.WriteEndElement(); | 138 | xtw.WriteEndElement(); |
139 | 139 | ||
140 | xtw.Flush(); | 140 | xtw.Flush(); |
141 | xtw.Close(); | 141 | xtw.Close(); |
142 | 142 | ||
143 | String s = sw.ToString(); | 143 | String s = sw.ToString(); |
144 | sw.Close(); | 144 | sw.Close(); |
145 | 145 | ||
146 | return s; | 146 | return s; |
147 | } | 147 | } |
148 | } | 148 | } |