diff options
author | teravus | 2013-02-07 10:28:26 -0500 |
---|---|---|
committer | teravus | 2013-02-07 10:50:17 -0500 |
commit | 94a5232d3a07c3ff5f9b720dfc975848d750f423 (patch) | |
tree | f2329adf59b6525528db1e7e099e8beddaf39a6d /OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |
parent | This is the final commit that enables the Websocket handler (diff) | |
parent | Rename "Bounciness" to "Restitution" (diff) | |
download | opensim-SC-94a5232d3a07c3ff5f9b720dfc975848d750f423.zip opensim-SC-94a5232d3a07c3ff5f9b720dfc975848d750f423.tar.gz opensim-SC-94a5232d3a07c3ff5f9b720dfc975848d750f423.tar.bz2 opensim-SC-94a5232d3a07c3ff5f9b720dfc975848d750f423.tar.xz |
* Adds Websocket support to baseHttpServer and IHttpServer.cs . This allows modules to set up a websocket server that websocket clients can connect to. An example module is in OptionalModules/Example/WebSocketEchoTest/WebSocketEchoModule.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 2d4c60a..39420a6 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -359,6 +359,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
359 | m_SOPXmlProcessors.Add("CollisionSound", ProcessCollisionSound); | 359 | m_SOPXmlProcessors.Add("CollisionSound", ProcessCollisionSound); |
360 | m_SOPXmlProcessors.Add("CollisionSoundVolume", ProcessCollisionSoundVolume); | 360 | m_SOPXmlProcessors.Add("CollisionSoundVolume", ProcessCollisionSoundVolume); |
361 | m_SOPXmlProcessors.Add("MediaUrl", ProcessMediaUrl); | 361 | m_SOPXmlProcessors.Add("MediaUrl", ProcessMediaUrl); |
362 | m_SOPXmlProcessors.Add("DynAttrs", ProcessDynAttrs); | ||
362 | m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation); | 363 | m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation); |
363 | m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem); | 364 | m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem); |
364 | m_SOPXmlProcessors.Add("PayPrice0", ProcessPayPrice0); | 365 | m_SOPXmlProcessors.Add("PayPrice0", ProcessPayPrice0); |
@@ -366,6 +367,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
366 | m_SOPXmlProcessors.Add("PayPrice2", ProcessPayPrice2); | 367 | m_SOPXmlProcessors.Add("PayPrice2", ProcessPayPrice2); |
367 | m_SOPXmlProcessors.Add("PayPrice3", ProcessPayPrice3); | 368 | m_SOPXmlProcessors.Add("PayPrice3", ProcessPayPrice3); |
368 | m_SOPXmlProcessors.Add("PayPrice4", ProcessPayPrice4); | 369 | m_SOPXmlProcessors.Add("PayPrice4", ProcessPayPrice4); |
370 | |||
371 | m_SOPXmlProcessors.Add("PhysicsShapeType", ProcessPhysicsShapeType); | ||
372 | m_SOPXmlProcessors.Add("Density", ProcessDensity); | ||
373 | m_SOPXmlProcessors.Add("Friction", ProcessFriction); | ||
374 | m_SOPXmlProcessors.Add("Bounce", ProcessBounce); | ||
375 | m_SOPXmlProcessors.Add("GravityModifier", ProcessGravityModifier); | ||
376 | |||
369 | #endregion | 377 | #endregion |
370 | 378 | ||
371 | #region TaskInventoryXmlProcessors initialization | 379 | #region TaskInventoryXmlProcessors initialization |
@@ -593,6 +601,31 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
593 | obj.ClickAction = (byte)reader.ReadElementContentAsInt("ClickAction", String.Empty); | 601 | obj.ClickAction = (byte)reader.ReadElementContentAsInt("ClickAction", String.Empty); |
594 | } | 602 | } |
595 | 603 | ||
604 | private static void ProcessPhysicsShapeType(SceneObjectPart obj, XmlTextReader reader) | ||
605 | { | ||
606 | obj.PhysicsShapeType = (byte)reader.ReadElementContentAsInt("PhysicsShapeType", String.Empty); | ||
607 | } | ||
608 | |||
609 | private static void ProcessDensity(SceneObjectPart obj, XmlTextReader reader) | ||
610 | { | ||
611 | obj.Density = reader.ReadElementContentAsFloat("Density", String.Empty); | ||
612 | } | ||
613 | |||
614 | private static void ProcessFriction(SceneObjectPart obj, XmlTextReader reader) | ||
615 | { | ||
616 | obj.Friction = reader.ReadElementContentAsFloat("Friction", String.Empty); | ||
617 | } | ||
618 | |||
619 | private static void ProcessBounce(SceneObjectPart obj, XmlTextReader reader) | ||
620 | { | ||
621 | obj.Restitution = reader.ReadElementContentAsFloat("Bounce", String.Empty); | ||
622 | } | ||
623 | |||
624 | private static void ProcessGravityModifier(SceneObjectPart obj, XmlTextReader reader) | ||
625 | { | ||
626 | obj.GravityModifier = reader.ReadElementContentAsFloat("GravityModifier", String.Empty); | ||
627 | } | ||
628 | |||
596 | private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) | 629 | private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) |
597 | { | 630 | { |
598 | List<string> errorNodeNames; | 631 | List<string> errorNodeNames; |
@@ -722,6 +755,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
722 | obj.MediaUrl = reader.ReadElementContentAsString("MediaUrl", String.Empty); | 755 | obj.MediaUrl = reader.ReadElementContentAsString("MediaUrl", String.Empty); |
723 | } | 756 | } |
724 | 757 | ||
758 | private static void ProcessDynAttrs(SceneObjectPart obj, XmlTextReader reader) | ||
759 | { | ||
760 | obj.DynAttrs.ReadXml(reader); | ||
761 | } | ||
762 | |||
725 | private static void ProcessTextureAnimation(SceneObjectPart obj, XmlTextReader reader) | 763 | private static void ProcessTextureAnimation(SceneObjectPart obj, XmlTextReader reader) |
726 | { | 764 | { |
727 | obj.TextureAnimation = Convert.FromBase64String(reader.ReadElementContentAsString("TextureAnimation", String.Empty)); | 765 | obj.TextureAnimation = Convert.FromBase64String(reader.ReadElementContentAsString("TextureAnimation", String.Empty)); |
@@ -1235,6 +1273,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1235 | writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); | 1273 | writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); |
1236 | if (sop.MediaUrl != null) | 1274 | if (sop.MediaUrl != null) |
1237 | writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); | 1275 | writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); |
1276 | |||
1277 | if (sop.DynAttrs.Count > 0) | ||
1278 | { | ||
1279 | writer.WriteStartElement("DynAttrs"); | ||
1280 | sop.DynAttrs.WriteXml(writer); | ||
1281 | writer.WriteEndElement(); | ||
1282 | } | ||
1283 | |||
1238 | WriteBytes(writer, "TextureAnimation", sop.TextureAnimation); | 1284 | WriteBytes(writer, "TextureAnimation", sop.TextureAnimation); |
1239 | WriteBytes(writer, "ParticleSystem", sop.ParticleSystem); | 1285 | WriteBytes(writer, "ParticleSystem", sop.ParticleSystem); |
1240 | writer.WriteElementString("PayPrice0", sop.PayPrice[0].ToString()); | 1286 | writer.WriteElementString("PayPrice0", sop.PayPrice[0].ToString()); |
@@ -1243,6 +1289,17 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1243 | writer.WriteElementString("PayPrice3", sop.PayPrice[3].ToString()); | 1289 | writer.WriteElementString("PayPrice3", sop.PayPrice[3].ToString()); |
1244 | writer.WriteElementString("PayPrice4", sop.PayPrice[4].ToString()); | 1290 | writer.WriteElementString("PayPrice4", sop.PayPrice[4].ToString()); |
1245 | 1291 | ||
1292 | if(sop.PhysicsShapeType != sop.DefaultPhysicsShapeType()) | ||
1293 | writer.WriteElementString("PhysicsShapeType", sop.PhysicsShapeType.ToString().ToLower()); | ||
1294 | if (sop.Density != 1000.0f) | ||
1295 | writer.WriteElementString("Density", sop.Density.ToString().ToLower()); | ||
1296 | if (sop.Friction != 0.6f) | ||
1297 | writer.WriteElementString("Friction", sop.Friction.ToString().ToLower()); | ||
1298 | if (sop.Restitution != 0.5f) | ||
1299 | writer.WriteElementString("Bounce", sop.Restitution.ToString().ToLower()); | ||
1300 | if (sop.GravityModifier != 1.0f) | ||
1301 | writer.WriteElementString("GravityModifier", sop.GravityModifier.ToString().ToLower()); | ||
1302 | |||
1246 | writer.WriteEndElement(); | 1303 | writer.WriteEndElement(); |
1247 | } | 1304 | } |
1248 | 1305 | ||