From 9f5ab3b965b1a3324918b7b2267c24709d42919b Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 2 Nov 2010 12:05:24 -0700 Subject: Old deserialization can't deal with commas in flag fields. Making use of -version option on save oar command. Bumped archives version to 0.5; version < 0.5 generates flag fields without commas. Everything else is identical. --- .../Scenes/Serialization/SceneObjectSerializer.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index e661ca9..7f37878 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -1135,7 +1135,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization writer.WriteElementString("GroupMask", sop.GroupMask.ToString()); writer.WriteElementString("EveryoneMask", sop.EveryoneMask.ToString()); writer.WriteElementString("NextOwnerMask", sop.NextOwnerMask.ToString()); - writer.WriteElementString("Flags", sop.Flags.ToString()); + WriteFlags(writer, "Flags", sop.Flags.ToString(), options); WriteUUID(writer, "CollisionSound", sop.CollisionSound, options); writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); if (sop.MediaUrl != null) @@ -1188,6 +1188,20 @@ namespace OpenSim.Region.Framework.Scenes.Serialization } + static void WriteFlags(XmlTextWriter writer, string name, string flagsStr, Dictionary options) + { + // Older versions of serialization can't cope with commas + if (options.ContainsKey("version")) + { + float version = 0.5F; + float.TryParse(options["version"].ToString(), out version); + if (version < 0.5) + flagsStr = flagsStr.Replace(",", ""); + } + + writer.WriteElementString(name, flagsStr); + } + static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary options) { if (tinv.Count > 0) // otherwise skip this @@ -1275,8 +1289,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization writer.WriteElementString("ProfileHollow", shp.ProfileHollow.ToString()); writer.WriteElementString("State", shp.State.ToString()); - writer.WriteElementString("ProfileShape", shp.ProfileShape.ToString()); - writer.WriteElementString("HollowShape", shp.HollowShape.ToString()); + WriteFlags(writer, "ProfileShape", shp.ProfileShape.ToString(), options); + WriteFlags(writer, "HollowShape", shp.HollowShape.ToString(), options); WriteUUID(writer, "SculptTexture", shp.SculptTexture, options); writer.WriteElementString("SculptType", shp.SculptType.ToString()); -- cgit v1.1 From 78a0ed3ff919569b7f572ea3d713454c9a71fff0 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 2 Nov 2010 21:28:24 +0000 Subject: Fix sitting and standing up --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 8defe68..d01cac2 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -872,6 +872,12 @@ namespace OpenSim.Region.Framework.Scenes AddToPhysicalScene(isFlying); + if (m_appearance != null) + { + if (m_appearance.AvatarHeight > 0) + SetHeight(m_appearance.AvatarHeight); + } + if (m_forceFly) { m_physicsActor.Flying = true; @@ -2391,11 +2397,14 @@ namespace OpenSim.Region.Framework.Scenes if (m_appearance.Texture == null) return; - if (LocalId == remoteAvatar.LocalId) - { - m_log.WarnFormat("[SCENEPRESENCE]: An agent is attempting to send avatar data to itself; {0}", UUID); - return; - } +// MT: This is needed for sit. It's legal to send it to oneself, and the name +// of the method is a misnomer +// +// if (LocalId == remoteAvatar.LocalId) +// { +// m_log.WarnFormat("[SCENEPRESENCE]: An agent is attempting to send avatar data to itself; {0}", UUID); +// return; +// } if (IsChildAgent) { -- cgit v1.1 From d555c373d88586a868d5a466b5933fcfd9c8a3e8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 2 Nov 2010 23:39:45 +0000 Subject: Fix avatar height management --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 35 ++++++++---------------- 1 file changed, 11 insertions(+), 24 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index d01cac2..ce9cf0c 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -171,9 +171,6 @@ namespace OpenSim.Region.Framework.Scenes private float m_health = 100f; - // Default AV Height - private float m_avHeight = 127.0f; - protected RegionInfo m_regionInfo; protected ulong crossingFromRegion; @@ -841,9 +838,10 @@ namespace OpenSim.Region.Framework.Scenes } float localAVHeight = 1.56f; - if (m_avHeight != 127.0f) + if (m_appearance != null) { - localAVHeight = m_avHeight; + if (m_appearance.AvatarHeight > 0) + localAVHeight = m_appearance.AvatarHeight; } float posZLimit = 0; @@ -1066,10 +1064,9 @@ namespace OpenSim.Region.Framework.Scenes /// public void SetHeight(float height) { - m_avHeight = height; if (PhysicsActor != null && !IsChildAgent) { - Vector3 SetSize = new Vector3(0.45f, 0.6f, m_avHeight); + Vector3 SetSize = new Vector3(0.45f, 0.6f, height); PhysicsActor.Size = SetSize; } } @@ -1693,9 +1690,10 @@ namespace OpenSim.Region.Framework.Scenes m_parentID = 0; SendFullUpdateToAllClients(); m_requestedSitTargetID = 0; - if ((m_physicsActor != null) && (m_avHeight > 0)) + if (m_physicsActor != null && m_appearance != null) { - SetHeight(m_avHeight); + if (m_appearance.AvatarHeight > 0) + SetHeight(m_appearance.AvatarHeight); } } @@ -2585,7 +2583,7 @@ namespace OpenSim.Region.Framework.Scenes cadu.ActiveGroupID = UUID.Zero.Guid; cadu.AgentID = UUID.Guid; cadu.alwaysrun = m_setAlwaysRun; - cadu.AVHeight = m_avHeight; + cadu.AVHeight = m_appearance.AvatarHeight; Vector3 tempCameraCenter = m_CameraCenter; cadu.cameraPosition = tempCameraCenter; cadu.drawdistance = m_DrawDistance; @@ -2921,7 +2919,6 @@ namespace OpenSim.Region.Framework.Scenes m_CameraCenter = cAgentData.Center + offset; - m_avHeight = cAgentData.Size.Z; //SetHeight(cAgentData.AVHeight); if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) @@ -2946,8 +2943,6 @@ namespace OpenSim.Region.Framework.Scenes cAgent.Position = AbsolutePosition; cAgent.Velocity = m_velocity; cAgent.Center = m_CameraCenter; - // Don't copy the size; it is inferred from apearance parameters - //cAgent.Size = new Vector3(0, 0, m_avHeight); cAgent.AtAxis = m_CameraAtAxis; cAgent.LeftAxis = m_CameraLeftAxis; cAgent.UpAxis = m_CameraUpAxis; @@ -3065,7 +3060,6 @@ namespace OpenSim.Region.Framework.Scenes m_pos = cAgent.Position; m_velocity = cAgent.Velocity; m_CameraCenter = cAgent.Center; - //m_avHeight = cAgent.Size.Z; m_CameraAtAxis = cAgent.AtAxis; m_CameraLeftAxis = cAgent.LeftAxis; m_CameraUpAxis = cAgent.UpAxis; @@ -3198,16 +3192,9 @@ namespace OpenSim.Region.Framework.Scenes Vector3 pVec = AbsolutePosition; // Old bug where the height was in centimeters instead of meters - if (m_avHeight == 127.0f) - { - m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec, new Vector3(0f, 0f, 1.56f), - isFlying); - } - else - { - m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec, - new Vector3(0f, 0f, m_avHeight), isFlying); - } + m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec, + new Vector3(0f, 0f, m_appearance.AvatarHeight), isFlying); + scene.AddPhysicsActorTaint(m_physicsActor); //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; -- cgit v1.1 From 7d551e27cac7cba3c475ec7e528897834552b36f Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 3 Nov 2010 00:01:47 +0000 Subject: Trying to prevent a wrong physical actor size --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index ce9cf0c..a339a4f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3187,6 +3187,9 @@ namespace OpenSim.Region.Framework.Scenes /// public void AddToPhysicalScene(bool isFlying) { + if (m_appearance.AvatarHeight == 0) + return; + PhysicsScene scene = m_scene.PhysicsScene; Vector3 pVec = AbsolutePosition; -- cgit v1.1 From 57eabe9d4625a7f91a48525f83233a5a617c5a24 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 3 Nov 2010 00:47:22 +0000 Subject: Actually calculate the height before setting it, this isn't done automatically on incoming transfers in all cases. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a339a4f..964f8cb 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3078,6 +3078,12 @@ namespace OpenSim.Region.Framework.Scenes m_setAlwaysRun = cAgent.AlwaysRun; m_appearance = new AvatarAppearance(cAgent.Appearance); + if (m_physicsActor != null) + { + bool isFlying = m_physicsActor.Flying; + RemoveFromPhysicalScene(); + AddToPhysicalScene(isFlying); + } /* uint i = 0; @@ -3188,7 +3194,7 @@ namespace OpenSim.Region.Framework.Scenes public void AddToPhysicalScene(bool isFlying) { if (m_appearance.AvatarHeight == 0) - return; + m_appearance.SetHeight(); PhysicsScene scene = m_scene.PhysicsScene; -- cgit v1.1 From 6c3b7617b0356f093ef2730f1c517d6228997984 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 3 Nov 2010 02:31:43 +0000 Subject: Add lsClearWindlightScene() to the lightshare module to remove WL settings from a region and allow normal day cycles to be reestablished --- OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs | 1 + OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs | 1 + 2 files changed, 2 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs b/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs index edaa07c..5295a72 100644 --- a/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs +++ b/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs @@ -94,5 +94,6 @@ namespace OpenSim.Region.Framework.Interfaces RegionSettings LoadRegionSettings(UUID regionUUID); RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID); void StoreRegionWindlightSettings(RegionLightShareData wl); + void RemoveRegionWindlightSettings(UUID regionID); } } diff --git a/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs index 0a4d531..615f377 100644 --- a/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs +++ b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs @@ -105,6 +105,7 @@ namespace OpenSim.Region.Framework.Interfaces RegionSettings LoadRegionSettings(UUID regionUUID); RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID); void StoreRegionWindlightSettings(RegionLightShareData wl); + void RemoveRegionWindlightSettings(UUID regionID); void Shutdown(); } -- cgit v1.1 From 644eb9fd7f87637727d4789fa331accbffce931e Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 5 Nov 2010 13:45:28 +0000 Subject: Fix playing sound from HUDs --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 7a6449d..f164201 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3100,6 +3100,7 @@ namespace OpenSim.Region.Framework.Scenes UUID ownerID = _ownerID; UUID objectID = ParentGroup.RootPart.UUID; UUID parentID = GetRootPartUUID(); + UUID soundID = UUID.Zero; Vector3 position = AbsolutePosition; // region local ulong regionHandle = m_parentGroup.Scene.RegionInfo.RegionHandle; -- cgit v1.1