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