aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-08-03 17:09:20 +0100
committerJustin Clark-Casey (justincc)2010-08-03 17:09:20 +0100
commit99c0f4c9c7820f6340155f7af30ab91745774c93 (patch)
treed59a9f8986b41bb7d60928b9675a6e3b14cb07b9 /OpenSim/Framework
parentget rid of PrimitiveBaseShape.MediaRaw staging post (diff)
downloadopensim-SC_OLD-99c0f4c9c7820f6340155f7af30ab91745774c93.zip
opensim-SC_OLD-99c0f4c9c7820f6340155f7af30ab91745774c93.tar.gz
opensim-SC_OLD-99c0f4c9c7820f6340155f7af30ab91745774c93.tar.bz2
opensim-SC_OLD-99c0f4c9c7820f6340155f7af30ab91745774c93.tar.xz
Simplify serialized version string. Change element capitalization for consistency
THIS CHANGE ALTERS THE SERIALIZATION FORMAT, HOPEFULLY FOR THE LAST TIME. If you're testing, please start with a new database. This commit also improves locking for manipulation of media entries.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/PrimitiveBaseShape.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs
index 9b52fe6..70a61cc 100644
--- a/OpenSim/Framework/PrimitiveBaseShape.cs
+++ b/OpenSim/Framework/PrimitiveBaseShape.cs
@@ -180,6 +180,7 @@ namespace OpenSim.Framework
180 /// Entries to store media textures on each face 180 /// Entries to store media textures on each face
181 /// </summary> 181 /// </summary>
182 /// Do not change this value directly - always do it through an IMoapModule. 182 /// Do not change this value directly - always do it through an IMoapModule.
183 /// Lock before manipulating.
183 public MediaList Media { get; set; } 184 public MediaList Media { get; set; }
184 185
185 public PrimitiveBaseShape() 186 public PrimitiveBaseShape()
@@ -1219,6 +1220,11 @@ namespace OpenSim.Framework
1219 return prim; 1220 return prim;
1220 } 1221 }
1221 1222
1223 /// <summary>
1224 /// Encapsulates a list of media entries.
1225 /// </summary>
1226 /// This class is necessary because we want to replace auto-serialization of MediaEntry with something more
1227 /// OSD like and less vulnerable to change.
1222 public class MediaList : List<MediaEntry>, IXmlSerializable 1228 public class MediaList : List<MediaEntry>, IXmlSerializable
1223 { 1229 {
1224 public const string MEDIA_TEXTURE_TYPE = "sl"; 1230 public const string MEDIA_TEXTURE_TYPE = "sl";
@@ -1240,10 +1246,9 @@ namespace OpenSim.Framework
1240 { 1246 {
1241 using (XmlTextWriter xtw = new XmlTextWriter(sw)) 1247 using (XmlTextWriter xtw = new XmlTextWriter(sw))
1242 { 1248 {
1243 xtw.WriteStartElement("osmedia"); 1249 xtw.WriteStartElement("OSMedia");
1244 xtw.WriteAttributeString("type", MEDIA_TEXTURE_TYPE); 1250 xtw.WriteAttributeString("type", MEDIA_TEXTURE_TYPE);
1245 xtw.WriteAttributeString("major_version", "0"); 1251 xtw.WriteAttributeString("version", "0.1");
1246 xtw.WriteAttributeString("minor_version", "1");
1247 1252
1248 OSDArray meArray = new OSDArray(); 1253 OSDArray meArray = new OSDArray();
1249 foreach (MediaEntry me in this) 1254 foreach (MediaEntry me in this)
@@ -1252,7 +1257,7 @@ namespace OpenSim.Framework
1252 meArray.Add(osd); 1257 meArray.Add(osd);
1253 } 1258 }
1254 1259
1255 xtw.WriteStartElement("osdata"); 1260 xtw.WriteStartElement("OSData");
1256 xtw.WriteRaw(OSDParser.SerializeLLSDXmlString(meArray)); 1261 xtw.WriteRaw(OSDParser.SerializeLLSDXmlString(meArray));
1257 xtw.WriteEndElement(); 1262 xtw.WriteEndElement();
1258 1263
@@ -1291,7 +1296,7 @@ namespace OpenSim.Framework
1291 if (type != MEDIA_TEXTURE_TYPE) 1296 if (type != MEDIA_TEXTURE_TYPE)
1292 return; 1297 return;
1293 1298
1294 xtr.ReadStartElement("osmedia"); 1299 xtr.ReadStartElement("OSMedia");
1295 1300
1296 OSDArray osdMeArray = (OSDArray)OSDParser.DeserializeLLSDXml(xtr.ReadInnerXml()); 1301 OSDArray osdMeArray = (OSDArray)OSDParser.DeserializeLLSDXml(xtr.ReadInnerXml());
1297 foreach (OSD osdMe in osdMeArray) 1302 foreach (OSD osdMe in osdMeArray)