aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
diff options
context:
space:
mode:
authorDiva Canto2010-10-15 17:27:19 -0700
committerDiva Canto2010-10-15 17:27:19 -0700
commit1499607215aab4994f933a8ed2a54ed037a1f9ba (patch)
treee343f5115c50c8dbae730a15c41a0d62f5b9f74d /OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
parentUPdated the MySql driver to 6.2.4. Also established a much larger MySqlComman... (diff)
downloadopensim-SC-1499607215aab4994f933a8ed2a54ed037a1f9ba.zip
opensim-SC-1499607215aab4994f933a8ed2a54ed037a1f9ba.tar.gz
opensim-SC-1499607215aab4994f933a8ed2a54ed037a1f9ba.tar.bz2
opensim-SC-1499607215aab4994f933a8ed2a54ed037a1f9ba.tar.xz
Made OARs use the new serialization procedure. (TPs/crossings still on the old one) Added an options argument down the pipeline. For the time being it takes --old-guids as an option to produce <Guid> instead of <UUID>.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs61
1 files changed, 32 insertions, 29 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 6e3b15a..9a00bea 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -1075,36 +1075,36 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1075 1075
1076 ////////// Write ///////// 1076 ////////// Write /////////
1077 1077
1078 public static void SOGToXml2(XmlTextWriter writer, SceneObjectGroup sog) 1078 public static void SOGToXml2(XmlTextWriter writer, SceneObjectGroup sog, Dictionary<string, object>options)
1079 { 1079 {
1080 writer.WriteStartElement(String.Empty, "SceneObjectGroup", String.Empty); 1080 writer.WriteStartElement(String.Empty, "SceneObjectGroup", String.Empty);
1081 SOPToXml2(writer, sog.RootPart, null); 1081 SOPToXml2(writer, sog.RootPart, null, options);
1082 writer.WriteStartElement(String.Empty, "OtherParts", String.Empty); 1082 writer.WriteStartElement(String.Empty, "OtherParts", String.Empty);
1083 1083
1084 sog.ForEachPart(delegate(SceneObjectPart sop) 1084 sog.ForEachPart(delegate(SceneObjectPart sop)
1085 { 1085 {
1086 if (sop.UUID != sog.RootPart.UUID) 1086 if (sop.UUID != sog.RootPart.UUID)
1087 SOPToXml2(writer, sop, sog.RootPart); 1087 SOPToXml2(writer, sop, sog.RootPart, options);
1088 }); 1088 });
1089 1089
1090 writer.WriteEndElement(); 1090 writer.WriteEndElement();
1091 writer.WriteEndElement(); 1091 writer.WriteEndElement();
1092 } 1092 }
1093 1093
1094 static void SOPToXml2(XmlTextWriter writer, SceneObjectPart sop, SceneObjectPart parent) 1094 static void SOPToXml2(XmlTextWriter writer, SceneObjectPart sop, SceneObjectPart parent, Dictionary<string, object> options)
1095 { 1095 {
1096 writer.WriteStartElement("SceneObjectPart"); 1096 writer.WriteStartElement("SceneObjectPart");
1097 writer.WriteAttributeString("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); 1097 writer.WriteAttributeString("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
1098 writer.WriteAttributeString("xmlns:xsd", "http://www.w3.org/2001/XMLSchema"); 1098 writer.WriteAttributeString("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
1099 1099
1100 writer.WriteElementString("AllowedDrop", sop.AllowedDrop.ToString().ToLower()); 1100 writer.WriteElementString("AllowedDrop", sop.AllowedDrop.ToString().ToLower());
1101 WriteUUID(writer, "CreatorID", sop.CreatorID); 1101 WriteUUID(writer, "CreatorID", sop.CreatorID, options);
1102 WriteUUID(writer, "FolderID", sop.FolderID); 1102 WriteUUID(writer, "FolderID", sop.FolderID, options);
1103 writer.WriteElementString("InventorySerial", sop.InventorySerial.ToString()); 1103 writer.WriteElementString("InventorySerial", sop.InventorySerial.ToString());
1104 1104
1105 WriteTaskInventory(writer, sop.TaskInventory); 1105 WriteTaskInventory(writer, sop.TaskInventory, options);
1106 1106
1107 WriteUUID(writer, "UUID", sop.UUID); 1107 WriteUUID(writer, "UUID", sop.UUID, options);
1108 writer.WriteElementString("LocalId", sop.LocalId.ToString()); 1108 writer.WriteElementString("LocalId", sop.LocalId.ToString());
1109 writer.WriteElementString("Name", sop.Name); 1109 writer.WriteElementString("Name", sop.Name);
1110 writer.WriteElementString("Material", sop.Material.ToString()); 1110 writer.WriteElementString("Material", sop.Material.ToString());
@@ -1137,7 +1137,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1137 writer.WriteElementString("LinkNum", sop.LinkNum.ToString()); 1137 writer.WriteElementString("LinkNum", sop.LinkNum.ToString());
1138 writer.WriteElementString("ClickAction", sop.ClickAction.ToString()); 1138 writer.WriteElementString("ClickAction", sop.ClickAction.ToString());
1139 1139
1140 WriteShape(writer, sop.Shape); 1140 WriteShape(writer, sop.Shape, options);
1141 1141
1142 WriteVector(writer, "Scale", sop.Scale); 1142 WriteVector(writer, "Scale", sop.Scale);
1143 writer.WriteElementString("UpdateFlag", sop.UpdateFlag.ToString()); 1143 writer.WriteElementString("UpdateFlag", sop.UpdateFlag.ToString());
@@ -1151,16 +1151,16 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1151 writer.WriteElementString("SalePrice", sop.SalePrice.ToString()); 1151 writer.WriteElementString("SalePrice", sop.SalePrice.ToString());
1152 writer.WriteElementString("ObjectSaleType", sop.ObjectSaleType.ToString()); 1152 writer.WriteElementString("ObjectSaleType", sop.ObjectSaleType.ToString());
1153 writer.WriteElementString("OwnershipCost", sop.OwnershipCost.ToString()); 1153 writer.WriteElementString("OwnershipCost", sop.OwnershipCost.ToString());
1154 WriteUUID(writer, "GroupID", sop.GroupID); 1154 WriteUUID(writer, "GroupID", sop.GroupID, options);
1155 WriteUUID(writer, "OwnerID", sop.OwnerID); 1155 WriteUUID(writer, "OwnerID", sop.OwnerID, options);
1156 WriteUUID(writer, "LastOwnerID", sop.LastOwnerID); 1156 WriteUUID(writer, "LastOwnerID", sop.LastOwnerID, options);
1157 writer.WriteElementString("BaseMask", sop.BaseMask.ToString()); 1157 writer.WriteElementString("BaseMask", sop.BaseMask.ToString());
1158 writer.WriteElementString("OwnerMask", sop.OwnerMask.ToString()); 1158 writer.WriteElementString("OwnerMask", sop.OwnerMask.ToString());
1159 writer.WriteElementString("GroupMask", sop.GroupMask.ToString()); 1159 writer.WriteElementString("GroupMask", sop.GroupMask.ToString());
1160 writer.WriteElementString("EveryoneMask", sop.EveryoneMask.ToString()); 1160 writer.WriteElementString("EveryoneMask", sop.EveryoneMask.ToString());
1161 writer.WriteElementString("NextOwnerMask", sop.NextOwnerMask.ToString()); 1161 writer.WriteElementString("NextOwnerMask", sop.NextOwnerMask.ToString());
1162 writer.WriteElementString("Flags", sop.Flags.ToString()); 1162 writer.WriteElementString("Flags", sop.Flags.ToString());
1163 WriteUUID(writer, "CollisionSound", sop.CollisionSound); 1163 WriteUUID(writer, "CollisionSound", sop.CollisionSound, options);
1164 writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); 1164 writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString());
1165 if (sop.MediaUrl != null) 1165 if (sop.MediaUrl != null)
1166 writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); 1166 writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString());
@@ -1168,10 +1168,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1168 writer.WriteEndElement(); 1168 writer.WriteEndElement();
1169 } 1169 }
1170 1170
1171 static void WriteUUID(XmlTextWriter writer, string name, UUID id) 1171 static void WriteUUID(XmlTextWriter writer, string name, UUID id, Dictionary<string, object> options)
1172 { 1172 {
1173 writer.WriteStartElement(name); 1173 writer.WriteStartElement(name);
1174 writer.WriteElementString("UUID", id.ToString()); 1174 if (options.ContainsKey("old-guids"))
1175 writer.WriteElementString("Guid", id.ToString());
1176 else
1177 writer.WriteElementString("UUID", id.ToString());
1175 writer.WriteEndElement(); 1178 writer.WriteEndElement();
1176 } 1179 }
1177 1180
@@ -1194,7 +1197,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1194 writer.WriteEndElement(); 1197 writer.WriteEndElement();
1195 } 1198 }
1196 1199
1197 static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv) 1200 static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options)
1198 { 1201 {
1199 if (tinv.Count > 0) // otherwise skip this 1202 if (tinv.Count > 0) // otherwise skip this
1200 { 1203 {
@@ -1203,27 +1206,27 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1203 foreach (TaskInventoryItem item in tinv.Values) 1206 foreach (TaskInventoryItem item in tinv.Values)
1204 { 1207 {
1205 writer.WriteStartElement("TaskInventoryItem"); 1208 writer.WriteStartElement("TaskInventoryItem");
1206 1209
1207 WriteUUID(writer, "AssetID", item.AssetID); 1210 WriteUUID(writer, "AssetID", item.AssetID, options);
1208 writer.WriteElementString("BasePermissions", item.BasePermissions.ToString()); 1211 writer.WriteElementString("BasePermissions", item.BasePermissions.ToString());
1209 writer.WriteElementString("CreationDate", item.CreationDate.ToString()); 1212 writer.WriteElementString("CreationDate", item.CreationDate.ToString());
1210 WriteUUID(writer, "CreatorID", item.CreatorID); 1213 WriteUUID(writer, "CreatorID", item.CreatorID, options);
1211 writer.WriteElementString("Description", item.Description); 1214 writer.WriteElementString("Description", item.Description);
1212 writer.WriteElementString("EveryonePermissions", item.EveryonePermissions.ToString()); 1215 writer.WriteElementString("EveryonePermissions", item.EveryonePermissions.ToString());
1213 writer.WriteElementString("Flags", item.Flags.ToString()); 1216 writer.WriteElementString("Flags", item.Flags.ToString());
1214 WriteUUID(writer, "GroupID", item.GroupID); 1217 WriteUUID(writer, "GroupID", item.GroupID, options);
1215 writer.WriteElementString("GroupPermissions", item.GroupPermissions.ToString()); 1218 writer.WriteElementString("GroupPermissions", item.GroupPermissions.ToString());
1216 writer.WriteElementString("InvType", item.InvType.ToString()); 1219 writer.WriteElementString("InvType", item.InvType.ToString());
1217 WriteUUID(writer, "ItemID", item.ItemID); 1220 WriteUUID(writer, "ItemID", item.ItemID, options);
1218 WriteUUID(writer, "OldItemID", item.OldItemID); 1221 WriteUUID(writer, "OldItemID", item.OldItemID, options);
1219 WriteUUID(writer, "LastOwnerID", item.LastOwnerID); 1222 WriteUUID(writer, "LastOwnerID", item.LastOwnerID, options);
1220 writer.WriteElementString("Name", item.Name); 1223 writer.WriteElementString("Name", item.Name);
1221 writer.WriteElementString("NextPermissions", item.NextPermissions.ToString()); 1224 writer.WriteElementString("NextPermissions", item.NextPermissions.ToString());
1222 WriteUUID(writer, "OwnerID", item.OwnerID); 1225 WriteUUID(writer, "OwnerID", item.OwnerID, options);
1223 writer.WriteElementString("CurrentPermissions", item.CurrentPermissions.ToString()); 1226 writer.WriteElementString("CurrentPermissions", item.CurrentPermissions.ToString());
1224 WriteUUID(writer, "ParentID", item.ParentID); 1227 WriteUUID(writer, "ParentID", item.ParentID, options);
1225 WriteUUID(writer, "ParentPartID", item.ParentPartID); 1228 WriteUUID(writer, "ParentPartID", item.ParentPartID, options);
1226 WriteUUID(writer, "PermsGranter", item.PermsGranter); 1229 WriteUUID(writer, "PermsGranter", item.PermsGranter, options);
1227 writer.WriteElementString("PermsMask", item.PermsMask.ToString()); 1230 writer.WriteElementString("PermsMask", item.PermsMask.ToString());
1228 writer.WriteElementString("Type", item.Type.ToString()); 1231 writer.WriteElementString("Type", item.Type.ToString());
1229 1232
@@ -1234,7 +1237,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1234 } 1237 }
1235 } 1238 }
1236 1239
1237 static void WriteShape(XmlTextWriter writer, PrimitiveBaseShape shp) 1240 static void WriteShape(XmlTextWriter writer, PrimitiveBaseShape shp, Dictionary<string, object> options)
1238 { 1241 {
1239 if (shp != null) 1242 if (shp != null)
1240 { 1243 {
@@ -1283,7 +1286,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1283 writer.WriteElementString("ProfileShape", shp.ProfileShape.ToString()); 1286 writer.WriteElementString("ProfileShape", shp.ProfileShape.ToString());
1284 writer.WriteElementString("HollowShape", shp.HollowShape.ToString()); 1287 writer.WriteElementString("HollowShape", shp.HollowShape.ToString());
1285 1288
1286 WriteUUID(writer, "SculptTexture", shp.SculptTexture); 1289 WriteUUID(writer, "SculptTexture", shp.SculptTexture, options);
1287 writer.WriteElementString("SculptType", shp.SculptType.ToString()); 1290 writer.WriteElementString("SculptType", shp.SculptType.ToString());
1288 writer.WriteStartElement("SculptData"); 1291 writer.WriteStartElement("SculptData");
1289 byte[] sd; 1292 byte[] sd;