From 87c88ff7028673744d7eaa805a0206066c920437 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 30 Nov 2009 18:06:10 +0000 Subject: enable messaging_server_url by default in OpenSim.ini.example having this enabled results just in warning messages if no message service is actually available haivng this disabled results in an unexpected failure if no message service is available --- bin/OpenSim.ini.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 116a8fd..dadc560 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -342,7 +342,7 @@ ; The MessagingServer is a companion of the UserServer. It uses ; user_send_key and user_recv_key, too - ;messaging_server_url = "http://127.0.0.1:8006" + messaging_server_url = "http://127.0.0.1:8006" ; What is reported as the "X-Secondlife-Shard" ; Defaults to the user server url if not set -- cgit v1.1 From 17136724e2bc9529c9f8269c05402ab531d5f82d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 30 Nov 2009 18:35:57 +0000 Subject: minor: add disabled config and explanation for WebStats --- bin/OpenSim.ini.example | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index dadc560..3accee0 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -1152,7 +1152,6 @@ safemode = false [VivoxVoice] - ; The VivoxVoice module will allow you to provide voice on your ; region(s). It uses the same voice technology as the LL grid and ; works with recent LL clients (we have tested 1.22.9.110075, so @@ -1293,6 +1292,15 @@ RootReprioritizationDistance = 10.0 ChildReprioritizationDistance = 20.0 + +[WebStats] +; View region statistics via a web page +; See http://opensimulator.org/wiki/FAQ#Region_Statistics_on_a_Web_Page +; Use a web browser and type in the "Login URI" + "/SStats/" +; For example- http://127.0.0.1:9000/SStats/ +; enabled=false + + ;; ;; These are defaults that are overwritten below in [Architecture]. ;; These defaults allow OpenSim to work out of the box with -- cgit v1.1 From 0cb4ff1b68b63251ca64b965bab5fa208797d37b Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Mon, 30 Nov 2009 13:53:43 -0500 Subject: * Modified ScenePresence to use the Util version of the EnvironmentTickCount method (and it's subtract method). Remove redundant EnvironmentTickCount definitions in ScenePresence. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 110 +++++++++-------------- 1 file changed, 43 insertions(+), 67 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index bcad335..5b97eb5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -754,38 +754,14 @@ namespace OpenSim.Region.Framework.Scenes /// timestamp has already been sent. /// public void SendPrimUpdates() - { - m_perfMonMS = EnvironmentTickCount(); - - m_sceneViewer.SendPrimUpdates(); - - m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); - } + { + m_perfMonMS = Util.EnvironmentTickCount(); - /// - /// Environment.TickCount is an int but it counts all 32 bits so it goes positive - /// and negative every 24.9 days. This trims down TickCount so it doesn't wrap - /// for the callers. - /// This trims it to a 12 day interval so don't let your frame time get too long. - /// - /// - const Int32 EnvironmentTickCountMask = 0x3fffffff; - private static Int32 EnvironmentTickCount() { - return Environment.TickCount & EnvironmentTickCountMask; + m_sceneViewer.SendPrimUpdates(); + + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); } - /// - /// Environment.TickCount is an int but it counts all 32 bits so it goes positive - /// and negative every 24.9 days. Subtracts the passed value (previously fetched by - /// 'EnvironmentTickCount()') and accounts for any wrapping. - /// - /// subtraction of passed prevValue from current Environment.TickCount - private static Int32 EnvironmentTickCountSubtract(Int32 prevValue) { - Int32 diff = EnvironmentTickCount() - prevValue; - return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1); - } - - #region Status Methods /// @@ -1172,7 +1148,7 @@ namespace OpenSim.Region.Framework.Scenes // return; //} - m_perfMonMS = EnvironmentTickCount(); + m_perfMonMS = Util.EnvironmentTickCount(); ++m_movementUpdateCount; if (m_movementUpdateCount < 1) @@ -1486,9 +1462,9 @@ namespace OpenSim.Region.Framework.Scenes } } - m_scene.EventManager.TriggerOnClientMovement(this); - - m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); + m_scene.EventManager.TriggerOnClientMovement(this); + + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); } public void DoAutoPilot(uint not_used, Vector3 Pos, IClientAPI remote_client) @@ -1946,9 +1922,9 @@ namespace OpenSim.Region.Framework.Scenes } return; - } - - m_perfMonMS = EnvironmentTickCount(); + } + + m_perfMonMS = Util.EnvironmentTickCount(); Rotation = rotation; Vector3 direc = vec * rotation; @@ -1988,9 +1964,9 @@ namespace OpenSim.Region.Framework.Scenes } // TODO: Add the force instead of only setting it to support multiple forces per frame? - m_forceToApply = direc; - - m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); + m_forceToApply = direc; + + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); } #endregion @@ -2055,8 +2031,8 @@ namespace OpenSim.Region.Framework.Scenes // If the client is inactive, it's getting its updates from another // server. if (remoteClient.IsActive) - { - m_perfMonMS = EnvironmentTickCount(); + { + m_perfMonMS = Util.EnvironmentTickCount(); PhysicsActor actor = m_physicsActor; Vector3 velocity = (actor != null) ? actor.Velocity : Vector3.Zero; @@ -2067,9 +2043,9 @@ namespace OpenSim.Region.Framework.Scenes //m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity); remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, - pos, velocity, Vector3.Zero, m_bodyRot, CollisionPlane, m_uuid, null, GetUpdatePriority(remoteClient))); - - m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); + pos, velocity, Vector3.Zero, m_bodyRot, CollisionPlane, m_uuid, null, GetUpdatePriority(remoteClient))); + + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); m_scene.StatsReporter.AddAgentUpdates(1); } } @@ -2078,12 +2054,12 @@ namespace OpenSim.Region.Framework.Scenes /// Send a location/velocity/accelleration update to all agents in scene /// public void SendTerseUpdateToAllClients() - { - m_perfMonMS = EnvironmentTickCount(); + { + m_perfMonMS = Util.EnvironmentTickCount(); - m_scene.ForEachClient(SendTerseUpdateToClient); - - m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); + m_scene.ForEachClient(SendTerseUpdateToClient); + + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); } public void SendCoarseLocations() @@ -2102,8 +2078,8 @@ namespace OpenSim.Region.Framework.Scenes } public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p) - { - m_perfMonMS = EnvironmentTickCount(); + { + m_perfMonMS = Util.EnvironmentTickCount(); List CoarseLocations = new List(); List AvatarUUIDs = new List(); @@ -2137,9 +2113,9 @@ namespace OpenSim.Region.Framework.Scenes //} } - m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); - - m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); + m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); + + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); } public void CoarseLocationChange() @@ -2175,8 +2151,8 @@ namespace OpenSim.Region.Framework.Scenes /// Tell *ALL* agents about this agent /// public void SendInitialFullUpdateToAllClients() - { - m_perfMonMS = EnvironmentTickCount(); + { + m_perfMonMS = Util.EnvironmentTickCount(); ScenePresence[] avatars = m_scene.GetScenePresences(); @@ -2201,15 +2177,15 @@ namespace OpenSim.Region.Framework.Scenes } } - m_scene.StatsReporter.AddAgentUpdates(avatars.Length); - m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); + m_scene.StatsReporter.AddAgentUpdates(avatars.Length); + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); //Animator.SendAnimPack(); } public void SendFullUpdateToAllClients() - { - m_perfMonMS = EnvironmentTickCount(); + { + m_perfMonMS = Util.EnvironmentTickCount(); // only send update from root agents to other clients; children are only "listening posts" List avatars = m_scene.GetAvatars(); @@ -2218,8 +2194,8 @@ namespace OpenSim.Region.Framework.Scenes SendFullUpdateToOtherClient(avatar); } - m_scene.StatsReporter.AddAgentUpdates(avatars.Count); - m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); + m_scene.StatsReporter.AddAgentUpdates(avatars.Count); + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); Animator.SendAnimPack(); } @@ -2260,8 +2236,8 @@ namespace OpenSim.Region.Framework.Scenes /// /// public void SendAppearanceToAllOtherAgents() - { - m_perfMonMS = EnvironmentTickCount(); + { + m_perfMonMS = Util.EnvironmentTickCount(); m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) { @@ -2269,9 +2245,9 @@ namespace OpenSim.Region.Framework.Scenes { SendAppearanceToOtherAgent(scenePresence); } - }); - - m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); + }); + + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); } /// -- cgit v1.1 From 83694e557812613bc6325cb6676625e5fa02b232 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Mon, 30 Nov 2009 14:03:20 -0500 Subject: * Add a close method to the ScenePresenceAnimator that dereferences the class variables and make the ScenePresence Close method call it. --- OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | 6 ++++++ OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index b37249d..bbd445d 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -443,5 +443,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation SendAnimPack(animIDs, sequenceNums, objectIDs); } + + public void Close() + { + m_animations = null; + m_scenePresence = null; + } } } \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5b97eb5..46a9ad1 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3047,7 +3047,9 @@ namespace OpenSim.Region.Framework.Scenes m_sceneViewer.Close(); - RemoveFromPhysicalScene(); + RemoveFromPhysicalScene(); + m_animator.Close(); + m_animator = null; } public ScenePresence() -- cgit v1.1 From 85f7e4a6ab33b1dbc65b4f287da4ec3542ff4220 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 1 Dec 2009 14:03:06 +0000 Subject: Remove leftover IronPython DLLs This completes http://opensimulator.org/mantis/view.php?id=4395 --- bin/IronMath.dll | Bin 45056 -> 0 bytes bin/IronPython.dll | Bin 1605632 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 bin/IronMath.dll delete mode 100644 bin/IronPython.dll diff --git a/bin/IronMath.dll b/bin/IronMath.dll deleted file mode 100644 index 4960cc6..0000000 Binary files a/bin/IronMath.dll and /dev/null differ diff --git a/bin/IronPython.dll b/bin/IronPython.dll deleted file mode 100644 index 2efe7ef..0000000 Binary files a/bin/IronPython.dll and /dev/null differ -- cgit v1.1 From 475d23741dbe66252c86bd2cea621370c6c0ed7a Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Tue, 1 Dec 2009 10:13:33 -0500 Subject: * Fix Inconsistent line ending style in ScenePresence --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 56 ++++++++++++------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 46a9ad1..b2cd249 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -754,11 +754,11 @@ namespace OpenSim.Region.Framework.Scenes /// timestamp has already been sent. /// public void SendPrimUpdates() - { + { m_perfMonMS = Util.EnvironmentTickCount(); - m_sceneViewer.SendPrimUpdates(); - + m_sceneViewer.SendPrimUpdates(); + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); } @@ -1462,8 +1462,8 @@ namespace OpenSim.Region.Framework.Scenes } } - m_scene.EventManager.TriggerOnClientMovement(this); - + m_scene.EventManager.TriggerOnClientMovement(this); + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); } @@ -1922,8 +1922,8 @@ namespace OpenSim.Region.Framework.Scenes } return; - } - + } + m_perfMonMS = Util.EnvironmentTickCount(); Rotation = rotation; @@ -1964,8 +1964,8 @@ namespace OpenSim.Region.Framework.Scenes } // TODO: Add the force instead of only setting it to support multiple forces per frame? - m_forceToApply = direc; - + m_forceToApply = direc; + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); } @@ -2031,7 +2031,7 @@ namespace OpenSim.Region.Framework.Scenes // If the client is inactive, it's getting its updates from another // server. if (remoteClient.IsActive) - { + { m_perfMonMS = Util.EnvironmentTickCount(); PhysicsActor actor = m_physicsActor; @@ -2043,8 +2043,8 @@ namespace OpenSim.Region.Framework.Scenes //m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity); remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, - pos, velocity, Vector3.Zero, m_bodyRot, CollisionPlane, m_uuid, null, GetUpdatePriority(remoteClient))); - + pos, velocity, Vector3.Zero, m_bodyRot, CollisionPlane, m_uuid, null, GetUpdatePriority(remoteClient))); + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); m_scene.StatsReporter.AddAgentUpdates(1); } @@ -2054,11 +2054,11 @@ namespace OpenSim.Region.Framework.Scenes /// Send a location/velocity/accelleration update to all agents in scene /// public void SendTerseUpdateToAllClients() - { + { m_perfMonMS = Util.EnvironmentTickCount(); - m_scene.ForEachClient(SendTerseUpdateToClient); - + m_scene.ForEachClient(SendTerseUpdateToClient); + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); } @@ -2078,7 +2078,7 @@ namespace OpenSim.Region.Framework.Scenes } public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p) - { + { m_perfMonMS = Util.EnvironmentTickCount(); List CoarseLocations = new List(); @@ -2113,8 +2113,8 @@ namespace OpenSim.Region.Framework.Scenes //} } - m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); - + m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); } @@ -2151,7 +2151,7 @@ namespace OpenSim.Region.Framework.Scenes /// Tell *ALL* agents about this agent /// public void SendInitialFullUpdateToAllClients() - { + { m_perfMonMS = Util.EnvironmentTickCount(); ScenePresence[] avatars = m_scene.GetScenePresences(); @@ -2177,14 +2177,14 @@ namespace OpenSim.Region.Framework.Scenes } } - m_scene.StatsReporter.AddAgentUpdates(avatars.Length); + m_scene.StatsReporter.AddAgentUpdates(avatars.Length); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); //Animator.SendAnimPack(); } public void SendFullUpdateToAllClients() - { + { m_perfMonMS = Util.EnvironmentTickCount(); // only send update from root agents to other clients; children are only "listening posts" @@ -2194,7 +2194,7 @@ namespace OpenSim.Region.Framework.Scenes SendFullUpdateToOtherClient(avatar); } - m_scene.StatsReporter.AddAgentUpdates(avatars.Count); + m_scene.StatsReporter.AddAgentUpdates(avatars.Count); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); Animator.SendAnimPack(); @@ -2236,7 +2236,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// public void SendAppearanceToAllOtherAgents() - { + { m_perfMonMS = Util.EnvironmentTickCount(); m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) @@ -2245,8 +2245,8 @@ namespace OpenSim.Region.Framework.Scenes { SendAppearanceToOtherAgent(scenePresence); } - }); - + }); + m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); } @@ -3043,12 +3043,12 @@ namespace OpenSim.Region.Framework.Scenes // I don't get it but mono crashes when you try to dispose of this timer, // unsetting the elapsed callback should be enough to allow for cleanup however. - //m_reprioritizationTimer.Dispose(); + // m_reprioritizationTimer.Dispose(); m_sceneViewer.Close(); - RemoveFromPhysicalScene(); - m_animator.Close(); + RemoveFromPhysicalScene(); + m_animator.Close(); m_animator = null; } -- cgit v1.1 From d4073d9bd51082e5a801dac22e36139819754c3c Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Tue, 1 Dec 2009 10:19:39 -0500 Subject: * Fix Inconsistent line ending style in LLUDPClient --- OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs index 1e5f15a..55d9c9c 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -430,7 +430,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Send the packet m_udpServer.SendPacketFinal(nextPacket); m_nextPackets[i] = null; - packetSent = true; + packetSent = true; this.PacketsSent++; } } -- cgit v1.1 From 4af77e84b1b26d1fb00fd9c7c3b5557cd9f744f3 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Tue, 1 Dec 2009 10:21:22 -0500 Subject: * Fix Inconsistent line ending style in Util --- OpenSim/Framework/Util.cs | 48 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index a459f8d..1112497 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1389,30 +1389,30 @@ namespace OpenSim.Framework return null; } - #endregion FireAndForget Threading Pattern - /// - /// Environment.TickCount is an int but it counts all 32 bits so it goes positive - /// and negative every 24.9 days. This trims down TickCount so it doesn't wrap - /// for the callers. - /// This trims it to a 12 day interval so don't let your frame time get too long. - /// - /// - public static Int32 EnvironmentTickCount() - { - return Environment.TickCount & EnvironmentTickCountMask; - } - const Int32 EnvironmentTickCountMask = 0x3fffffff; - - /// - /// Environment.TickCount is an int but it counts all 32 bits so it goes positive - /// and negative every 24.9 days. Subtracts the passed value (previously fetched by - /// 'EnvironmentTickCount()') and accounts for any wrapping. - /// - /// subtraction of passed prevValue from current Environment.TickCount - public static Int32 EnvironmentTickCountSubtract(Int32 prevValue) - { - Int32 diff = EnvironmentTickCount() - prevValue; - return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1); + #endregion FireAndForget Threading Pattern + /// + /// Environment.TickCount is an int but it counts all 32 bits so it goes positive + /// and negative every 24.9 days. This trims down TickCount so it doesn't wrap + /// for the callers. + /// This trims it to a 12 day interval so don't let your frame time get too long. + /// + /// + public static Int32 EnvironmentTickCount() + { + return Environment.TickCount & EnvironmentTickCountMask; + } + const Int32 EnvironmentTickCountMask = 0x3fffffff; + + /// + /// Environment.TickCount is an int but it counts all 32 bits so it goes positive + /// and negative every 24.9 days. Subtracts the passed value (previously fetched by + /// 'EnvironmentTickCount()') and accounts for any wrapping. + /// + /// subtraction of passed prevValue from current Environment.TickCount + public static Int32 EnvironmentTickCountSubtract(Int32 prevValue) + { + Int32 diff = EnvironmentTickCount() - prevValue; + return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1); } } } -- cgit v1.1 From 56dca3b5a4072b13c92a7f91833289534b1dab05 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Tue, 1 Dec 2009 10:45:36 -0500 Subject: * Fix Inconsistent line ending style on SimStatsReporter --- OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index f92f440..51c5992 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs @@ -240,7 +240,7 @@ namespace OpenSim.Region.Framework.Scenes sb[12].StatID = (uint)Stats.OtherMS; sb[12].StatValue = m_otherMS / statsUpdateFactor; - sb[13].StatID = (uint)Stats.InPacketsPerSecond; + sb[13].StatID = (uint)Stats.InPacketsPerSecond; sb[13].StatValue = (m_inPacketsPerSecond / statsUpdateFactor); sb[14].StatID = (uint)Stats.OutPacketsPerSecond; -- cgit v1.1 From 7a2e8cb05f618bda1925e333b1423dfbeaccd5ed Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Tue, 1 Dec 2009 10:47:18 -0500 Subject: * Fix Inconsistent line ending style on ScenePresenceAnimator --- OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index bbd445d..a459ffa 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -445,9 +445,9 @@ namespace OpenSim.Region.Framework.Scenes.Animation } public void Close() - { - m_animations = null; - m_scenePresence = null; + { + m_animations = null; + m_scenePresence = null; } } } \ No newline at end of file -- cgit v1.1 From 75e28b3a165574e665b364180960c037bab74529 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Tue, 1 Dec 2009 10:48:11 -0500 Subject: * Fix Inconsistent line ending style on Scene --- OpenSim/Region/Framework/Scenes/Scene.cs | 54 ++++++++++++++++---------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a3f3d8f..8788ced 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1159,8 +1159,8 @@ namespace OpenSim.Region.Framework.Scenes while (!shuttingdown) { TimeSpan SinceLastFrame = DateTime.UtcNow - m_lastupdate; - physicsFPS = 0f; - + physicsFPS = 0f; + maintc = Util.EnvironmentTickCount(); int tmpFrameMS = maintc; tempOnRezMS = eventMS = backupMS = terrainMS = landMS = 0; @@ -1189,8 +1189,8 @@ namespace OpenSim.Region.Framework.Scenes physicsMS2 = Util.EnvironmentTickCountSubtract(tmpPhysicsMS2); if (m_frame % m_update_entitymovement == 0) - m_sceneGraph.UpdateScenePresenceMovement(); - + m_sceneGraph.UpdateScenePresenceMovement(); + int tmpPhysicsMS = Util.EnvironmentTickCount(); if (m_frame % m_update_physics == 0) { @@ -1198,49 +1198,49 @@ namespace OpenSim.Region.Framework.Scenes physicsFPS = m_sceneGraph.UpdatePhysics(Math.Max(SinceLastFrame.TotalSeconds, m_timespan)); if (SynchronizeScene != null) SynchronizeScene(this); - } + } physicsMS = Util.EnvironmentTickCountSubtract(tmpPhysicsMS); // Delete temp-on-rez stuff if (m_frame % m_update_backup == 0) - { + { int tmpTempOnRezMS = Util.EnvironmentTickCount(); - CleanTempObjects(); + CleanTempObjects(); tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpTempOnRezMS); } if (RegionStatus != RegionStatus.SlaveScene) { if (m_frame % m_update_events == 0) - { + { int evMS = Util.EnvironmentTickCount(); - UpdateEvents(); + UpdateEvents(); eventMS = Util.EnvironmentTickCountSubtract(evMS); ; } if (m_frame % m_update_backup == 0) - { + { int backMS = Util.EnvironmentTickCount(); - UpdateStorageBackup(); + UpdateStorageBackup(); backupMS = Util.EnvironmentTickCountSubtract(backMS); } if (m_frame % m_update_terrain == 0) - { + { int terMS = Util.EnvironmentTickCount(); - UpdateTerrain(); + UpdateTerrain(); terrainMS = Util.EnvironmentTickCountSubtract(terMS); } if (m_frame % m_update_land == 0) - { + { int ldMS = Util.EnvironmentTickCount(); - UpdateLand(); + UpdateLand(); landMS = Util.EnvironmentTickCountSubtract(ldMS); - } - + } + frameMS = Util.EnvironmentTickCountSubtract(tmpFrameMS); - otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; + otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; lastCompletedFrame = Util.EnvironmentTickCount(); // if (m_frame%m_update_avatars == 0) @@ -1293,8 +1293,8 @@ namespace OpenSim.Region.Framework.Scenes finally { m_lastupdate = DateTime.UtcNow; - } - + } + maintc = Util.EnvironmentTickCountSubtract(maintc); maintc = (int)(m_timespan * 1000) - maintc; @@ -2581,8 +2581,8 @@ namespace OpenSim.Region.Framework.Scenes sp.IsChildAgent = false; Util.FireAndForget(delegate(object o) { sp.RezAttachments(); }); } - } - + } + m_LastLogin = Util.EnvironmentTickCount(); EventManager.TriggerOnNewClient(client); } @@ -4650,15 +4650,15 @@ namespace OpenSim.Region.Framework.Scenes // 3 = We have seen a new user enter within the past 4 minutes // which can be seen as positive confirmation of sim health // - int health=1; // Start at 1, means we're up - + int health=1; // Start at 1, means we're up + if ((Util.EnvironmentTickCountSubtract(m_lastUpdate)) < 1000) health+=1; else return health; // A login in the last 4 mins? We can't be doing too badly - // + // if ((Util.EnvironmentTickCountSubtract(m_LastLogin)) < 240000) health++; else @@ -4855,8 +4855,8 @@ namespace OpenSim.Region.Framework.Scenes private void CheckHeartbeat() { if (m_firstHeartbeat) - return; - + return; + if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 2000) StartTimer(); } -- cgit v1.1 From d2c1610d170eae5a3ed347b96f7ebf2fba7e0949 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Tue, 1 Dec 2009 11:35:32 -0500 Subject: * Test Autoconvert line ending on my repo.. --- OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index 51c5992..e368c2a 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs @@ -75,7 +75,7 @@ namespace OpenSim.Region.Framework.Scenes UnAckedBytes = 24, } - // Sending a stats update every 3 seconds + // Sending a stats update every 3 seconds- private int statsUpdatesEveryMS = 3000; private float statsUpdateFactor = 0; private float m_timeDilation = 0; -- cgit v1.1 From 5ee79c62bfbfd5ee6eaed24e3bc4c284e9b508aa Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 2 Dec 2009 10:21:24 +0000 Subject: Change default destination of deleted items to the trash folder. Everything else still goes to L&F --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 66fb918..09d02f4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1722,10 +1722,19 @@ namespace OpenSim.Region.Framework.Scenes if (folderID == UUID.Zero && folder == null) { - // Catch all. Use lost & found - // + if (action == DeRezAction.Delete) + { + // Deletes go to trash by default + // + folder = InventoryService.GetFolderForType(userID, AssetType.TrashFolder); + } + else + { + // Catch all. Use lost & found + // - folder = InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); + folder = InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); + } } if (folder == null) // None of the above -- cgit v1.1 From 4234c64147cd59c284276a5408702c31860a5928 Mon Sep 17 00:00:00 2001 From: dahlia Date: Wed, 2 Dec 2009 04:10:53 -0800 Subject: handle a condition where the http headers apparently have multiple remote ports designated --- OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs index c53160f..bcfb0a4 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs @@ -188,7 +188,15 @@ namespace OpenSim.Framework.Servers.HttpServer try { IPAddress addr = IPAddress.Parse(req.Headers["remote_addr"]); - int port = Int32.Parse(req.Headers["remote_port"]); + // sometimes req.Headers["remote_port"] returns a comma separated list, so use + // the first one in the list and log it + string[] strPorts = req.Headers["remote_port"].Split(new char[] { ',' }); + if (strPorts.Length > 1) + { + _log.ErrorFormat("[OSHttpRequest]: format exception on addr/port {0}:{1}, ignoring", + req.Headers["remote_addr"], req.Headers["remote_port"]); + } + int port = Int32.Parse(strPorts[0]); _remoteIPEndPoint = new IPEndPoint(addr, port); } catch (FormatException) -- cgit v1.1 From 30fe88b80892e4538dc2b6f71992c3f51d35e95a Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 3 Dec 2009 02:44:12 +1100 Subject: * Terrain uploads via the Estate Tools now support a multitude of file formats. Specifically: . bmp, .raw, .r32 & .r64. (in ascending order of precision) * It uses file length as the detection routine (as each of these formats has a distinct size in bytes for a 256x256 array.) - more formats should be possible to add. --- .../World/Estate/EstateManagementModule.cs | 50 ++++++++++++++-------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index e3a395e..b1dcb14 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -471,20 +471,45 @@ namespace OpenSim.Region.CoreModules.World.Estate if (terr != null) { m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + m_scene.RegionInfo.RegionName); - if (File.Exists(Util.dataDir() + "/terrain.raw")) - { - File.Delete(Util.dataDir() + "/terrain.raw"); - } + try { - FileStream input = new FileStream(Util.dataDir() + "/terrain.raw", FileMode.CreateNew); + + string localfilename = "terrain.raw"; + + if (terrainData.Length == 851968) + { + localfilename = Path.Combine(Util.dataDir(),"terrain.raw"); // It's a .LLRAW + } + + if (terrainData.Length == 196662) // 24-bit 256x256 Bitmap + localfilename = Path.Combine(Util.dataDir(), "terrain.bmp"); + + if (terrainData.Length == 256 * 256 * 4) // It's a .R32 + localfilename = Path.Combine(Util.dataDir(), "terrain.r32"); + + if (terrainData.Length == 256 * 256 * 8) // It's a .R64 + localfilename = Path.Combine(Util.dataDir(), "terrain.r64"); + + if (File.Exists(localfilename)) + { + File.Delete(localfilename); + } + + FileStream input = new FileStream(localfilename, FileMode.CreateNew); input.Write(terrainData, 0, terrainData.Length); input.Close(); + + FileInfo x = new FileInfo(localfilename); + + terr.LoadFromFile(localfilename); + remoteClient.SendAlertMessage("Your terrain was loaded as a ." + x.Extension + " file. It may take a few moments to appear."); + } catch (IOException e) { m_log.ErrorFormat("[TERRAIN]: Error Saving a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString()); - remoteClient.SendAlertMessage("There was an IO Exception loading your terrain. Please check free space"); + remoteClient.SendAlertMessage("There was an IO Exception loading your terrain. Please check free space."); return; } @@ -502,29 +527,16 @@ namespace OpenSim.Region.CoreModules.World.Estate return; } - - - - - try - { - terr.LoadFromFile(Util.dataDir() + "/terrain.raw"); - remoteClient.SendAlertMessage("Your terrain was loaded. Give it a minute or two to apply"); - } catch (Exception e) { m_log.ErrorFormat("[TERRAIN]: Error loading a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString()); remoteClient.SendAlertMessage("There was a general error loading your terrain. Please fix the terrain file and try again"); } - } else { remoteClient.SendAlertMessage("Unable to apply terrain. Cannot get an instance of the terrain module"); } - - - } private void handleUploadTerrain(IClientAPI remote_client, string clientFileName) -- cgit v1.1 From f7b2f0e61e2a8bb397fd4bf97103a4bac8d17b23 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 2 Dec 2009 17:55:56 +0000 Subject: Add position and region of prim items with missing assets in log reports --- .../Framework/Scenes/SceneObjectPartInventory.cs | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 7a0d7b7..22eedba 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -259,8 +259,9 @@ namespace OpenSim.Region.Framework.Scenes { m_log.ErrorFormat( "[PRIM INVENTORY]: " + - "Couldn't start script {0}, {1} since asset ID {2} could not be found", - item.Name, item.ItemID, item.AssetID); + "Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found", + item.Name, item.ItemID, m_part.AbsolutePosition, + m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID); } else { @@ -312,8 +313,9 @@ namespace OpenSim.Region.Framework.Scenes { m_log.ErrorFormat( "[PRIM INVENTORY]: " + - "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2}", - itemId, m_part.Name, m_part.UUID); + "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", + itemId, m_part.Name, m_part.UUID, + m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); } } } @@ -333,8 +335,9 @@ namespace OpenSim.Region.Framework.Scenes { m_log.ErrorFormat( "[PRIM INVENTORY]: " + - "Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2}", - itemId, m_part.Name, m_part.UUID); + "Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", + itemId, m_part.Name, m_part.UUID, + m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); } } @@ -522,8 +525,9 @@ namespace OpenSim.Region.Framework.Scenes { m_log.ErrorFormat( "[PRIM INVENTORY]: " + - "Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory", - item.ItemID, m_part.Name, m_part.UUID); + "Tried to retrieve item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory", + item.ItemID, m_part.Name, m_part.UUID, + m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); } } @@ -579,8 +583,9 @@ namespace OpenSim.Region.Framework.Scenes { m_log.ErrorFormat( "[PRIM INVENTORY]: " + - "Tried to remove item ID {0} from prim {1}, {2} but the item does not exist in this inventory", - itemID, m_part.Name, m_part.UUID); + "Tried to remove item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory", + itemID, m_part.Name, m_part.UUID, + m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); } } -- cgit v1.1 From c58d30616be81df0714ce232de9dcdd955b61011 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 2 Dec 2009 18:53:08 +0000 Subject: Log old position and region information when an orphaned child prim is found --- OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs index c49153f..aecfaa3 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs @@ -479,7 +479,9 @@ namespace OpenSim.Data.MySQL } else { - m_log.Warn("[REGION DB]: Database contains an orphan child prim " + prim.UUID + " pointing to missing parent " + prim.ParentUUID); + m_log.WarnFormat( + "[REGION DB]: Database contains an orphan child prim {0} {1} at {2} in region {3} pointing to missing parent {4}. This prim will not be loaded.", + prim.Name, prim.UUID, prim.AbsolutePosition, regionID, prim.ParentUUID); } } } -- cgit v1.1 From af04cd1ae00c5533df5b6be6333bd58ce13aa1a9 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Thu, 3 Dec 2009 01:50:54 -0500 Subject: * If the position that comes in on Scene.SetHomeRezPoint has a component that is 255.5, replace the component with the user's position in the simulator. * Fixes mantis 4414: http://opensimulator.org/mantis/view.php?id=4414 --- OpenSim/Region/Framework/Scenes/Scene.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 8788ced..08b7115 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3034,6 +3034,25 @@ namespace OpenSim.Region.Framework.Scenes // TODO: The next line can be removed, as soon as only homeRegionID based UserServers are around. // TODO: The HomeRegion property can be removed then, too UserProfile.HomeRegion = RegionInfo.RegionHandle; + + // Linden Client limitation.. + if (position.X == 255.5f || position.Y == 255.5f) + { + ScenePresence avatar = null; + if (TryGetAvatar(remoteClient.AgentId, out avatar)) + { + if (position.X == 255.5f) + { + position.X = avatar.AbsolutePosition.X; + } + if (position.Y == 255.5f) + { + position.Y = avatar.AbsolutePosition.Y; + } + } + + } + UserProfile.HomeLocation = position; UserProfile.HomeLookAt = lookAt; CommsManager.UserService.UpdateUserProfile(UserProfile); -- cgit v1.1 From d9a20edfb0ec916f40a6dc116955f966c86d83c8 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Thu, 3 Dec 2009 02:02:04 -0500 Subject: * Move code from that last commit to LLClientView since it's a linden client specific limitation, it moves to the Linden Specific client handler. --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 18 ++++++++++++++++++ OpenSim/Region/Framework/Scenes/Scene.cs | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index c2aa8e2..ffe6fe9 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -5521,6 +5521,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (avSetStartLocationRequestPacket.AgentData.AgentID == AgentId && avSetStartLocationRequestPacket.AgentData.SessionID == SessionId) { + // Linden Client limitation.. + if (avSetStartLocationRequestPacket.StartLocationData.LocationPos.X == 255.5f + || avSetStartLocationRequestPacket.StartLocationData.LocationPos.Y == 255.5f) + { + ScenePresence avatar = null; + if (((Scene)m_scene).TryGetAvatar(AgentId, out avatar)) + { + if (avSetStartLocationRequestPacket.StartLocationData.LocationPos.X == 255.5f) + { + avSetStartLocationRequestPacket.StartLocationData.LocationPos.X = avatar.AbsolutePosition.X; + } + if (avSetStartLocationRequestPacket.StartLocationData.LocationPos.Y == 255.5f) + { + avSetStartLocationRequestPacket.StartLocationData.LocationPos.Y = avatar.AbsolutePosition.Y; + } + } + + } TeleportLocationRequest handlerSetStartLocationRequest = OnSetStartLocationRequest; if (handlerSetStartLocationRequest != null) { diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 08b7115..a22fb5f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3034,24 +3034,6 @@ namespace OpenSim.Region.Framework.Scenes // TODO: The next line can be removed, as soon as only homeRegionID based UserServers are around. // TODO: The HomeRegion property can be removed then, too UserProfile.HomeRegion = RegionInfo.RegionHandle; - - // Linden Client limitation.. - if (position.X == 255.5f || position.Y == 255.5f) - { - ScenePresence avatar = null; - if (TryGetAvatar(remoteClient.AgentId, out avatar)) - { - if (position.X == 255.5f) - { - position.X = avatar.AbsolutePosition.X; - } - if (position.Y == 255.5f) - { - position.Y = avatar.AbsolutePosition.Y; - } - } - - } UserProfile.HomeLocation = position; UserProfile.HomeLookAt = lookAt; -- cgit v1.1 From 504bfd87d5a769aaea3f7a8469254b6340487442 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 3 Dec 2009 17:57:29 +0000 Subject: if an xml rpc method throws an exception, log as an error to the console as well as returning the exception to the caller --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 14 +++++++++++--- OpenSim/Grid/UserServer.Modules/MessageServersConnector.cs | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index bec5ed3..7de5c4c 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -723,13 +723,21 @@ namespace OpenSim.Framework.Servers.HttpServer xmlRpcResponse = method(xmlRprcRequest, request.RemoteIPEndPoint); } catch(Exception e) - { + { + string errorMessage + = String.Format( + "Requested method [{0}] from {1} threw exception: {2} {3}", + methodName, request.RemoteIPEndPoint.Address, e.Message, e.StackTrace); + + m_log.ErrorFormat("[BASE HTTP SERVER]: {0}", errorMessage); + // if the registered XmlRpc method threw an exception, we pass a fault-code along xmlRpcResponse = new XmlRpcResponse(); + // Code probably set in accordance with http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php - xmlRpcResponse.SetFault(-32603, String.Format("Requested method [{0}] threw exception: {1}", - methodName, e.Message)); + xmlRpcResponse.SetFault(-32603, errorMessage); } + // if the method wasn't found, we can't determine KeepAlive state anyway, so lets do it only here response.KeepAlive = m_rpcHandlersKeepAlive[methodName]; } diff --git a/OpenSim/Grid/UserServer.Modules/MessageServersConnector.cs b/OpenSim/Grid/UserServer.Modules/MessageServersConnector.cs index f24cef6..3384952 100644 --- a/OpenSim/Grid/UserServer.Modules/MessageServersConnector.cs +++ b/OpenSim/Grid/UserServer.Modules/MessageServersConnector.cs @@ -201,6 +201,7 @@ namespace OpenSim.Grid.UserServer.Modules } return response; } + public XmlRpcResponse XmlRPCUserMovedtoRegion(XmlRpcRequest request, IPEndPoint remoteClient) { XmlRpcResponse response = new XmlRpcResponse(); -- cgit v1.1 From 781db43a7665cf0c219889e85eadd7cdc4e8b79b Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Thu, 3 Dec 2009 20:21:10 -0500 Subject: * Fixes the 10x10x10 hard physics limitation. (wierdly, you have to set this for each region in your Regions.ini[PhysicalPrimMax = 10(default)]) * Adds a configurable maximum object mass before the mass is clamped. Default is 10000.01. Configurable by changing maximum_mass_object in the [ODEPhysicsSettings] section. * Clamping the mass is important for limiting the amount of CPU an object can consume in physics calculations. Too high, and the object overcomes restitution forces by gravity alone. This generates more collisions potentially leading to 'deep think'. --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 +++- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 3 +++ OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 2 ++ bin/OpenSim.ini.example | 3 +++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 7359011..6badaf5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2589,7 +2589,9 @@ namespace OpenSim.Region.Framework.Scenes { foreach (SceneObjectPart part in m_parts.Values) { - if (part.Scale.X > 10.0 || part.Scale.Y > 10.0 || part.Scale.Z > 10.0) + if (part.Scale.X > m_scene.RegionInfo.PhysPrimMax || + part.Scale.Y > m_scene.RegionInfo.PhysPrimMax || + part.Scale.Z > m_scene.RegionInfo.PhysPrimMax) { UsePhysics = false; // Reset physics break; diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 9e9c36f..d241574 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -723,6 +723,8 @@ namespace OpenSim.Region.Physics.OdePlugin break; } } + if (returnMass > _parent_scene.maximumMassObject) + returnMass = _parent_scene.maximumMassObject; return returnMass; }// end CalculateMass @@ -733,6 +735,7 @@ namespace OpenSim.Region.Physics.OdePlugin if (Body != (IntPtr) 0) { float newmass = CalculateMass(); + //m_log.Info("[PHYSICS]: New Mass: " + newmass.ToString()); d.MassSetBoxTotal(out pMass, newmass, _size.X, _size.Y, _size.Z); diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index a0aba2a..0384d6e 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -207,6 +207,7 @@ namespace OpenSim.Region.Physics.OdePlugin private float avMovementDivisorWalk = 1.3f; private float avMovementDivisorRun = 0.8f; private float minimumGroundFlightOffset = 3f; + public float maximumMassObject = 10000.01f; public bool meshSculptedPrim = true; public bool forceSimplePrimMeshing = false; @@ -480,6 +481,7 @@ namespace OpenSim.Region.Physics.OdePlugin m_NINJA_physics_joints_enabled = physicsconfig.GetBoolean("use_NINJA_physics_joints", false); minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", 3f); + maximumMassObject = physicsconfig.GetFloat("maximum_mass_object", 10000.01f); } } diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 3accee0..8efbcb4 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -594,6 +594,9 @@ body_motor_joint_maxforce_tensor_linux = 5 body_motor_joint_maxforce_tensor_win = 5 + ; Maximum mass an object can be before it is clamped + maximum_mass_object = 10000.01 + ; ## ; ## Sculpted Prim settings ; ## -- cgit v1.1 From 07786786fcdc93e01286ccd15aaf539d2579a329 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Thu, 3 Dec 2009 20:30:40 -0500 Subject: * Clarifies that the PrimMaxPhys in OpenSim.ini.example does nothing. Tells user to set it in Regions.ini. Melanie might want to take a look at this and see if it should be removed altogether. --- bin/OpenSim.ini.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 8efbcb4..4351b3f 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -91,7 +91,7 @@ ; Maximum total size, and maximum size where a prim can be physical NonPhysicalPrimMax = 256 - PhysicalPrimMax = 10 + PhysicalPrimMax = 10 ; (I think this was moved to the Regions.ini!) ClampPrimSize = false ; Region crossing -- cgit v1.1 From c0f3a4c8332f235e998714214011c5412bdcacf0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 4 Dec 2009 18:26:58 +0000 Subject: Allow terrain heightmaps to be loaded directly from URIs via the remote admin plugin See http://opensimulator.org/mantis/view.php?id=4418 Thanks StrawberryFride See --- .../RemoteController/RemoteAdminPlugin.cs | 17 ++++++++++-- .../CoreModules/World/Terrain/TerrainModule.cs | 32 +++++++++++++++++++++- .../Region/Framework/Interfaces/ITerrainModule.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 6 ++++ 4 files changed, 53 insertions(+), 4 deletions(-) diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 3149eaa..adf7967 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -315,8 +315,21 @@ namespace OpenSim.ApplicationPlugins.RemoteController ITerrainModule terrainModule = region.RequestModuleInterface(); if (null == terrainModule) throw new Exception("terrain module not available"); - terrainModule.LoadFromFile(file); - + if (Uri.IsWellFormedUriString(file, UriKind.Absolute)) + { + m_log.Info("[RADMIN]: Terrain path is URL"); + Uri result; + if (Uri.TryCreate(file, UriKind.RelativeOrAbsolute, out result)) + { + // the url is valid + string fileType = file.Substring(file.LastIndexOf('/') + 1); + terrainModule.LoadFromStream(fileType, result); + } + } + else + { + terrainModule.LoadFromFile(file); + } responseData["success"] = false; response.Value = responseData; diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index ba271fd..a40828b 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Reflection; +using System.Net; using log4net; using Nini.Config; using OpenMetaverse; @@ -259,6 +260,16 @@ namespace OpenSim.Region.CoreModules.World.Terrain } /// + /// Loads a terrain file from the specified URI + /// + /// The name of the terrain to load + /// The URI to the terrain height map + public void LoadFromStream(string filename, Uri pathToTerrainHeightmap) + { + LoadFromStream(filename, URIFetch(pathToTerrainHeightmap)); + } + + /// /// Loads a terrain file from a stream and installs it in the scene. /// /// Filename to terrain file. Type is determined by extension. @@ -267,7 +278,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain { foreach (KeyValuePair loader in m_loaders) { - if (@filename.EndsWith(loader.Key)) + if (filename.EndsWith(loader.Key)) { lock (m_scene) { @@ -295,6 +306,25 @@ namespace OpenSim.Region.CoreModules.World.Terrain throw new TerrainException(String.Format("unable to load heightmap from file {0}: no loader available for that format", filename)); } + private static Stream URIFetch(Uri uri) + { + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); + + // request.Credentials = credentials; + + request.ContentLength = 0; + request.KeepAlive = false; + + WebResponse response = request.GetResponse(); + Stream file = response.GetResponseStream(); + + if (response.ContentLength == 0) + throw new Exception(String.Format("{0} returned an empty file", uri.ToString())); + + // return new BufferedStream(file, (int) response.ContentLength); + return new BufferedStream(file, 1000000); + } + /// /// Modify Land /// diff --git a/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs b/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs index 2dcba0c..7caac55 100644 --- a/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs @@ -51,7 +51,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// void LoadFromStream(string filename, Stream stream); - + void LoadFromStream(string filename, System.Uri pathToTerrainHeightmap); /// /// Save a terrain to a stream. /// diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 09d02f4..0b0c205 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -2393,6 +2393,12 @@ namespace OpenSim.Region.Framework.Scenes InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); item = InventoryService.GetItem(item); presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); + + if (m_AvatarFactory != null) + { + m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); + } + } } -- cgit v1.1 From c4b6010fb34268c9426f7241a38ba892b93780d1 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 5 Dec 2009 13:01:21 -0500 Subject: * Fixes mantis 4416. Animator is dereferenced on logout --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 +++-- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b2cd249..a3ceecb 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2932,14 +2932,15 @@ namespace OpenSim.Region.Framework.Scenes //if ((Math.Abs(Velocity.X) > 0.1e-9f) || (Math.Abs(Velocity.Y) > 0.1e-9f)) // The Physics Scene will send updates every 500 ms grep: m_physicsActor.SubscribeEvents( // as of this comment the interval is set in AddToPhysicalScene - Animator.UpdateMovementAnimations(); + if (Animator!=null) + Animator.UpdateMovementAnimations(); CollisionEventUpdate collisionData = (CollisionEventUpdate)e; Dictionary coldata = collisionData.m_objCollisionList; CollisionPlane = Vector4.UnitW; - if (coldata.Count != 0) + if (coldata.Count != 0 && Animator != null) { switch (Animator.CurrentMovementAnimation) { diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 1bc4a25..40fbde1 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -1221,7 +1221,10 @@ namespace OpenSim.Region.Physics.OdePlugin { if (m_eventsubscription > m_requestedUpdateFrequency) { - base.SendCollisionUpdate(CollisionEventsThisFrame); + if (CollisionEventsThisFrame != null) + { + base.SendCollisionUpdate(CollisionEventsThisFrame); + } CollisionEventsThisFrame = new CollisionEventUpdate(); m_eventsubscription = 0; } -- cgit v1.1 From 8e089b6d8d0d5b20cce6c812d987f77bc3957435 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 5 Dec 2009 13:23:05 -0500 Subject: * Fix line endings in BaseHttpServer.cs --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 7de5c4c..75cdeb4 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -723,12 +723,12 @@ namespace OpenSim.Framework.Servers.HttpServer xmlRpcResponse = method(xmlRprcRequest, request.RemoteIPEndPoint); } catch(Exception e) - { - string errorMessage - = String.Format( - "Requested method [{0}] from {1} threw exception: {2} {3}", - methodName, request.RemoteIPEndPoint.Address, e.Message, e.StackTrace); - + { + string errorMessage + = String.Format( + "Requested method [{0}] from {1} threw exception: {2} {3}", + methodName, request.RemoteIPEndPoint.Address, e.Message, e.StackTrace); + m_log.ErrorFormat("[BASE HTTP SERVER]: {0}", errorMessage); // if the registered XmlRpc method threw an exception, we pass a fault-code along -- cgit v1.1 From 129de260329791529904c02c3515d40879d7d214 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 5 Dec 2009 23:25:30 +0000 Subject: Cause better packing of ObjectProperties --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 106 +++++++++++++++------ 1 file changed, 79 insertions(+), 27 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index e812945..71f9b90 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -352,6 +352,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP private IHyperAssetService m_hyperAssets; private const bool m_checkPackets = true; + private Timer m_propertiesPacketTimer; + private List m_propertiesBlocks = new List(); + #endregion Class Members #region Properties @@ -433,6 +436,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_udpClient.OnQueueEmpty += HandleQueueEmpty; m_udpClient.OnPacketStats += PopulateStats; + m_propertiesPacketTimer = new Timer(100); + m_propertiesPacketTimer.Elapsed += ProcessObjectPropertiesPacket; + RegisterLocalPacketHandlers(); } @@ -3562,42 +3568,88 @@ namespace OpenSim.Region.ClientStack.LindenUDP string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask, uint BaseMask, byte saleType, int salePrice) { - ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); + //ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); // TODO: don't create new blocks if recycling an old packet - proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1]; - proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock(); - proper.ObjectData[0].ItemID = ItemID; - proper.ObjectData[0].CreationDate = CreationDate; - proper.ObjectData[0].CreatorID = CreatorUUID; - proper.ObjectData[0].FolderID = FolderUUID; - proper.ObjectData[0].FromTaskID = FromTaskUUID; - proper.ObjectData[0].GroupID = GroupUUID; - proper.ObjectData[0].InventorySerial = InventorySerial; - - proper.ObjectData[0].LastOwnerID = LastOwnerUUID; + ObjectPropertiesPacket.ObjectDataBlock block = + new ObjectPropertiesPacket.ObjectDataBlock(); + + block.ItemID = ItemID; + block.CreationDate = CreationDate; + block.CreatorID = CreatorUUID; + block.FolderID = FolderUUID; + block.FromTaskID = FromTaskUUID; + block.GroupID = GroupUUID; + block.InventorySerial = InventorySerial; + + block.LastOwnerID = LastOwnerUUID; // proper.ObjectData[0].LastOwnerID = UUID.Zero; - proper.ObjectData[0].ObjectID = ObjectUUID; + block.ObjectID = ObjectUUID; if (OwnerUUID == GroupUUID) - proper.ObjectData[0].OwnerID = UUID.Zero; + block.OwnerID = UUID.Zero; else - proper.ObjectData[0].OwnerID = OwnerUUID; - proper.ObjectData[0].TouchName = Util.StringToBytes256(TouchTitle); - proper.ObjectData[0].TextureID = TextureID; - proper.ObjectData[0].SitName = Util.StringToBytes256(SitTitle); - proper.ObjectData[0].Name = Util.StringToBytes256(ItemName); - proper.ObjectData[0].Description = Util.StringToBytes256(ItemDescription); - proper.ObjectData[0].OwnerMask = OwnerMask; - proper.ObjectData[0].NextOwnerMask = NextOwnerMask; - proper.ObjectData[0].GroupMask = GroupMask; - proper.ObjectData[0].EveryoneMask = EveryoneMask; - proper.ObjectData[0].BaseMask = BaseMask; + block.OwnerID = OwnerUUID; + block.TouchName = Util.StringToBytes256(TouchTitle); + block.TextureID = TextureID; + block.SitName = Util.StringToBytes256(SitTitle); + block.Name = Util.StringToBytes256(ItemName); + block.Description = Util.StringToBytes256(ItemDescription); + block.OwnerMask = OwnerMask; + block.NextOwnerMask = NextOwnerMask; + block.GroupMask = GroupMask; + block.EveryoneMask = EveryoneMask; + block.BaseMask = BaseMask; // proper.ObjectData[0].AggregatePerms = 53; // proper.ObjectData[0].AggregatePermTextures = 0; // proper.ObjectData[0].AggregatePermTexturesOwner = 0; - proper.ObjectData[0].SaleType = saleType; - proper.ObjectData[0].SalePrice = salePrice; + block.SaleType = saleType; + block.SalePrice = salePrice; + + lock (m_propertiesPacketTimer) + { + m_propertiesBlocks.Add(block); + + int length = 0; + foreach (ObjectPropertiesPacket.ObjectDataBlock b in m_propertiesBlocks) + { + length += b.Length; + } + if (length > 1100) // FIXME: use real MTU + { + ProcessObjectPropertiesPacket(null, null); + m_propertiesPacketTimer.Stop(); + return; + } + + m_propertiesPacketTimer.Stop(); + m_propertiesPacketTimer.Start(); + } + + //proper.Header.Zerocoded = true; + //OutPacket(proper, ThrottleOutPacketType.Task); + } + + private void ProcessObjectPropertiesPacket(Object sender, ElapsedEventArgs e) + { + ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); + + lock (m_propertiesPacketTimer) + { + m_propertiesPacketTimer.Stop(); + + proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count]; + + int index = 0; + + foreach (ObjectPropertiesPacket.ObjectDataBlock b in m_propertiesBlocks) + { + proper.ObjectData[index++] = b; + } + + m_propertiesBlocks.Clear(); + } + proper.Header.Zerocoded = true; OutPacket(proper, ThrottleOutPacketType.Task); } -- cgit v1.1 From ceccfe02d0e25c234560b6ef25306b8db4cd9875 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 00:02:24 +0000 Subject: Eliminate multiple updates on link/unlink --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 ++ OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 ++++---- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 ++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 2fdb48d..d87e814 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1593,6 +1593,8 @@ namespace OpenSim.Region.Framework.Scenes // occur on link to invoke this elsewhere (such as object selection) parentGroup.RootPart.AddFlag(PrimFlags.CreateSelected); parentGroup.TriggerScriptChangedEvent(Changed.LINK); + parentGroup.HasGroupChanged = true; + parentGroup.ScheduleGroupForFullUpdate(); if (client != null) { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index ecda80c..fa2e3ce 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2389,8 +2389,8 @@ namespace OpenSim.Region.Framework.Scenes // unmoved prims! ResetChildPrimPhysicsPositions(); - HasGroupChanged = true; - ScheduleGroupForFullUpdate(); + //HasGroupChanged = true; + //ScheduleGroupForFullUpdate(); } /// @@ -2483,8 +2483,8 @@ namespace OpenSim.Region.Framework.Scenes linkPart.Rezzed = RootPart.Rezzed; - HasGroupChanged = true; - ScheduleGroupForFullUpdate(); + //HasGroupChanged = true; + //ScheduleGroupForFullUpdate(); } /// diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 267928b..e694f15 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3588,6 +3588,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { parentPrim.DelinkFromGroup(part.LocalId, true); } + parentPrim.HasGroupChanged = true; + parentPrim.ScheduleGroupForFullUpdate(); parentPrim.TriggerScriptChangedEvent(Changed.LINK); if (parts.Count > 0) @@ -3599,6 +3601,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api part.UpdateFlag = 0; newRoot.ParentGroup.LinkToGroup(part.ParentGroup); } + newRoot.ParentGroup.HasGroupChanged = true; + newRoot.ParentGroup.ScheduleGroupForFullUpdate(); } } else @@ -3607,6 +3611,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; parentPrim.DelinkFromGroup(childPrim.LocalId, true); + parentPrim.HasGroupChanged = true; + parentPrim.ScheduleGroupForFullUpdate(); parentPrim.TriggerScriptChangedEvent(Changed.LINK); } } @@ -3626,6 +3632,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api parentPrim.DelinkFromGroup(part.LocalId, true); parentPrim.TriggerScriptChangedEvent(Changed.LINK); } + parentPrim.HasGroupChanged = true; + parentPrim.ScheduleGroupForFullUpdate(); } public LSL_String llGetLinkKey(int linknum) -- cgit v1.1 From fbefa8273be70d90404b37230c168fd031288e31 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 00:25:04 +0000 Subject: Lock updates out while linking and unlinking --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 255 ++++++++++++++------------ 1 file changed, 134 insertions(+), 121 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index d87e814..5efe188 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -26,6 +26,7 @@ */ using System; +using System.Threading; using System.Collections.Generic; using System.Reflection; using OpenMetaverse; @@ -96,6 +97,8 @@ namespace OpenSim.Region.Framework.Scenes protected internal Dictionary SceneObjectGroupsByFullID = new Dictionary(); private readonly Object m_dictionary_lock = new Object(); + private Object m_updateLock = new Object(); + #endregion protected internal SceneGraph(Scene parent, RegionInfo regInfo) @@ -369,6 +372,9 @@ namespace OpenSim.Region.Framework.Scenes /// protected internal void UpdateObjectGroups() { + if (!Monitor.TryEnter(m_updateLock)) + return; + List updates; // Some updates add more updates to the updateList. @@ -395,6 +401,7 @@ namespace OpenSim.Region.Framework.Scenes "[INNER SCENE]: Failed to update {0}, {1} - {2}", sog.Name, sog.UUID, e); } } + Monitor.Exit(m_updateLock); } protected internal void AddPhysicalPrim(int number) @@ -1555,56 +1562,59 @@ namespace OpenSim.Region.Framework.Scenes /// protected internal void LinkObjects(IClientAPI client, uint parentPrimId, List childPrimIds) { - SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId); - - List childGroups = new List(); - if (parentGroup != null) + lock (m_updateLock) { - // We do this in reverse to get the link order of the prims correct - for (int i = childPrimIds.Count - 1; i >= 0; i--) + SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId); + + List childGroups = new List(); + if (parentGroup != null) { - SceneObjectGroup child = GetGroupByPrim(childPrimIds[i]); - if (child != null) + // We do this in reverse to get the link order of the prims correct + for (int i = childPrimIds.Count - 1; i >= 0; i--) { - // Make sure no child prim is set for sale - // So that, on delink, no prims are unwittingly - // left for sale and sold off - child.RootPart.ObjectSaleType = 0; - child.RootPart.SalePrice = 10; - childGroups.Add(child); + SceneObjectGroup child = GetGroupByPrim(childPrimIds[i]); + if (child != null) + { + // Make sure no child prim is set for sale + // So that, on delink, no prims are unwittingly + // left for sale and sold off + child.RootPart.ObjectSaleType = 0; + child.RootPart.SalePrice = 10; + childGroups.Add(child); + } } } - } - else - { - return; // parent is null so not in this region - } + else + { + return; // parent is null so not in this region + } - foreach (SceneObjectGroup child in childGroups) - { - parentGroup.LinkToGroup(child); + foreach (SceneObjectGroup child in childGroups) + { + parentGroup.LinkToGroup(child); - // this is here so physics gets updated! - // Don't remove! Bad juju! Stay away! or fix physics! - child.AbsolutePosition = child.AbsolutePosition; - } + // this is here so physics gets updated! + // Don't remove! Bad juju! Stay away! or fix physics! + child.AbsolutePosition = child.AbsolutePosition; + } - // We need to explicitly resend the newly link prim's object properties since no other actions - // occur on link to invoke this elsewhere (such as object selection) - parentGroup.RootPart.AddFlag(PrimFlags.CreateSelected); - parentGroup.TriggerScriptChangedEvent(Changed.LINK); - parentGroup.HasGroupChanged = true; - parentGroup.ScheduleGroupForFullUpdate(); - - if (client != null) - { - parentGroup.GetProperties(client); - } - else - { - foreach (ScenePresence p in GetScenePresences()) + // We need to explicitly resend the newly link prim's object properties since no other actions + // occur on link to invoke this elsewhere (such as object selection) + parentGroup.RootPart.AddFlag(PrimFlags.CreateSelected); + parentGroup.TriggerScriptChangedEvent(Changed.LINK); + parentGroup.HasGroupChanged = true; + parentGroup.ScheduleGroupForFullUpdate(); + + if (client != null) { - parentGroup.GetProperties(p.ControllingClient); + parentGroup.GetProperties(client); + } + else + { + foreach (ScenePresence p in GetScenePresences()) + { + parentGroup.GetProperties(p.ControllingClient); + } } } } @@ -1620,109 +1630,112 @@ namespace OpenSim.Region.Framework.Scenes protected internal void DelinkObjects(List primIds, bool sendEvents) { - List childParts = new List(); - List rootParts = new List(); - List affectedGroups = new List(); - // Look them all up in one go, since that is comparatively expensive - // - foreach (uint primID in primIds) + lock (m_updateLock) { - SceneObjectPart part = m_parentScene.GetSceneObjectPart(primID); - if (part != null) + List childParts = new List(); + List rootParts = new List(); + List affectedGroups = new List(); + // Look them all up in one go, since that is comparatively expensive + // + foreach (uint primID in primIds) { - if (part.LinkNum < 2) // Root or single - rootParts.Add(part); + SceneObjectPart part = m_parentScene.GetSceneObjectPart(primID); + if (part != null) + { + if (part.LinkNum < 2) // Root or single + rootParts.Add(part); + else + childParts.Add(part); + + SceneObjectGroup group = part.ParentGroup; + if (!affectedGroups.Contains(group)) + affectedGroups.Add(group); + } else - childParts.Add(part); - - SceneObjectGroup group = part.ParentGroup; - if (!affectedGroups.Contains(group)) - affectedGroups.Add(group); + { + m_log.ErrorFormat("Viewer requested unlink of nonexistent part {0}", primID); + } } - else + + foreach (SceneObjectPart child in childParts) { - m_log.ErrorFormat("Viewer requested unlink of nonexistent part {0}", primID); + // Unlink all child parts from their groups + // + child.ParentGroup.DelinkFromGroup(child, sendEvents); } - } - foreach (SceneObjectPart child in childParts) - { - // Unlink all child parts from their groups - // - child.ParentGroup.DelinkFromGroup(child, sendEvents); - } - - foreach (SceneObjectPart root in rootParts) - { - // In most cases, this will run only one time, and the prim - // will be a solo prim - // However, editing linked parts and unlinking may be different - // - SceneObjectGroup group = root.ParentGroup; - List newSet = new List(group.Children.Values); - int numChildren = group.Children.Count; - - // If there are prims left in a link set, but the root is - // slated for unlink, we need to do this - // - if (numChildren != 1) + foreach (SceneObjectPart root in rootParts) { - // Unlink the remaining set + // In most cases, this will run only one time, and the prim + // will be a solo prim + // However, editing linked parts and unlinking may be different // - bool sendEventsToRemainder = true; - if (numChildren > 1) - sendEventsToRemainder = false; - - foreach (SceneObjectPart p in newSet) - { - if (p != group.RootPart) - group.DelinkFromGroup(p, sendEventsToRemainder); - } + SceneObjectGroup group = root.ParentGroup; + List newSet = new List(group.Children.Values); + int numChildren = group.Children.Count; - // If there is more than one prim remaining, we - // need to re-link + // If there are prims left in a link set, but the root is + // slated for unlink, we need to do this // - if (numChildren > 2) + if (numChildren != 1) { - // Remove old root + // Unlink the remaining set // - if (newSet.Contains(root)) - newSet.Remove(root); + bool sendEventsToRemainder = true; + if (numChildren > 1) + sendEventsToRemainder = false; - // Preserve link ordering - // - newSet.Sort(delegate (SceneObjectPart a, SceneObjectPart b) + foreach (SceneObjectPart p in newSet) { - return a.LinkNum.CompareTo(b.LinkNum); - }); + if (p != group.RootPart) + group.DelinkFromGroup(p, sendEventsToRemainder); + } - // Determine new root + // If there is more than one prim remaining, we + // need to re-link // - SceneObjectPart newRoot = newSet[0]; - newSet.RemoveAt(0); + if (numChildren > 2) + { + // Remove old root + // + if (newSet.Contains(root)) + newSet.Remove(root); + + // Preserve link ordering + // + newSet.Sort(delegate (SceneObjectPart a, SceneObjectPart b) + { + return a.LinkNum.CompareTo(b.LinkNum); + }); - List linkIDs = new List(); + // Determine new root + // + SceneObjectPart newRoot = newSet[0]; + newSet.RemoveAt(0); - foreach (SceneObjectPart newChild in newSet) - { - newChild.UpdateFlag = 0; - linkIDs.Add(newChild.LocalId); - } + List linkIDs = new List(); + + foreach (SceneObjectPart newChild in newSet) + { + newChild.UpdateFlag = 0; + linkIDs.Add(newChild.LocalId); + } - LinkObjects(null, newRoot.LocalId, linkIDs); - if (!affectedGroups.Contains(newRoot.ParentGroup)) - affectedGroups.Add(newRoot.ParentGroup); + LinkObjects(null, newRoot.LocalId, linkIDs); + if (!affectedGroups.Contains(newRoot.ParentGroup)) + affectedGroups.Add(newRoot.ParentGroup); + } } } - } - // Finally, trigger events in the roots - // - foreach (SceneObjectGroup g in affectedGroups) - { - g.TriggerScriptChangedEvent(Changed.LINK); - g.HasGroupChanged = true; // Persist - g.ScheduleGroupForFullUpdate(); + // Finally, trigger events in the roots + // + foreach (SceneObjectGroup g in affectedGroups) + { + g.TriggerScriptChangedEvent(Changed.LINK); + g.HasGroupChanged = true; // Persist + g.ScheduleGroupForFullUpdate(); + } } } -- cgit v1.1 From f2891e77383f70d807f4ef1ceefbf9a0f2bf6a84 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 00:50:28 +0000 Subject: Remove extra forced updates. They're not needed for each prim. Really. --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index fa2e3ce..93888f1 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2292,14 +2292,14 @@ namespace OpenSim.Region.Framework.Scenes public void LinkToGroup(SceneObjectGroup objectGroup) { // Make sure we have sent any pending unlinks or stuff. - if (objectGroup.RootPart.UpdateFlag > 0) - { - m_log.WarnFormat( - "[SCENE OBJECT GROUP]: Forcing send of linkset {0}, {1} to {2}, {3} as its still waiting.", - objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); + //if (objectGroup.RootPart.UpdateFlag > 0) + //{ + // m_log.WarnFormat( + // "[SCENE OBJECT GROUP]: Forcing send of linkset {0}, {1} to {2}, {3} as its still waiting.", + // objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); - objectGroup.RootPart.SendScheduledUpdates(); - } + // objectGroup.RootPart.SendScheduledUpdates(); + //} // m_log.DebugFormat( // "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}", -- cgit v1.1 From da414fd509a6adfa0499b71172e1c789b3cf7ca4 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 01:20:39 +0000 Subject: Change locking to not mix explicit Monitor.* calls with lock() --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 5efe188..4bdc52c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1562,7 +1562,8 @@ namespace OpenSim.Region.Framework.Scenes /// protected internal void LinkObjects(IClientAPI client, uint parentPrimId, List childPrimIds) { - lock (m_updateLock) + Monitor.Enter(m_updateLock); + try { SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId); @@ -1617,6 +1618,10 @@ namespace OpenSim.Region.Framework.Scenes } } } + finally + { + Monitor.Exit(m_updateLock); + } } /// @@ -1630,7 +1635,8 @@ namespace OpenSim.Region.Framework.Scenes protected internal void DelinkObjects(List primIds, bool sendEvents) { - lock (m_updateLock) + Monitor.Enter(m_updateLock); + try { List childParts = new List(); List rootParts = new List(); @@ -1737,6 +1743,10 @@ namespace OpenSim.Region.Framework.Scenes g.ScheduleGroupForFullUpdate(); } } + finally + { + Monitor.Exit(m_updateLock); + } } protected internal void MakeObjectSearchable(IClientAPI remoteClient, bool IncludeInSearch, uint localID) -- cgit v1.1 From 2fe75a62bec2f06155bf5f05b6f558d028f6b12c Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 02:00:32 +0000 Subject: Skip single prims in unlink selections --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 4bdc52c..18e7b79 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1648,14 +1648,17 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart part = m_parentScene.GetSceneObjectPart(primID); if (part != null) { - if (part.LinkNum < 2) // Root or single - rootParts.Add(part); - else - childParts.Add(part); - - SceneObjectGroup group = part.ParentGroup; - if (!affectedGroups.Contains(group)) - affectedGroups.Add(group); + if (part.ParentGroup.Children.Count != 1) // Skip single + { + if (part.LinkNum < 2) // Root + rootParts.Add(part); + else + childParts.Add(part); + + SceneObjectGroup group = part.ParentGroup; + if (!affectedGroups.Contains(group)) + affectedGroups.Add(group); + } } else { -- cgit v1.1 From 79511ecce240a864dc02575acd3399fb244a8d82 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 02:15:52 +0000 Subject: Experimental: Remove explicit property sends --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 18e7b79..f74fd5d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1606,17 +1606,17 @@ namespace OpenSim.Region.Framework.Scenes parentGroup.HasGroupChanged = true; parentGroup.ScheduleGroupForFullUpdate(); - if (client != null) - { - parentGroup.GetProperties(client); - } - else - { - foreach (ScenePresence p in GetScenePresences()) - { - parentGroup.GetProperties(p.ControllingClient); - } - } +// if (client != null) +// { +// parentGroup.GetProperties(client); +// } +// else +// { +// foreach (ScenePresence p in GetScenePresences()) +// { +// parentGroup.GetProperties(p.ControllingClient); +// } +// } } finally { -- cgit v1.1 From f8cc409034528f645628bd022aba9657545637f8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 5 Dec 2009 23:25:30 +0000 Subject: Cause better packing of ObjectProperties --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 106 +++++++++++++++------ 1 file changed, 79 insertions(+), 27 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index ffe6fe9..fba5090 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -352,6 +352,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP private IHyperAssetService m_hyperAssets; private const bool m_checkPackets = true; + private Timer m_propertiesPacketTimer; + private List m_propertiesBlocks = new List(); + #endregion Class Members #region Properties @@ -433,6 +436,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_udpClient.OnQueueEmpty += HandleQueueEmpty; m_udpClient.OnPacketStats += PopulateStats; + m_propertiesPacketTimer = new Timer(100); + m_propertiesPacketTimer.Elapsed += ProcessObjectPropertiesPacket; + RegisterLocalPacketHandlers(); } @@ -3579,42 +3585,88 @@ namespace OpenSim.Region.ClientStack.LindenUDP string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask, uint BaseMask, byte saleType, int salePrice) { - ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); + //ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); // TODO: don't create new blocks if recycling an old packet - proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1]; - proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock(); - proper.ObjectData[0].ItemID = ItemID; - proper.ObjectData[0].CreationDate = CreationDate; - proper.ObjectData[0].CreatorID = CreatorUUID; - proper.ObjectData[0].FolderID = FolderUUID; - proper.ObjectData[0].FromTaskID = FromTaskUUID; - proper.ObjectData[0].GroupID = GroupUUID; - proper.ObjectData[0].InventorySerial = InventorySerial; - - proper.ObjectData[0].LastOwnerID = LastOwnerUUID; + ObjectPropertiesPacket.ObjectDataBlock block = + new ObjectPropertiesPacket.ObjectDataBlock(); + + block.ItemID = ItemID; + block.CreationDate = CreationDate; + block.CreatorID = CreatorUUID; + block.FolderID = FolderUUID; + block.FromTaskID = FromTaskUUID; + block.GroupID = GroupUUID; + block.InventorySerial = InventorySerial; + + block.LastOwnerID = LastOwnerUUID; // proper.ObjectData[0].LastOwnerID = UUID.Zero; - proper.ObjectData[0].ObjectID = ObjectUUID; + block.ObjectID = ObjectUUID; if (OwnerUUID == GroupUUID) - proper.ObjectData[0].OwnerID = UUID.Zero; + block.OwnerID = UUID.Zero; else - proper.ObjectData[0].OwnerID = OwnerUUID; - proper.ObjectData[0].TouchName = Util.StringToBytes256(TouchTitle); - proper.ObjectData[0].TextureID = TextureID; - proper.ObjectData[0].SitName = Util.StringToBytes256(SitTitle); - proper.ObjectData[0].Name = Util.StringToBytes256(ItemName); - proper.ObjectData[0].Description = Util.StringToBytes256(ItemDescription); - proper.ObjectData[0].OwnerMask = OwnerMask; - proper.ObjectData[0].NextOwnerMask = NextOwnerMask; - proper.ObjectData[0].GroupMask = GroupMask; - proper.ObjectData[0].EveryoneMask = EveryoneMask; - proper.ObjectData[0].BaseMask = BaseMask; + block.OwnerID = OwnerUUID; + block.TouchName = Util.StringToBytes256(TouchTitle); + block.TextureID = TextureID; + block.SitName = Util.StringToBytes256(SitTitle); + block.Name = Util.StringToBytes256(ItemName); + block.Description = Util.StringToBytes256(ItemDescription); + block.OwnerMask = OwnerMask; + block.NextOwnerMask = NextOwnerMask; + block.GroupMask = GroupMask; + block.EveryoneMask = EveryoneMask; + block.BaseMask = BaseMask; // proper.ObjectData[0].AggregatePerms = 53; // proper.ObjectData[0].AggregatePermTextures = 0; // proper.ObjectData[0].AggregatePermTexturesOwner = 0; - proper.ObjectData[0].SaleType = saleType; - proper.ObjectData[0].SalePrice = salePrice; + block.SaleType = saleType; + block.SalePrice = salePrice; + + lock (m_propertiesPacketTimer) + { + m_propertiesBlocks.Add(block); + + int length = 0; + foreach (ObjectPropertiesPacket.ObjectDataBlock b in m_propertiesBlocks) + { + length += b.Length; + } + if (length > 1100) // FIXME: use real MTU + { + ProcessObjectPropertiesPacket(null, null); + m_propertiesPacketTimer.Stop(); + return; + } + + m_propertiesPacketTimer.Stop(); + m_propertiesPacketTimer.Start(); + } + + //proper.Header.Zerocoded = true; + //OutPacket(proper, ThrottleOutPacketType.Task); + } + + private void ProcessObjectPropertiesPacket(Object sender, ElapsedEventArgs e) + { + ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); + + lock (m_propertiesPacketTimer) + { + m_propertiesPacketTimer.Stop(); + + proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count]; + + int index = 0; + + foreach (ObjectPropertiesPacket.ObjectDataBlock b in m_propertiesBlocks) + { + proper.ObjectData[index++] = b; + } + + m_propertiesBlocks.Clear(); + } + proper.Header.Zerocoded = true; OutPacket(proper, ThrottleOutPacketType.Task); } -- cgit v1.1 From e3a22ff37da47405d2ad2a656970f501e1a7673c Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 00:02:24 +0000 Subject: Eliminate multiple updates on link/unlink --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 ++ OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 ++++---- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 ++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 2fdb48d..d87e814 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1593,6 +1593,8 @@ namespace OpenSim.Region.Framework.Scenes // occur on link to invoke this elsewhere (such as object selection) parentGroup.RootPart.AddFlag(PrimFlags.CreateSelected); parentGroup.TriggerScriptChangedEvent(Changed.LINK); + parentGroup.HasGroupChanged = true; + parentGroup.ScheduleGroupForFullUpdate(); if (client != null) { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 6badaf5..6170caa 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2207,8 +2207,8 @@ namespace OpenSim.Region.Framework.Scenes // unmoved prims! ResetChildPrimPhysicsPositions(); - HasGroupChanged = true; - ScheduleGroupForFullUpdate(); + //HasGroupChanged = true; + //ScheduleGroupForFullUpdate(); } /// @@ -2299,8 +2299,8 @@ namespace OpenSim.Region.Framework.Scenes linkPart.Rezzed = RootPart.Rezzed; - HasGroupChanged = true; - ScheduleGroupForFullUpdate(); + //HasGroupChanged = true; + //ScheduleGroupForFullUpdate(); } /// diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index d235bac..9a905f1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3523,6 +3523,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { parentPrim.DelinkFromGroup(part.LocalId, true); } + parentPrim.HasGroupChanged = true; + parentPrim.ScheduleGroupForFullUpdate(); parentPrim.TriggerScriptChangedEvent(Changed.LINK); if (parts.Count > 0) @@ -3534,6 +3536,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api part.UpdateFlag = 0; newRoot.ParentGroup.LinkToGroup(part.ParentGroup); } + newRoot.ParentGroup.HasGroupChanged = true; + newRoot.ParentGroup.ScheduleGroupForFullUpdate(); } } else @@ -3542,6 +3546,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; parentPrim.DelinkFromGroup(childPrim.LocalId, true); + parentPrim.HasGroupChanged = true; + parentPrim.ScheduleGroupForFullUpdate(); parentPrim.TriggerScriptChangedEvent(Changed.LINK); } } @@ -3561,6 +3567,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api parentPrim.DelinkFromGroup(part.LocalId, true); parentPrim.TriggerScriptChangedEvent(Changed.LINK); } + parentPrim.HasGroupChanged = true; + parentPrim.ScheduleGroupForFullUpdate(); } public LSL_String llGetLinkKey(int linknum) -- cgit v1.1 From 46d5add175b2c4281780c839283616fbe5394b67 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 00:25:04 +0000 Subject: Lock updates out while linking and unlinking --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 255 ++++++++++++++------------ 1 file changed, 134 insertions(+), 121 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index d87e814..5efe188 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -26,6 +26,7 @@ */ using System; +using System.Threading; using System.Collections.Generic; using System.Reflection; using OpenMetaverse; @@ -96,6 +97,8 @@ namespace OpenSim.Region.Framework.Scenes protected internal Dictionary SceneObjectGroupsByFullID = new Dictionary(); private readonly Object m_dictionary_lock = new Object(); + private Object m_updateLock = new Object(); + #endregion protected internal SceneGraph(Scene parent, RegionInfo regInfo) @@ -369,6 +372,9 @@ namespace OpenSim.Region.Framework.Scenes /// protected internal void UpdateObjectGroups() { + if (!Monitor.TryEnter(m_updateLock)) + return; + List updates; // Some updates add more updates to the updateList. @@ -395,6 +401,7 @@ namespace OpenSim.Region.Framework.Scenes "[INNER SCENE]: Failed to update {0}, {1} - {2}", sog.Name, sog.UUID, e); } } + Monitor.Exit(m_updateLock); } protected internal void AddPhysicalPrim(int number) @@ -1555,56 +1562,59 @@ namespace OpenSim.Region.Framework.Scenes /// protected internal void LinkObjects(IClientAPI client, uint parentPrimId, List childPrimIds) { - SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId); - - List childGroups = new List(); - if (parentGroup != null) + lock (m_updateLock) { - // We do this in reverse to get the link order of the prims correct - for (int i = childPrimIds.Count - 1; i >= 0; i--) + SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId); + + List childGroups = new List(); + if (parentGroup != null) { - SceneObjectGroup child = GetGroupByPrim(childPrimIds[i]); - if (child != null) + // We do this in reverse to get the link order of the prims correct + for (int i = childPrimIds.Count - 1; i >= 0; i--) { - // Make sure no child prim is set for sale - // So that, on delink, no prims are unwittingly - // left for sale and sold off - child.RootPart.ObjectSaleType = 0; - child.RootPart.SalePrice = 10; - childGroups.Add(child); + SceneObjectGroup child = GetGroupByPrim(childPrimIds[i]); + if (child != null) + { + // Make sure no child prim is set for sale + // So that, on delink, no prims are unwittingly + // left for sale and sold off + child.RootPart.ObjectSaleType = 0; + child.RootPart.SalePrice = 10; + childGroups.Add(child); + } } } - } - else - { - return; // parent is null so not in this region - } + else + { + return; // parent is null so not in this region + } - foreach (SceneObjectGroup child in childGroups) - { - parentGroup.LinkToGroup(child); + foreach (SceneObjectGroup child in childGroups) + { + parentGroup.LinkToGroup(child); - // this is here so physics gets updated! - // Don't remove! Bad juju! Stay away! or fix physics! - child.AbsolutePosition = child.AbsolutePosition; - } + // this is here so physics gets updated! + // Don't remove! Bad juju! Stay away! or fix physics! + child.AbsolutePosition = child.AbsolutePosition; + } - // We need to explicitly resend the newly link prim's object properties since no other actions - // occur on link to invoke this elsewhere (such as object selection) - parentGroup.RootPart.AddFlag(PrimFlags.CreateSelected); - parentGroup.TriggerScriptChangedEvent(Changed.LINK); - parentGroup.HasGroupChanged = true; - parentGroup.ScheduleGroupForFullUpdate(); - - if (client != null) - { - parentGroup.GetProperties(client); - } - else - { - foreach (ScenePresence p in GetScenePresences()) + // We need to explicitly resend the newly link prim's object properties since no other actions + // occur on link to invoke this elsewhere (such as object selection) + parentGroup.RootPart.AddFlag(PrimFlags.CreateSelected); + parentGroup.TriggerScriptChangedEvent(Changed.LINK); + parentGroup.HasGroupChanged = true; + parentGroup.ScheduleGroupForFullUpdate(); + + if (client != null) { - parentGroup.GetProperties(p.ControllingClient); + parentGroup.GetProperties(client); + } + else + { + foreach (ScenePresence p in GetScenePresences()) + { + parentGroup.GetProperties(p.ControllingClient); + } } } } @@ -1620,109 +1630,112 @@ namespace OpenSim.Region.Framework.Scenes protected internal void DelinkObjects(List primIds, bool sendEvents) { - List childParts = new List(); - List rootParts = new List(); - List affectedGroups = new List(); - // Look them all up in one go, since that is comparatively expensive - // - foreach (uint primID in primIds) + lock (m_updateLock) { - SceneObjectPart part = m_parentScene.GetSceneObjectPart(primID); - if (part != null) + List childParts = new List(); + List rootParts = new List(); + List affectedGroups = new List(); + // Look them all up in one go, since that is comparatively expensive + // + foreach (uint primID in primIds) { - if (part.LinkNum < 2) // Root or single - rootParts.Add(part); + SceneObjectPart part = m_parentScene.GetSceneObjectPart(primID); + if (part != null) + { + if (part.LinkNum < 2) // Root or single + rootParts.Add(part); + else + childParts.Add(part); + + SceneObjectGroup group = part.ParentGroup; + if (!affectedGroups.Contains(group)) + affectedGroups.Add(group); + } else - childParts.Add(part); - - SceneObjectGroup group = part.ParentGroup; - if (!affectedGroups.Contains(group)) - affectedGroups.Add(group); + { + m_log.ErrorFormat("Viewer requested unlink of nonexistent part {0}", primID); + } } - else + + foreach (SceneObjectPart child in childParts) { - m_log.ErrorFormat("Viewer requested unlink of nonexistent part {0}", primID); + // Unlink all child parts from their groups + // + child.ParentGroup.DelinkFromGroup(child, sendEvents); } - } - foreach (SceneObjectPart child in childParts) - { - // Unlink all child parts from their groups - // - child.ParentGroup.DelinkFromGroup(child, sendEvents); - } - - foreach (SceneObjectPart root in rootParts) - { - // In most cases, this will run only one time, and the prim - // will be a solo prim - // However, editing linked parts and unlinking may be different - // - SceneObjectGroup group = root.ParentGroup; - List newSet = new List(group.Children.Values); - int numChildren = group.Children.Count; - - // If there are prims left in a link set, but the root is - // slated for unlink, we need to do this - // - if (numChildren != 1) + foreach (SceneObjectPart root in rootParts) { - // Unlink the remaining set + // In most cases, this will run only one time, and the prim + // will be a solo prim + // However, editing linked parts and unlinking may be different // - bool sendEventsToRemainder = true; - if (numChildren > 1) - sendEventsToRemainder = false; - - foreach (SceneObjectPart p in newSet) - { - if (p != group.RootPart) - group.DelinkFromGroup(p, sendEventsToRemainder); - } + SceneObjectGroup group = root.ParentGroup; + List newSet = new List(group.Children.Values); + int numChildren = group.Children.Count; - // If there is more than one prim remaining, we - // need to re-link + // If there are prims left in a link set, but the root is + // slated for unlink, we need to do this // - if (numChildren > 2) + if (numChildren != 1) { - // Remove old root + // Unlink the remaining set // - if (newSet.Contains(root)) - newSet.Remove(root); + bool sendEventsToRemainder = true; + if (numChildren > 1) + sendEventsToRemainder = false; - // Preserve link ordering - // - newSet.Sort(delegate (SceneObjectPart a, SceneObjectPart b) + foreach (SceneObjectPart p in newSet) { - return a.LinkNum.CompareTo(b.LinkNum); - }); + if (p != group.RootPart) + group.DelinkFromGroup(p, sendEventsToRemainder); + } - // Determine new root + // If there is more than one prim remaining, we + // need to re-link // - SceneObjectPart newRoot = newSet[0]; - newSet.RemoveAt(0); + if (numChildren > 2) + { + // Remove old root + // + if (newSet.Contains(root)) + newSet.Remove(root); + + // Preserve link ordering + // + newSet.Sort(delegate (SceneObjectPart a, SceneObjectPart b) + { + return a.LinkNum.CompareTo(b.LinkNum); + }); - List linkIDs = new List(); + // Determine new root + // + SceneObjectPart newRoot = newSet[0]; + newSet.RemoveAt(0); - foreach (SceneObjectPart newChild in newSet) - { - newChild.UpdateFlag = 0; - linkIDs.Add(newChild.LocalId); - } + List linkIDs = new List(); + + foreach (SceneObjectPart newChild in newSet) + { + newChild.UpdateFlag = 0; + linkIDs.Add(newChild.LocalId); + } - LinkObjects(null, newRoot.LocalId, linkIDs); - if (!affectedGroups.Contains(newRoot.ParentGroup)) - affectedGroups.Add(newRoot.ParentGroup); + LinkObjects(null, newRoot.LocalId, linkIDs); + if (!affectedGroups.Contains(newRoot.ParentGroup)) + affectedGroups.Add(newRoot.ParentGroup); + } } } - } - // Finally, trigger events in the roots - // - foreach (SceneObjectGroup g in affectedGroups) - { - g.TriggerScriptChangedEvent(Changed.LINK); - g.HasGroupChanged = true; // Persist - g.ScheduleGroupForFullUpdate(); + // Finally, trigger events in the roots + // + foreach (SceneObjectGroup g in affectedGroups) + { + g.TriggerScriptChangedEvent(Changed.LINK); + g.HasGroupChanged = true; // Persist + g.ScheduleGroupForFullUpdate(); + } } } -- cgit v1.1 From 5259a32319fd2b27faa3dcd070dece7b428dfd80 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 00:50:28 +0000 Subject: Remove extra forced updates. They're not needed for each prim. Really. --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 6170caa..cb87212 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2114,14 +2114,14 @@ namespace OpenSim.Region.Framework.Scenes public void LinkToGroup(SceneObjectGroup objectGroup) { // Make sure we have sent any pending unlinks or stuff. - if (objectGroup.RootPart.UpdateFlag > 0) - { - m_log.WarnFormat( - "[SCENE OBJECT GROUP]: Forcing send of linkset {0}, {1} to {2}, {3} as its still waiting.", - objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); - - objectGroup.RootPart.SendScheduledUpdates(); - } + //if (objectGroup.RootPart.UpdateFlag > 0) + //{ + // m_log.WarnFormat( + // "[SCENE OBJECT GROUP]: Forcing send of linkset {0}, {1} to {2}, {3} as its still waiting.", + // objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); + + // objectGroup.RootPart.SendScheduledUpdates(); + //} // m_log.DebugFormat( // "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}", -- cgit v1.1 From f71025aeedf63d5b0ddfe2e18b7d541879db8248 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 01:20:39 +0000 Subject: Change locking to not mix explicit Monitor.* calls with lock() --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 5efe188..4bdc52c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1562,7 +1562,8 @@ namespace OpenSim.Region.Framework.Scenes /// protected internal void LinkObjects(IClientAPI client, uint parentPrimId, List childPrimIds) { - lock (m_updateLock) + Monitor.Enter(m_updateLock); + try { SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId); @@ -1617,6 +1618,10 @@ namespace OpenSim.Region.Framework.Scenes } } } + finally + { + Monitor.Exit(m_updateLock); + } } /// @@ -1630,7 +1635,8 @@ namespace OpenSim.Region.Framework.Scenes protected internal void DelinkObjects(List primIds, bool sendEvents) { - lock (m_updateLock) + Monitor.Enter(m_updateLock); + try { List childParts = new List(); List rootParts = new List(); @@ -1737,6 +1743,10 @@ namespace OpenSim.Region.Framework.Scenes g.ScheduleGroupForFullUpdate(); } } + finally + { + Monitor.Exit(m_updateLock); + } } protected internal void MakeObjectSearchable(IClientAPI remoteClient, bool IncludeInSearch, uint localID) -- cgit v1.1 From 1a695875a72379f8a8a15ef6818167c443b60494 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 02:00:32 +0000 Subject: Skip single prims in unlink selections --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 4bdc52c..18e7b79 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1648,14 +1648,17 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart part = m_parentScene.GetSceneObjectPart(primID); if (part != null) { - if (part.LinkNum < 2) // Root or single - rootParts.Add(part); - else - childParts.Add(part); - - SceneObjectGroup group = part.ParentGroup; - if (!affectedGroups.Contains(group)) - affectedGroups.Add(group); + if (part.ParentGroup.Children.Count != 1) // Skip single + { + if (part.LinkNum < 2) // Root + rootParts.Add(part); + else + childParts.Add(part); + + SceneObjectGroup group = part.ParentGroup; + if (!affectedGroups.Contains(group)) + affectedGroups.Add(group); + } } else { -- cgit v1.1 From 9453c426316e8af97b1280c8e6415d2c051d7284 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 02:15:52 +0000 Subject: Experimental: Remove explicit property sends --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 18e7b79..f74fd5d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1606,17 +1606,17 @@ namespace OpenSim.Region.Framework.Scenes parentGroup.HasGroupChanged = true; parentGroup.ScheduleGroupForFullUpdate(); - if (client != null) - { - parentGroup.GetProperties(client); - } - else - { - foreach (ScenePresence p in GetScenePresences()) - { - parentGroup.GetProperties(p.ControllingClient); - } - } +// if (client != null) +// { +// parentGroup.GetProperties(client); +// } +// else +// { +// foreach (ScenePresence p in GetScenePresences()) +// { +// parentGroup.GetProperties(p.ControllingClient); +// } +// } } finally { -- cgit v1.1 From 8d196dbd148f759f9fce1a2f456abfc084fd8f97 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 5 Dec 2009 22:18:00 -0500 Subject: * Adds Normal to the fields returned by the Physics Raycaster * Fixes recognizing when a sit target is and isn't set. * * 1. Vector3.Zero. * * 2. Orientation: x:0, y:0, z:0, w:1 - ZERO_ROTATION * * (or) Orientation: x:0, y:0, z:0, w:0 - Invalid Quaternion * * (or) Orientation: x:0, y:0, z:1, w:0 - Invalid mapping, some older objects still exist with it --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 24 ++++++++++++++++++---- OpenSim/Region/Physics/Manager/PhysicsScene.cs | 4 ++-- .../Physics/OdePlugin/ODERayCastRequestManager.cs | 10 +++++++-- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a3ceecb..24840d4 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1105,7 +1105,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - public void RayCastCameraCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance) + public void RayCastCameraCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 pNormal) { const float POSITION_TOLERANCE = 0.02f; const float VELOCITY_TOLERANCE = 0.02f; @@ -1686,8 +1686,13 @@ namespace OpenSim.Region.Framework.Scenes bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero)); bool SitTargetisSet = - (!(avSitOffSet.X == 0f && avSitOffSet.Y == 0f && avSitOffSet.Z == 0f && avSitOrientation.W == 0f && - avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 1f)); + (!(avSitOffSet.X == 0f && avSitOffSet.Y == 0f && avSitOffSet.Z == 0f && + ( + avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 0f && avSitOrientation.W == 1f // Valid Zero Rotation quaternion + || avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 1f && avSitOrientation.W == 0f // W-Z Mapping was invalid at one point + || avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 0f && avSitOrientation.W == 0f // Invalid Quaternion + ) + )); if (SitTargetisSet && SitTargetUnOccupied) { @@ -1750,7 +1755,7 @@ namespace OpenSim.Region.Framework.Scenes StandUp(); } m_nextSitAnimation = "SIT"; - + //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID); SceneObjectPart part = FindNextAvailableSitTarget(targetID); @@ -1762,12 +1767,23 @@ namespace OpenSim.Region.Framework.Scenes } m_requestedSitTargetID = part.LocalId; //m_requestedSitOffset = offset; + //offset.X += part.Scale.X;// *offset.X; + //offset.Y += part.Scale.Y;// * offset.Y; + //offset.Z += part.Scale.Z;// * offset.Z; + //m_requestedSitOffset = offset; + m_log.DebugFormat("[SIT]: Client requested Sit Position: {0}", offset); } else { m_log.Warn("Sit requested on unknown object: " + targetID.ToString()); } + + if (m_scene.PhysicsScene.SupportsRayCast()) + { + //m_scene.PhysicsScene.RaycastWorld(Vector3.Zero,Vector3.Zero, 0.01f,new RaycastCallback()); + } + SendSitResponse(remoteClient, targetID, offset); } diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index 6d515e9..217d307 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs @@ -36,7 +36,7 @@ namespace OpenSim.Region.Physics.Manager { public delegate void physicsCrash(); - public delegate void RaycastCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance); + public delegate void RaycastCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal); public abstract class PhysicsScene { @@ -204,7 +204,7 @@ namespace OpenSim.Region.Physics.Manager public virtual void RaycastWorld(Vector3 position, Vector3 direction, float length, RaycastCallback retMethod) { if (retMethod != null) - retMethod(false, Vector3.Zero, 0, 999999999999f); + retMethod(false, Vector3.Zero, 0, 999999999999f, Vector3.Zero); } private class NullPhysicsScene : PhysicsScene diff --git a/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs index c8ae229..732e835 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs @@ -145,6 +145,7 @@ namespace OpenSim.Region.Physics.OdePlugin uint hitConsumerID = 0; float distance = 999999999999f; Vector3 closestcontact = new Vector3(99999f, 99999f, 99999f); + Vector3 snormal = Vector3.Zero; // Find closest contact and object. lock (m_contactResults) @@ -157,6 +158,7 @@ namespace OpenSim.Region.Physics.OdePlugin hitConsumerID = cResult.ConsumerID; distance = cResult.Depth; hitYN = true; + snormal = cResult.Normal; } } @@ -165,7 +167,7 @@ namespace OpenSim.Region.Physics.OdePlugin // Return results if (req.callbackMethod != null) - req.callbackMethod(hitYN, closestcontact, hitConsumerID, distance); + req.callbackMethod(hitYN, closestcontact, hitConsumerID, distance, snormal); } // This is the standard Near. Uses space AABBs to speed up detection. @@ -310,7 +312,8 @@ namespace OpenSim.Region.Physics.OdePlugin collisionresult.ConsumerID = ((OdePrim)p1).m_localID; collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z); collisionresult.Depth = contacts[i].depth; - + collisionresult.Normal = new Vector3(contacts[i].normal.X, contacts[i].normal.Y, + contacts[i].normal.Z); lock (m_contactResults) m_contactResults.Add(collisionresult); } @@ -325,6 +328,8 @@ namespace OpenSim.Region.Physics.OdePlugin collisionresult.ConsumerID = ((OdePrim)p2).m_localID; collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z); collisionresult.Depth = contacts[i].depth; + collisionresult.Normal = new Vector3(contacts[i].normal.X, contacts[i].normal.Y, + contacts[i].normal.Z); lock (m_contactResults) m_contactResults.Add(collisionresult); @@ -358,5 +363,6 @@ namespace OpenSim.Region.Physics.OdePlugin public Vector3 Pos; public float Depth; public uint ConsumerID; + public Vector3 Normal; } } -- cgit v1.1 From f9ae9afaacc82ee0284b1f7dc88ad880aabe23af Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 03:10:34 +0000 Subject: Fix build break from conflicted merge --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3d4490a..f6bcb59 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1972,7 +1972,7 @@ namespace OpenSim.Region.Framework.Scenes SendFullUpdateToAllClients(); } - public void SitAltitudeCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance) + public void SitAltitudeCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal) { if(hitYN) { -- cgit v1.1 From 1e222d52e6219db4ad32338b952a94eebb0f7799 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 03:56:15 +0000 Subject: Change EntityManager to use RWlocks --- OpenSim/Region/Framework/Scenes/EntityManager.cs | 79 ++++++++++++++++++++---- 1 file changed, 67 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/EntityManager.cs b/OpenSim/Region/Framework/Scenes/EntityManager.cs index 099fcce..c246e32 100644 --- a/OpenSim/Region/Framework/Scenes/EntityManager.cs +++ b/OpenSim/Region/Framework/Scenes/EntityManager.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.Framework.Scenes private readonly Dictionary m_eb_uuid = new Dictionary(); private readonly Dictionary m_eb_localID = new Dictionary(); //private readonly Dictionary m_pres_uuid = new Dictionary(); - private readonly Object m_lock = new Object(); + private System.Threading.ReaderWriterLockSlim m_lock = new System.Threading.ReaderWriterLockSlim(); [Obsolete("Use Add() instead.")] public void Add(UUID id, EntityBase eb) @@ -50,7 +50,8 @@ namespace OpenSim.Region.Framework.Scenes public void Add(EntityBase entity) { - lock (m_lock) + m_lock.EnterWriteLock(); + try { try { @@ -62,11 +63,16 @@ namespace OpenSim.Region.Framework.Scenes m_log.ErrorFormat("Add Entity failed: {0}", e.Message); } } + finally + { + m_lock.ExitWriteLock(); + } } public void InsertOrReplace(EntityBase entity) { - lock (m_lock) + m_lock.EnterWriteLock(); + try { try { @@ -78,15 +84,24 @@ namespace OpenSim.Region.Framework.Scenes m_log.ErrorFormat("Insert or Replace Entity failed: {0}", e.Message); } } + finally + { + m_lock.ExitWriteLock(); + } } public void Clear() { - lock (m_lock) + m_lock.EnterWriteLock(); + try { m_eb_uuid.Clear(); m_eb_localID.Clear(); } + finally + { + m_lock.ExitWriteLock(); + } } public int Count @@ -123,7 +138,8 @@ namespace OpenSim.Region.Framework.Scenes public bool Remove(uint localID) { - lock (m_lock) + m_lock.EnterWriteLock(); + try { try { @@ -141,11 +157,16 @@ namespace OpenSim.Region.Framework.Scenes return false; } } + finally + { + m_lock.ExitWriteLock(); + } } public bool Remove(UUID id) { - lock (m_lock) + m_lock.EnterWriteLock(); + try { try { @@ -163,13 +184,18 @@ namespace OpenSim.Region.Framework.Scenes return false; } } + finally + { + m_lock.ExitWriteLock(); + } } public List GetAllByType() { List tmp = new List(); - lock (m_lock) + m_lock.EnterReadLock(); + try { try { @@ -187,23 +213,33 @@ namespace OpenSim.Region.Framework.Scenes tmp = null; } } + finally + { + m_lock.ExitReadLock(); + } return tmp; } public List GetEntities() { - lock (m_lock) + m_lock.EnterReadLock(); + try { return new List(m_eb_uuid.Values); } + finally + { + m_lock.ExitReadLock(); + } } public EntityBase this[UUID id] { get { - lock (m_lock) + m_lock.EnterReadLock(); + try { EntityBase entity; if (m_eb_uuid.TryGetValue(id, out entity)) @@ -211,6 +247,10 @@ namespace OpenSim.Region.Framework.Scenes else return null; } + finally + { + m_lock.ExitReadLock(); + } } set { @@ -222,7 +262,8 @@ namespace OpenSim.Region.Framework.Scenes { get { - lock (m_lock) + m_lock.EnterReadLock(); + try { EntityBase entity; if (m_eb_localID.TryGetValue(localID, out entity)) @@ -230,6 +271,10 @@ namespace OpenSim.Region.Framework.Scenes else return null; } + finally + { + m_lock.ExitReadLock(); + } } set { @@ -239,18 +284,28 @@ namespace OpenSim.Region.Framework.Scenes public bool TryGetValue(UUID key, out EntityBase obj) { - lock (m_lock) + m_lock.EnterReadLock(); + try { return m_eb_uuid.TryGetValue(key, out obj); } + finally + { + m_lock.ExitReadLock(); + } } public bool TryGetValue(uint key, out EntityBase obj) { - lock (m_lock) + m_lock.EnterReadLock(); + try { return m_eb_localID.TryGetValue(key, out obj); } + finally + { + m_lock.ExitReadLock(); + } } /// -- cgit v1.1 From 4c61fcfc401cdf08f5027e3bce21c4b465711c60 Mon Sep 17 00:00:00 2001 From: Kunnis Date: Sat, 5 Dec 2009 09:54:33 -0600 Subject: Getting rid of the dead field RootInventoryFolderId on UserProfileData, It's not even stored in mysql. Signed-off-by: Melanie --- OpenSim/Data/SQLite/SQLiteUserData.cs | 7 +++++-- OpenSim/Data/Tests/BasicUserTest.cs | 9 ++------- OpenSim/Framework/Communications/Services/LoginService.cs | 2 -- OpenSim/Framework/Communications/UserManagerBase.cs | 3 --- OpenSim/Framework/UserProfileData.cs | 8 -------- OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs | 1 - 6 files changed, 7 insertions(+), 23 deletions(-) diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index b9f3515..caddcf8 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs @@ -819,7 +819,10 @@ namespace OpenSim.Data.SQLite SQLiteUtil.createCol(users, "homeLookAtZ", typeof (Double)); SQLiteUtil.createCol(users, "created", typeof (Int32)); SQLiteUtil.createCol(users, "lastLogin", typeof (Int32)); + + //TODO: Please delete this column. It's now a brick SQLiteUtil.createCol(users, "rootInventoryFolderID", typeof (String)); + SQLiteUtil.createCol(users, "userInventoryURI", typeof (String)); SQLiteUtil.createCol(users, "userAssetURI", typeof (String)); SQLiteUtil.createCol(users, "profileCanDoMask", typeof (Int32)); @@ -980,7 +983,6 @@ namespace OpenSim.Data.SQLite user.Created = Convert.ToInt32(row["created"]); user.LastLogin = Convert.ToInt32(row["lastLogin"]); - user.RootInventoryFolderID = new UUID((String) row["rootInventoryFolderID"]); user.UserInventoryURI = (String) row["userInventoryURI"]; user.UserAssetURI = (String) row["userAssetURI"]; user.CanDoMask = Convert.ToUInt32(row["profileCanDoMask"]); @@ -1026,7 +1028,8 @@ namespace OpenSim.Data.SQLite row["created"] = user.Created; row["lastLogin"] = user.LastLogin; - row["rootInventoryFolderID"] = user.RootInventoryFolderID.ToString(); + //TODO: Get rid of rootInventoryFolderID in a safe way. + row["rootInventoryFolderID"] = UUID.Zero.ToString(); row["userInventoryURI"] = user.UserInventoryURI; row["userAssetURI"] = user.UserAssetURI; row["profileCanDoMask"] = user.CanDoMask; diff --git a/OpenSim/Data/Tests/BasicUserTest.cs b/OpenSim/Data/Tests/BasicUserTest.cs index 1f472a5..d3b6041 100644 --- a/OpenSim/Data/Tests/BasicUserTest.cs +++ b/OpenSim/Data/Tests/BasicUserTest.cs @@ -170,8 +170,8 @@ namespace OpenSim.Data.Tests { UserProfileData u0 = NewUser(zero,fname0,lname0); UserProfileData u4 = NewUser(user4,fname2,lname2); - db.AddNewUserProfile(u0); - db.AddNewUserProfile(u4); + db.AddNewUserProfile(u0); //UserID 0 should fail to save. + db.AddNewUserProfile(u4); //The first name and last name are already in use (from T010), so this should fail too Assert.That(db.GetUserByUUID(zero),Is.Null); Assert.That(db.GetUserByUUID(user4),Is.Null); } @@ -267,8 +267,6 @@ namespace OpenSim.Data.Tests Assert.That(homelookat,Is.EqualTo(u1a.HomeLookAt), "Assert.That(homelookat,Is.EqualTo(u1a.HomeLookAt))"); Assert.That(created,Is.EqualTo(u1a.Created), "Assert.That(created,Is.EqualTo(u1a.Created))"); Assert.That(lastlogin,Is.EqualTo(u1a.LastLogin), "Assert.That(lastlogin,Is.EqualTo(u1a.LastLogin))"); - // RootInventoryFolderID is not tested because it is saved in SQLite, - // but not in MySQL Assert.That(userinvuri,Is.EqualTo(u1a.UserInventoryURI), "Assert.That(userinvuri,Is.EqualTo(u1a.UserInventoryURI))"); Assert.That(userasseturi,Is.EqualTo(u1a.UserAssetURI), "Assert.That(userasseturi,Is.EqualTo(u1a.UserAssetURI))"); Assert.That(candomask,Is.EqualTo(u1a.CanDoMask), "Assert.That(candomask,Is.EqualTo(u1a.CanDoMask))"); @@ -367,8 +365,6 @@ namespace OpenSim.Data.Tests Assert.That(homelookat,Is.EqualTo(u1a.HomeLookAt), "Assert.That(homelookat,Is.EqualTo(u1a.HomeLookAt))"); Assert.That(created,Is.EqualTo(u1a.Created), "Assert.That(created,Is.EqualTo(u1a.Created))"); Assert.That(lastlogin,Is.EqualTo(u1a.LastLogin), "Assert.That(lastlogin,Is.EqualTo(u1a.LastLogin))"); - // RootInventoryFolderID is not tested because it is saved in SQLite, - // but not in MySQL Assert.That(userasseturi,Is.EqualTo(u1a.UserAssetURI), "Assert.That(userasseturi,Is.EqualTo(u1a.UserAssetURI))"); Assert.That(candomask,Is.EqualTo(u1a.CanDoMask), "Assert.That(candomask,Is.EqualTo(u1a.CanDoMask))"); Assert.That(wantdomask,Is.EqualTo(u1a.WantDoMask), "Assert.That(wantdomask,Is.EqualTo(u1a.WantDoMask))"); @@ -395,7 +391,6 @@ namespace OpenSim.Data.Tests Assert.That(u1a, Constraints.PropertyCompareConstraint(u) .IgnoreProperty(x=>x.HomeRegionX) .IgnoreProperty(x=>x.HomeRegionY) - .IgnoreProperty(x=>x.RootInventoryFolderID) ); } diff --git a/OpenSim/Framework/Communications/Services/LoginService.cs b/OpenSim/Framework/Communications/Services/LoginService.cs index b652299..57ca704 100644 --- a/OpenSim/Framework/Communications/Services/LoginService.cs +++ b/OpenSim/Framework/Communications/Services/LoginService.cs @@ -244,7 +244,6 @@ namespace OpenSim.Framework.Communications.Services InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString(); ArrayList InventoryRoot = new ArrayList(); InventoryRoot.Add(InventoryRootHash); - userProfile.RootInventoryFolderID = inventData.RootFolderID; logResponse.InventoryRoot = InventoryRoot; logResponse.InventorySkeleton = AgentInventoryArray; @@ -501,7 +500,6 @@ namespace OpenSim.Framework.Communications.Services InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString(); ArrayList InventoryRoot = new ArrayList(); InventoryRoot.Add(InventoryRootHash); - userProfile.RootInventoryFolderID = inventData.RootFolderID; // Inventory Library Section diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index bf4f331..4f0af06 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -697,9 +697,6 @@ namespace OpenSim.Framework.Communications // local service (standalone) m_log.Debug("[USERSTORAGE]: using IInventoryService to create user's inventory"); m_InventoryService.CreateUserInventory(userProf.ID); - InventoryFolderBase rootfolder = m_InventoryService.GetRootFolder(userProf.ID); - if (rootfolder != null) - userProf.RootInventoryFolderID = rootfolder.ID; } else if (m_commsManager.InterServiceInventoryService != null) { diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs index 413f152..9bac739 100644 --- a/OpenSim/Framework/UserProfileData.cs +++ b/OpenSim/Framework/UserProfileData.cs @@ -119,8 +119,6 @@ namespace OpenSim.Framework /// private string m_profileUrl; - private UUID m_rootInventoryFolderId; - /// /// The second component of a users account name /// @@ -312,12 +310,6 @@ namespace OpenSim.Framework set { m_lastLogin = value; } } - public UUID RootInventoryFolderID - { - get { return m_rootInventoryFolderId; } - set { m_rootInventoryFolderId = value; } - } - public string UserInventoryURI { get { return m_userInventoryUri; } diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs index 62500a2..c727cec 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs @@ -527,7 +527,6 @@ namespace OpenSim.Region.CoreModules.InterGrid userProfile.Partner = UUID.Zero; userProfile.PasswordHash = "$1$"; userProfile.PasswordSalt = ""; - userProfile.RootInventoryFolderID = UUID.Zero; userProfile.SurName = agentData.lastname; userProfile.UserAssetURI = homeScene.CommsManager.NetworkServersInfo.AssetURL; userProfile.UserFlags = 0; -- cgit v1.1 From cade14c58c335503221753b10ec361898ce5f9d4 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 05:14:17 +0000 Subject: Make ObjectSelect packet processing not use FireAndForget --- OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 85961b9..9996857 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -964,7 +964,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP } if (packetInbox.Dequeue(100, ref incomingPacket)) - Util.FireAndForget(ProcessInPacket, incomingPacket); + { + if (incomingPacket.Packet.Type != PacketType.ObjectSelect) + Util.FireAndForget(ProcessInPacket, incomingPacket); + else + ProcessInPacket(incomingPacket); + } } catch (Exception ex) { -- cgit v1.1 From 23cd1b195424bb4a844e1f2397047e5d5080c5ad Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Dec 2009 05:24:43 +0000 Subject: Revert "Make ObjectSelect packet processing not use FireAndForget" This reverts commit cade14c58c335503221753b10ec361898ce5f9d4. --- OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 9996857..85961b9 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -964,12 +964,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } if (packetInbox.Dequeue(100, ref incomingPacket)) - { - if (incomingPacket.Packet.Type != PacketType.ObjectSelect) - Util.FireAndForget(ProcessInPacket, incomingPacket); - else - ProcessInPacket(incomingPacket); - } + Util.FireAndForget(ProcessInPacket, incomingPacket); } catch (Exception ex) { -- cgit v1.1 From 172e2f4e7609c278d02ad83ca207fd79624db587 Mon Sep 17 00:00:00 2001 From: CasperW Date: Sun, 6 Dec 2009 17:23:07 +0100 Subject: Fix to existing ReaderWriterLockSlim implementations --- OpenSim/Framework/TaskInventoryDictionary.cs | 10 ++++++++-- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 10 ++++++++-- OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 3 ++- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 10 ++++++++-- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/OpenSim/Framework/TaskInventoryDictionary.cs b/OpenSim/Framework/TaskInventoryDictionary.cs index efe5f0c..4b9a509 100644 --- a/OpenSim/Framework/TaskInventoryDictionary.cs +++ b/OpenSim/Framework/TaskInventoryDictionary.cs @@ -109,7 +109,10 @@ namespace OpenSim.Framework } else { - m_itemLock.ExitReadLock(); + if (m_itemLock.RecursiveReadCount>0) + { + m_itemLock.ExitReadLock(); + } } } @@ -144,7 +147,10 @@ namespace OpenSim.Framework } else { - m_itemLock.ExitWriteLock(); + if (m_itemLock.RecursiveWriteCount > 0) + { + m_itemLock.ExitWriteLock(); + } } } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 93888f1..eacd219 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -126,7 +126,10 @@ namespace OpenSim.Region.Framework.Scenes } else { - m_partsLock.ExitReadLock(); + if (m_partsLock.RecursiveReadCount > 0) + { + m_partsLock.ExitReadLock(); + } } } public void lockPartsForWrite(bool locked) @@ -155,7 +158,10 @@ namespace OpenSim.Region.Framework.Scenes } else { - m_partsLock.ExitWriteLock(); + if (m_partsLock.RecursiveWriteCount > 0) + { + m_partsLock.ExitWriteLock(); + } } } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 4780ff2..b57d912 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -320,17 +320,18 @@ namespace OpenSim.Region.Framework.Scenes { if (m_items.ContainsKey(itemId)) { + m_items.LockItemsForRead(false); CreateScriptInstance(m_items[itemId], startParam, postOnRez, engine, stateSource); } else { + m_items.LockItemsForRead(false); m_log.ErrorFormat( "[PRIM INVENTORY]: " + "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", itemId, m_part.Name, m_part.UUID, m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); } - m_items.LockItemsForRead(false); } else { diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 49c69ab..184af19 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -150,7 +150,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine } else { - m_scriptsLock.ExitReadLock(); + if (m_scriptsLock.RecursiveReadCount > 0) + { + m_scriptsLock.ExitReadLock(); + } } } private void lockScriptsForWrite(bool locked) @@ -179,7 +182,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine } else { - m_scriptsLock.ExitWriteLock(); + if (m_scriptsLock.RecursiveWriteCount > 0) + { + m_scriptsLock.ExitWriteLock(); + } } } -- cgit v1.1 From ad2c23d50727c24a64febdeb30f3313622832347 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 7 Dec 2009 14:12:53 +0000 Subject: Stop AuthorizationService from throwing an error if it's not configured. Optional services should not cause red spew when they're not wanted --- .../Services/Connectors/Authorization/AuthorizationServiceConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs b/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs index c2ad9db..a1c032e 100644 --- a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs @@ -67,7 +67,7 @@ namespace OpenSim.Services.Connectors IConfig authorizationConfig = source.Configs["AuthorizationService"]; if (authorizationConfig == null) { - m_log.Error("[AUTHORIZATION CONNECTOR]: AuthorizationService missing from OpenSim.ini"); + m_log.Info("[AUTHORIZATION CONNECTOR]: AuthorizationService missing from OpenSim.ini"); throw new Exception("Authorization connector init error"); } -- cgit v1.1 From c2d3afdeee1b1b8b9b4ef0c6588777536adc15db Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 7 Dec 2009 14:31:20 +0000 Subject: Same for the remote auth connector --- .../Authorization/RemoteAuthorizationServiceConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs index fca2df2..68499f3 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs @@ -70,7 +70,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization IConfig authorizationConfig = source.Configs["AuthorizationService"]; if (authorizationConfig == null) { - m_log.Error("[REMOTE AUTHORIZATION CONNECTOR]: AuthorizationService missing from OpenSim.ini"); + m_log.Info("[REMOTE AUTHORIZATION CONNECTOR]: AuthorizationService missing from OpenSim.ini"); return; } -- cgit v1.1