diff options
author | Diva Canto | 2010-10-14 09:05:46 -0700 |
---|---|---|
committer | Diva Canto | 2010-10-14 09:05:46 -0700 |
commit | 41ce392d9b32c343c5239b3a9fa0ef9f83b6a96f (patch) | |
tree | 622c3cdf14c08510a949938f25fa0e8bf77b9d33 | |
parent | Merge branch 'master' of ssh://MyConnection/var/git/opensim (diff) | |
download | opensim-SC_OLD-41ce392d9b32c343c5239b3a9fa0ef9f83b6a96f.zip opensim-SC_OLD-41ce392d9b32c343c5239b3a9fa0ef9f83b6a96f.tar.gz opensim-SC_OLD-41ce392d9b32c343c5239b3a9fa0ef9f83b6a96f.tar.bz2 opensim-SC_OLD-41ce392d9b32c343c5239b3a9fa0ef9f83b6a96f.tar.xz |
Added manual xml2 serialization. Rewired only save xml2, not oars yet. Seems to be generating xml's that are successfully parsed. Needs more testing.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | 261 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs | 8 |
2 files changed, 164 insertions, 105 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index efd5a8e..6e3b15a 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -316,7 +316,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
316 | m_SOPXmlProcessors.Add("FolderID", ProcessFolderID); | 316 | m_SOPXmlProcessors.Add("FolderID", ProcessFolderID); |
317 | m_SOPXmlProcessors.Add("InventorySerial", ProcessInventorySerial); | 317 | m_SOPXmlProcessors.Add("InventorySerial", ProcessInventorySerial); |
318 | m_SOPXmlProcessors.Add("TaskInventory", ProcessTaskInventory); | 318 | m_SOPXmlProcessors.Add("TaskInventory", ProcessTaskInventory); |
319 | m_SOPXmlProcessors.Add("ObjectFlags", ProcessObjectFlags); | ||
320 | m_SOPXmlProcessors.Add("UUID", ProcessUUID); | 319 | m_SOPXmlProcessors.Add("UUID", ProcessUUID); |
321 | m_SOPXmlProcessors.Add("LocalId", ProcessLocalId); | 320 | m_SOPXmlProcessors.Add("LocalId", ProcessLocalId); |
322 | m_SOPXmlProcessors.Add("Name", ProcessName); | 321 | m_SOPXmlProcessors.Add("Name", ProcessName); |
@@ -467,11 +466,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
467 | obj.TaskInventory = ReadTaskInventory(reader, "TaskInventory"); | 466 | obj.TaskInventory = ReadTaskInventory(reader, "TaskInventory"); |
468 | } | 467 | } |
469 | 468 | ||
470 | private static void ProcessObjectFlags(SceneObjectPart obj, XmlTextReader reader) | ||
471 | { | ||
472 | obj.Flags = (PrimFlags)reader.ReadElementContentAsInt("ObjectFlags", String.Empty); | ||
473 | } | ||
474 | |||
475 | private static void ProcessUUID(SceneObjectPart obj, XmlTextReader reader) | 469 | private static void ProcessUUID(SceneObjectPart obj, XmlTextReader reader) |
476 | { | 470 | { |
477 | obj.UUID = ReadUUID(reader, "UUID"); | 471 | obj.UUID = ReadUUID(reader, "UUID"); |
@@ -1089,7 +1083,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1089 | 1083 | ||
1090 | sog.ForEachPart(delegate(SceneObjectPart sop) | 1084 | sog.ForEachPart(delegate(SceneObjectPart sop) |
1091 | { | 1085 | { |
1092 | SOPToXml2(writer, sop, sog.RootPart); | 1086 | if (sop.UUID != sog.RootPart.UUID) |
1087 | SOPToXml2(writer, sop, sog.RootPart); | ||
1093 | }); | 1088 | }); |
1094 | 1089 | ||
1095 | writer.WriteEndElement(); | 1090 | writer.WriteEndElement(); |
@@ -1102,19 +1097,18 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1102 | writer.WriteAttributeString("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); | 1097 | writer.WriteAttributeString("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); |
1103 | writer.WriteAttributeString("xmlns:xsd", "http://www.w3.org/2001/XMLSchema"); | 1098 | writer.WriteAttributeString("xmlns:xsd", "http://www.w3.org/2001/XMLSchema"); |
1104 | 1099 | ||
1100 | writer.WriteElementString("AllowedDrop", sop.AllowedDrop.ToString().ToLower()); | ||
1105 | WriteUUID(writer, "CreatorID", sop.CreatorID); | 1101 | WriteUUID(writer, "CreatorID", sop.CreatorID); |
1106 | WriteUUID(writer, "FolderID", sop.FolderID); | 1102 | WriteUUID(writer, "FolderID", sop.FolderID); |
1107 | writer.WriteElementString("InventorySerial", (sop.Inventory != null) ? sop.InventorySerial.ToString() : "0"); | 1103 | writer.WriteElementString("InventorySerial", sop.InventorySerial.ToString()); |
1108 | 1104 | ||
1109 | // FIXME: Task inventory | 1105 | WriteTaskInventory(writer, sop.TaskInventory); |
1110 | writer.WriteStartElement("TaskInventory"); writer.WriteEndElement(); | ||
1111 | |||
1112 | writer.WriteElementString("ObjectFlags", ((int)sop.Flags).ToString()); | ||
1113 | 1106 | ||
1114 | WriteUUID(writer, "UUID", sop.UUID); | 1107 | WriteUUID(writer, "UUID", sop.UUID); |
1115 | writer.WriteElementString("LocalId", sop.LocalId.ToString()); | 1108 | writer.WriteElementString("LocalId", sop.LocalId.ToString()); |
1116 | writer.WriteElementString("Name", sop.Name); | 1109 | writer.WriteElementString("Name", sop.Name); |
1117 | writer.WriteElementString("Material", ((int)sop.Material).ToString()); | 1110 | writer.WriteElementString("Material", sop.Material.ToString()); |
1111 | writer.WriteElementString("PassTouches", sop.PassTouches.ToString().ToLower()); | ||
1118 | writer.WriteElementString("RegionHandle", sop.RegionHandle.ToString()); | 1112 | writer.WriteElementString("RegionHandle", sop.RegionHandle.ToString()); |
1119 | writer.WriteElementString("ScriptAccessPin", sop.ScriptAccessPin.ToString()); | 1113 | writer.WriteElementString("ScriptAccessPin", sop.ScriptAccessPin.ToString()); |
1120 | 1114 | ||
@@ -1123,115 +1117,40 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1123 | 1117 | ||
1124 | WriteQuaternion(writer, "RotationOffset", sop.RotationOffset); | 1118 | WriteQuaternion(writer, "RotationOffset", sop.RotationOffset); |
1125 | WriteVector(writer, "Velocity", sop.Velocity); | 1119 | WriteVector(writer, "Velocity", sop.Velocity); |
1126 | WriteVector(writer, "RotationalVelocity", Vector3.Zero); | ||
1127 | WriteVector(writer, "AngularVelocity", sop.AngularVelocity); | 1120 | WriteVector(writer, "AngularVelocity", sop.AngularVelocity); |
1128 | WriteVector(writer, "Acceleration", sop.Acceleration); | 1121 | WriteVector(writer, "Acceleration", sop.Acceleration); |
1129 | writer.WriteElementString("Description", sop.Description); | 1122 | writer.WriteElementString("Description", sop.Description); |
1130 | writer.WriteStartElement("Color"); | 1123 | if (sop.Color != null) |
1131 | writer.WriteElementString("R", sop.Color.R.ToString(Utils.EnUsCulture)); | 1124 | { |
1132 | writer.WriteElementString("G", sop.Color.G.ToString(Utils.EnUsCulture)); | 1125 | writer.WriteStartElement("Color"); |
1133 | writer.WriteElementString("B", sop.Color.B.ToString(Utils.EnUsCulture)); | 1126 | writer.WriteElementString("R", sop.Color.R.ToString(Utils.EnUsCulture)); |
1134 | writer.WriteElementString("A", sop.Color.G.ToString(Utils.EnUsCulture)); | 1127 | writer.WriteElementString("G", sop.Color.G.ToString(Utils.EnUsCulture)); |
1135 | writer.WriteEndElement(); | 1128 | writer.WriteElementString("B", sop.Color.B.ToString(Utils.EnUsCulture)); |
1129 | writer.WriteElementString("A", sop.Color.G.ToString(Utils.EnUsCulture)); | ||
1130 | writer.WriteEndElement(); | ||
1131 | } | ||
1132 | |||
1136 | writer.WriteElementString("Text", sop.Text); | 1133 | writer.WriteElementString("Text", sop.Text); |
1137 | writer.WriteElementString("SitName", sop.SitName); | 1134 | writer.WriteElementString("SitName", sop.SitName); |
1138 | writer.WriteElementString("TouchName", sop.TouchName); | 1135 | writer.WriteElementString("TouchName", sop.TouchName); |
1139 | 1136 | ||
1140 | writer.WriteElementString("LinkNum", sop.LinkNum.ToString()); | 1137 | writer.WriteElementString("LinkNum", sop.LinkNum.ToString()); |
1141 | writer.WriteElementString("ClickAction", sop.ClickAction.ToString()); | 1138 | writer.WriteElementString("ClickAction", sop.ClickAction.ToString()); |
1142 | writer.WriteStartElement("Shape"); | ||
1143 | 1139 | ||
1144 | writer.WriteElementString("ProfileCurve", sop.Shape.ProfileCurve.ToString()); | 1140 | WriteShape(writer, sop.Shape); |
1145 | |||
1146 | writer.WriteStartElement("TextureEntry"); | ||
1147 | byte[] te; | ||
1148 | if (sop.Shape.TextureEntry != null) | ||
1149 | te = sop.Shape.TextureEntry; | ||
1150 | else | ||
1151 | te = Utils.EmptyBytes; | ||
1152 | writer.WriteBase64(te, 0, te.Length); | ||
1153 | writer.WriteEndElement(); // TextureEntry | ||
1154 | |||
1155 | writer.WriteStartElement("ExtraParams"); | ||
1156 | byte[] ep; | ||
1157 | if (sop.Shape.ExtraParams != null) | ||
1158 | ep = sop.Shape.ExtraParams; | ||
1159 | else | ||
1160 | ep = Utils.EmptyBytes; | ||
1161 | writer.WriteBase64(ep, 0, ep.Length); | ||
1162 | writer.WriteEndElement(); // ExtraParams | ||
1163 | |||
1164 | writer.WriteElementString("PathBegin", Primitive.PackBeginCut(sop.Shape.PathBegin).ToString()); | ||
1165 | writer.WriteElementString("PathCurve", sop.Shape.PathCurve.ToString()); | ||
1166 | writer.WriteElementString("PathEnd", Primitive.PackEndCut(sop.Shape.PathEnd).ToString()); | ||
1167 | writer.WriteElementString("PathRadiusOffset", Primitive.PackPathTwist(sop.Shape.PathRadiusOffset).ToString()); | ||
1168 | writer.WriteElementString("PathRevolutions", Primitive.PackPathRevolutions(sop.Shape.PathRevolutions).ToString()); | ||
1169 | writer.WriteElementString("PathScaleX", Primitive.PackPathScale(sop.Shape.PathScaleX).ToString()); | ||
1170 | writer.WriteElementString("PathScaleY", Primitive.PackPathScale(sop.Shape.PathScaleY).ToString()); | ||
1171 | writer.WriteElementString("PathShearX", ((byte)Primitive.PackPathShear(sop.Shape.PathShearX)).ToString()); | ||
1172 | writer.WriteElementString("PathShearY", ((byte)Primitive.PackPathShear(sop.Shape.PathShearY)).ToString()); | ||
1173 | writer.WriteElementString("PathSkew", Primitive.PackPathTwist(sop.Shape.PathSkew).ToString()); | ||
1174 | writer.WriteElementString("PathTaperX", Primitive.PackPathTaper(sop.Shape.PathTaperX).ToString()); | ||
1175 | writer.WriteElementString("PathTaperY", Primitive.PackPathTaper(sop.Shape.PathTaperY).ToString()); | ||
1176 | writer.WriteElementString("PathTwist", Primitive.PackPathTwist(sop.Shape.PathTwist).ToString()); | ||
1177 | writer.WriteElementString("PathTwistBegin", Primitive.PackPathTwist(sop.Shape.PathTwistBegin).ToString()); | ||
1178 | writer.WriteElementString("PCode", sop.Shape.PCode.ToString()); | ||
1179 | writer.WriteElementString("ProfileBegin", Primitive.PackBeginCut(sop.Shape.ProfileBegin).ToString()); | ||
1180 | writer.WriteElementString("ProfileEnd", Primitive.PackEndCut(sop.Shape.ProfileEnd).ToString()); | ||
1181 | writer.WriteElementString("ProfileHollow", Primitive.PackProfileHollow(sop.Shape.ProfileHollow).ToString()); | ||
1182 | WriteVector(writer, "Scale", sop.Scale); | ||
1183 | writer.WriteElementString("State", sop.Shape.State.ToString()); | ||
1184 | |||
1185 | writer.WriteElementString("ProfileShape", sop.Shape.ProfileShape.ToString()); | ||
1186 | writer.WriteElementString("HollowShape", sop.Shape.HollowShape.ToString()); | ||
1187 | |||
1188 | writer.WriteElementString("SculptTexture", sop.Shape.SculptTexture.ToString()); | ||
1189 | writer.WriteElementString("SculptType", sop.Shape.SculptType.ToString()); | ||
1190 | writer.WriteStartElement("SculptData"); | ||
1191 | byte[] sd; | ||
1192 | if (sop.Shape.SculptData != null) | ||
1193 | sd = sop.Shape.ExtraParams; | ||
1194 | else | ||
1195 | sd = Utils.EmptyBytes; | ||
1196 | writer.WriteBase64(sd, 0, sd.Length); | ||
1197 | writer.WriteEndElement(); // SculptData | ||
1198 | |||
1199 | writer.WriteElementString("FlexiSoftness", sop.Shape.FlexiSoftness.ToString()); | ||
1200 | writer.WriteElementString("FlexiTension", sop.Shape.FlexiTension.ToString()); | ||
1201 | writer.WriteElementString("FlexiDrag", sop.Shape.FlexiDrag.ToString()); | ||
1202 | writer.WriteElementString("FlexiGravity", sop.Shape.FlexiGravity.ToString()); | ||
1203 | writer.WriteElementString("FlexiWind", sop.Shape.FlexiWind.ToString()); | ||
1204 | writer.WriteElementString("FlexiForceX", sop.Shape.FlexiForceX.ToString()); | ||
1205 | writer.WriteElementString("FlexiForceY", sop.Shape.FlexiForceY.ToString()); | ||
1206 | writer.WriteElementString("FlexiForceZ", sop.Shape.FlexiForceZ.ToString()); | ||
1207 | |||
1208 | writer.WriteElementString("LightColorR", sop.Shape.LightColorR.ToString()); | ||
1209 | writer.WriteElementString("LightColorG", sop.Shape.LightColorG.ToString()); | ||
1210 | writer.WriteElementString("LightColorB", sop.Shape.LightColorB.ToString()); | ||
1211 | writer.WriteElementString("LightColorA", sop.Shape.LightColorA.ToString()); | ||
1212 | writer.WriteElementString("LightRadius", sop.Shape.LightRadius.ToString()); | ||
1213 | writer.WriteElementString("LightCutoff", sop.Shape.LightCutoff.ToString()); | ||
1214 | writer.WriteElementString("LightFalloff", sop.Shape.LightFalloff.ToString()); | ||
1215 | writer.WriteElementString("LightIntensity", sop.Shape.LightIntensity.ToString()); | ||
1216 | |||
1217 | writer.WriteElementString("FlexyEntry", sop.Shape.FlexiEntry.ToString()); | ||
1218 | writer.WriteElementString("LightEntry", sop.Shape.LightEntry.ToString()); | ||
1219 | writer.WriteElementString("SculptEntry", sop.Shape.SculptEntry.ToString()); | ||
1220 | |||
1221 | writer.WriteEndElement(); // Shape | ||
1222 | 1141 | ||
1223 | WriteVector(writer, "Scale", sop.Scale); | 1142 | WriteVector(writer, "Scale", sop.Scale); |
1224 | writer.WriteElementString("UpdateFlag", "0"); | 1143 | writer.WriteElementString("UpdateFlag", sop.UpdateFlag.ToString()); |
1225 | WriteQuaternion(writer, "SitTargetOrientation", sop.SitTargetOrientation); | 1144 | WriteQuaternion(writer, "SitTargetOrientation", sop.SitTargetOrientation); |
1226 | WriteVector(writer, "SitTargetPosition", sop.SitTargetPosition); | 1145 | WriteVector(writer, "SitTargetPosition", sop.SitTargetPosition); |
1227 | WriteVector(writer, "SitTargetPositionLL", sop.SitTargetPositionLL); | 1146 | WriteVector(writer, "SitTargetPositionLL", sop.SitTargetPositionLL); |
1228 | WriteQuaternion(writer, "SitTargetOrientationLL", sop.SitTargetOrientationLL); | 1147 | WriteQuaternion(writer, "SitTargetOrientationLL", sop.SitTargetOrientationLL); |
1229 | writer.WriteElementString("ParentID", sop.ParentID.ToString()); | 1148 | writer.WriteElementString("ParentID", sop.ParentID.ToString()); |
1230 | writer.WriteElementString("CreationDate", sop.CreationDate.ToString()); | 1149 | writer.WriteElementString("CreationDate", sop.CreationDate.ToString()); |
1231 | writer.WriteElementString("Category", "0"); | 1150 | writer.WriteElementString("Category", sop.Category.ToString()); |
1232 | writer.WriteElementString("SalePrice", sop.SalePrice.ToString()); | 1151 | writer.WriteElementString("SalePrice", sop.SalePrice.ToString()); |
1233 | writer.WriteElementString("ObjectSaleType", ((int)sop.ObjectSaleType).ToString()); | 1152 | writer.WriteElementString("ObjectSaleType", sop.ObjectSaleType.ToString()); |
1234 | writer.WriteElementString("OwnershipCost", "0"); | 1153 | writer.WriteElementString("OwnershipCost", sop.OwnershipCost.ToString()); |
1235 | WriteUUID(writer, "GroupID", sop.GroupID); | 1154 | WriteUUID(writer, "GroupID", sop.GroupID); |
1236 | WriteUUID(writer, "OwnerID", sop.OwnerID); | 1155 | WriteUUID(writer, "OwnerID", sop.OwnerID); |
1237 | WriteUUID(writer, "LastOwnerID", sop.LastOwnerID); | 1156 | WriteUUID(writer, "LastOwnerID", sop.LastOwnerID); |
@@ -1243,6 +1162,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1243 | writer.WriteElementString("Flags", sop.Flags.ToString()); | 1162 | writer.WriteElementString("Flags", sop.Flags.ToString()); |
1244 | WriteUUID(writer, "CollisionSound", sop.CollisionSound); | 1163 | WriteUUID(writer, "CollisionSound", sop.CollisionSound); |
1245 | writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); | 1164 | writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); |
1165 | if (sop.MediaUrl != null) | ||
1166 | writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); | ||
1246 | 1167 | ||
1247 | writer.WriteEndElement(); | 1168 | writer.WriteEndElement(); |
1248 | } | 1169 | } |
@@ -1273,6 +1194,134 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1273 | writer.WriteEndElement(); | 1194 | writer.WriteEndElement(); |
1274 | } | 1195 | } |
1275 | 1196 | ||
1197 | static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv) | ||
1198 | { | ||
1199 | if (tinv.Count > 0) // otherwise skip this | ||
1200 | { | ||
1201 | writer.WriteStartElement("TaskInventory"); | ||
1202 | |||
1203 | foreach (TaskInventoryItem item in tinv.Values) | ||
1204 | { | ||
1205 | writer.WriteStartElement("TaskInventoryItem"); | ||
1206 | |||
1207 | WriteUUID(writer, "AssetID", item.AssetID); | ||
1208 | writer.WriteElementString("BasePermissions", item.BasePermissions.ToString()); | ||
1209 | writer.WriteElementString("CreationDate", item.CreationDate.ToString()); | ||
1210 | WriteUUID(writer, "CreatorID", item.CreatorID); | ||
1211 | writer.WriteElementString("Description", item.Description); | ||
1212 | writer.WriteElementString("EveryonePermissions", item.EveryonePermissions.ToString()); | ||
1213 | writer.WriteElementString("Flags", item.Flags.ToString()); | ||
1214 | WriteUUID(writer, "GroupID", item.GroupID); | ||
1215 | writer.WriteElementString("GroupPermissions", item.GroupPermissions.ToString()); | ||
1216 | writer.WriteElementString("InvType", item.InvType.ToString()); | ||
1217 | WriteUUID(writer, "ItemID", item.ItemID); | ||
1218 | WriteUUID(writer, "OldItemID", item.OldItemID); | ||
1219 | WriteUUID(writer, "LastOwnerID", item.LastOwnerID); | ||
1220 | writer.WriteElementString("Name", item.Name); | ||
1221 | writer.WriteElementString("NextPermissions", item.NextPermissions.ToString()); | ||
1222 | WriteUUID(writer, "OwnerID", item.OwnerID); | ||
1223 | writer.WriteElementString("CurrentPermissions", item.CurrentPermissions.ToString()); | ||
1224 | WriteUUID(writer, "ParentID", item.ParentID); | ||
1225 | WriteUUID(writer, "ParentPartID", item.ParentPartID); | ||
1226 | WriteUUID(writer, "PermsGranter", item.PermsGranter); | ||
1227 | writer.WriteElementString("PermsMask", item.PermsMask.ToString()); | ||
1228 | writer.WriteElementString("Type", item.Type.ToString()); | ||
1229 | |||
1230 | writer.WriteEndElement(); // TaskInventoryItem | ||
1231 | } | ||
1232 | |||
1233 | writer.WriteEndElement(); // TaskInventory | ||
1234 | } | ||
1235 | } | ||
1236 | |||
1237 | static void WriteShape(XmlTextWriter writer, PrimitiveBaseShape shp) | ||
1238 | { | ||
1239 | if (shp != null) | ||
1240 | { | ||
1241 | writer.WriteStartElement("Shape"); | ||
1242 | |||
1243 | writer.WriteElementString("ProfileCurve", shp.ProfileCurve.ToString()); | ||
1244 | |||
1245 | writer.WriteStartElement("TextureEntry"); | ||
1246 | byte[] te; | ||
1247 | if (shp.TextureEntry != null) | ||
1248 | te = shp.TextureEntry; | ||
1249 | else | ||
1250 | te = Utils.EmptyBytes; | ||
1251 | writer.WriteBase64(te, 0, te.Length); | ||
1252 | writer.WriteEndElement(); // TextureEntry | ||
1253 | |||
1254 | writer.WriteStartElement("ExtraParams"); | ||
1255 | byte[] ep; | ||
1256 | if (shp.ExtraParams != null) | ||
1257 | ep = shp.ExtraParams; | ||
1258 | else | ||
1259 | ep = Utils.EmptyBytes; | ||
1260 | writer.WriteBase64(ep, 0, ep.Length); | ||
1261 | writer.WriteEndElement(); // ExtraParams | ||
1262 | |||
1263 | writer.WriteElementString("PathBegin", shp.PathBegin.ToString()); | ||
1264 | writer.WriteElementString("PathCurve", shp.PathCurve.ToString()); | ||
1265 | writer.WriteElementString("PathEnd", shp.PathEnd.ToString()); | ||
1266 | writer.WriteElementString("PathRadiusOffset", shp.PathRadiusOffset.ToString()); | ||
1267 | writer.WriteElementString("PathRevolutions", shp.PathRevolutions.ToString()); | ||
1268 | writer.WriteElementString("PathScaleX", shp.PathScaleX.ToString()); | ||
1269 | writer.WriteElementString("PathScaleY", shp.PathScaleY.ToString()); | ||
1270 | writer.WriteElementString("PathShearX", shp.PathShearX.ToString()); | ||
1271 | writer.WriteElementString("PathShearY", shp.PathShearY.ToString()); | ||
1272 | writer.WriteElementString("PathSkew", shp.PathSkew.ToString()); | ||
1273 | writer.WriteElementString("PathTaperX", shp.PathTaperX.ToString()); | ||
1274 | writer.WriteElementString("PathTaperY", shp.PathTaperY.ToString()); | ||
1275 | writer.WriteElementString("PathTwist", shp.PathTwist.ToString()); | ||
1276 | writer.WriteElementString("PathTwistBegin", shp.PathTwistBegin.ToString()); | ||
1277 | writer.WriteElementString("PCode", shp.PCode.ToString()); | ||
1278 | writer.WriteElementString("ProfileBegin", shp.ProfileBegin.ToString()); | ||
1279 | writer.WriteElementString("ProfileEnd", shp.ProfileEnd.ToString()); | ||
1280 | writer.WriteElementString("ProfileHollow", shp.ProfileHollow.ToString()); | ||
1281 | writer.WriteElementString("State", shp.State.ToString()); | ||
1282 | |||
1283 | writer.WriteElementString("ProfileShape", shp.ProfileShape.ToString()); | ||
1284 | writer.WriteElementString("HollowShape", shp.HollowShape.ToString()); | ||
1285 | |||
1286 | WriteUUID(writer, "SculptTexture", shp.SculptTexture); | ||
1287 | writer.WriteElementString("SculptType", shp.SculptType.ToString()); | ||
1288 | writer.WriteStartElement("SculptData"); | ||
1289 | byte[] sd; | ||
1290 | if (shp.SculptData != null) | ||
1291 | sd = shp.ExtraParams; | ||
1292 | else | ||
1293 | sd = Utils.EmptyBytes; | ||
1294 | writer.WriteBase64(sd, 0, sd.Length); | ||
1295 | writer.WriteEndElement(); // SculptData | ||
1296 | |||
1297 | writer.WriteElementString("FlexiSoftness", shp.FlexiSoftness.ToString()); | ||
1298 | writer.WriteElementString("FlexiTension", shp.FlexiTension.ToString()); | ||
1299 | writer.WriteElementString("FlexiDrag", shp.FlexiDrag.ToString()); | ||
1300 | writer.WriteElementString("FlexiGravity", shp.FlexiGravity.ToString()); | ||
1301 | writer.WriteElementString("FlexiWind", shp.FlexiWind.ToString()); | ||
1302 | writer.WriteElementString("FlexiForceX", shp.FlexiForceX.ToString()); | ||
1303 | writer.WriteElementString("FlexiForceY", shp.FlexiForceY.ToString()); | ||
1304 | writer.WriteElementString("FlexiForceZ", shp.FlexiForceZ.ToString()); | ||
1305 | |||
1306 | writer.WriteElementString("LightColorR", shp.LightColorR.ToString()); | ||
1307 | writer.WriteElementString("LightColorG", shp.LightColorG.ToString()); | ||
1308 | writer.WriteElementString("LightColorB", shp.LightColorB.ToString()); | ||
1309 | writer.WriteElementString("LightColorA", shp.LightColorA.ToString()); | ||
1310 | writer.WriteElementString("LightRadius", shp.LightRadius.ToString()); | ||
1311 | writer.WriteElementString("LightCutoff", shp.LightCutoff.ToString()); | ||
1312 | writer.WriteElementString("LightFalloff", shp.LightFalloff.ToString()); | ||
1313 | writer.WriteElementString("LightIntensity", shp.LightIntensity.ToString()); | ||
1314 | |||
1315 | writer.WriteElementString("FlexiEntry", shp.FlexiEntry.ToString().ToLower()); | ||
1316 | writer.WriteElementString("LightEntry", shp.LightEntry.ToString().ToLower()); | ||
1317 | writer.WriteElementString("SculptEntry", shp.SculptEntry.ToString().ToLower()); | ||
1318 | |||
1319 | if (shp.Media != null) | ||
1320 | writer.WriteElementString("Media", shp.Media.ToXml()); | ||
1321 | |||
1322 | writer.WriteEndElement(); // Shape | ||
1323 | } | ||
1324 | } | ||
1276 | 1325 | ||
1277 | //////// Read ///////// | 1326 | //////// Read ///////// |
1278 | public static bool Xml2ToSOG(XmlTextReader reader, SceneObjectGroup sog) | 1327 | public static bool Xml2ToSOG(XmlTextReader reader, SceneObjectGroup sog) |
@@ -1332,13 +1381,16 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1332 | SOPXmlProcessor p = null; | 1381 | SOPXmlProcessor p = null; |
1333 | if (m_SOPXmlProcessors.TryGetValue(reader.Name, out p)) | 1382 | if (m_SOPXmlProcessors.TryGetValue(reader.Name, out p)) |
1334 | { | 1383 | { |
1384 | //m_log.DebugFormat("[XXX] Processing: {0}", reader.Name); | ||
1335 | try | 1385 | try |
1336 | { | 1386 | { |
1337 | p(obj, reader); | 1387 | p(obj, reader); |
1338 | } | 1388 | } |
1339 | catch (Exception e) | 1389 | catch (Exception e) |
1340 | { | 1390 | { |
1341 | m_log.DebugFormat("[SceneObjectSerializer]: exception while parsing {0} in {1}-{2}: {3}", nodeName, obj.Name, obj.UUID, e); | 1391 | m_log.DebugFormat("[SceneObjectSerializer]: exception while parsing {0}: {1}", nodeName, e); |
1392 | if (reader.NodeType == XmlNodeType.EndElement) | ||
1393 | reader.Read(); | ||
1342 | } | 1394 | } |
1343 | } | 1395 | } |
1344 | else | 1396 | else |
@@ -1441,6 +1493,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1441 | 1493 | ||
1442 | while (reader.NodeType != XmlNodeType.EndElement) | 1494 | while (reader.NodeType != XmlNodeType.EndElement) |
1443 | { | 1495 | { |
1496 | //m_log.DebugFormat("[XXX] Processing: {0}", reader.Name); | ||
1444 | ShapeXmlProcessor p = null; | 1497 | ShapeXmlProcessor p = null; |
1445 | if (m_ShapeXmlProcessors.TryGetValue(reader.Name, out p)) | 1498 | if (m_ShapeXmlProcessors.TryGetValue(reader.Name, out p)) |
1446 | p(shape, reader); | 1499 | p(shape, reader); |
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs index bb67ca0..c6d4e55 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs | |||
@@ -280,6 +280,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
280 | 280 | ||
281 | public static void SavePrimListToXml2(EntityBase[] entityList, TextWriter stream, Vector3 min, Vector3 max) | 281 | public static void SavePrimListToXml2(EntityBase[] entityList, TextWriter stream, Vector3 min, Vector3 max) |
282 | { | 282 | { |
283 | XmlTextWriter writer = new XmlTextWriter(stream); | ||
284 | |||
283 | int primCount = 0; | 285 | int primCount = 0; |
284 | stream.WriteLine("<scene>\n"); | 286 | stream.WriteLine("<scene>\n"); |
285 | 287 | ||
@@ -297,10 +299,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
297 | continue; | 299 | continue; |
298 | } | 300 | } |
299 | 301 | ||
300 | stream.WriteLine(SceneObjectSerializer.ToXml2Format(g)); | 302 | //stream.WriteLine(SceneObjectSerializer.ToXml2Format(g)); |
303 | SceneObjectSerializer.SOGToXml2(writer, (SceneObjectGroup)ent); | ||
304 | stream.WriteLine(); | ||
305 | |||
301 | primCount++; | 306 | primCount++; |
302 | } | 307 | } |
303 | } | 308 | } |
309 | |||
304 | stream.WriteLine("</scene>\n"); | 310 | stream.WriteLine("</scene>\n"); |
305 | stream.Flush(); | 311 | stream.Flush(); |
306 | } | 312 | } |