aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Serialization/ArchiveConstants.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Serialization/ArchiveConstants.cs')
-rw-r--r--OpenSim/Framework/Serialization/ArchiveConstants.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/OpenSim/Framework/Serialization/ArchiveConstants.cs b/OpenSim/Framework/Serialization/ArchiveConstants.cs
index 1cd80db..475a9de 100644
--- a/OpenSim/Framework/Serialization/ArchiveConstants.cs
+++ b/OpenSim/Framework/Serialization/ArchiveConstants.cs
@@ -25,6 +25,7 @@
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 System;
28using System.Collections.Generic; 29using System.Collections.Generic;
29using OpenMetaverse; 30using OpenMetaverse;
30 31
@@ -85,6 +86,11 @@ namespace OpenSim.Framework.Serialization
85 /// </value> 86 /// </value>
86 public const string INVENTORY_NODE_NAME_COMPONENT_SEPARATOR = "__"; 87 public const string INVENTORY_NODE_NAME_COMPONENT_SEPARATOR = "__";
87 88
89 /// <summary>
90 /// Template used for creating filenames in OpenSim Archives.
91 /// </summary>
92 public const string OAR_OBJECT_FILENAME_TEMPLATE = "{0}_{1:000}-{2:000}-{3:000}__{4}.xml";
93
88 /// <value> 94 /// <value>
89 /// Extensions used for asset types in the archive 95 /// Extensions used for asset types in the archive
90 /// </value> 96 /// </value>
@@ -139,5 +145,32 @@ namespace OpenSim.Framework.Serialization
139 EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "texture.tga"] = (sbyte)AssetType.TextureTGA; 145 EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "texture.tga"] = (sbyte)AssetType.TextureTGA;
140 EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "trashfolder.txt"] = (sbyte)AssetType.TrashFolder; 146 EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "trashfolder.txt"] = (sbyte)AssetType.TrashFolder;
141 } 147 }
148
149 /// <summary>
150 /// Create the filename used to store an object in an OpenSim Archive.
151 /// </summary>
152 /// <param name="objectName"></param>
153 /// <param name="uuid"></param>
154 /// <param name="pos"></param>
155 /// <returns></returns>
156 public static string CreateOarObjectFilename(string objectName, UUID uuid, Vector3 pos)
157 {
158 return string.Format(
159 OAR_OBJECT_FILENAME_TEMPLATE, objectName,
160 Math.Round(pos.X), Math.Round(pos.Y), Math.Round(pos.Z),
161 uuid);
162 }
163
164 /// <summary>
165 /// Create the path used to store an object in an OpenSim Archives.
166 /// </summary>
167 /// <param name="objectName"></param>
168 /// <param name="uuid"></param>
169 /// <param name="pos"></param>
170 /// <returns></returns>
171 public static string CreateOarObjectPath(string objectName, UUID uuid, Vector3 pos)
172 {
173 return OBJECTS_PATH + CreateOarObjectFilename(objectName, uuid, pos);
174 }
142 } 175 }
143} 176}