diff options
author | BlueWall | 2012-10-09 06:44:14 -0400 |
---|---|---|
committer | BlueWall | 2012-10-09 06:44:14 -0400 |
commit | 252af020b05f386f88174cdd28191e0efbeba626 (patch) | |
tree | f425499b4338fa3a15f51b7621f4d37dec1d5ce7 /OpenSim/Region/Framework | |
parent | Added parts to manage repositories and plugin management (diff) | |
parent | Fix build break (diff) | |
download | opensim-SC_OLD-252af020b05f386f88174cdd28191e0efbeba626.zip opensim-SC_OLD-252af020b05f386f88174cdd28191e0efbeba626.tar.gz opensim-SC_OLD-252af020b05f386f88174cdd28191e0efbeba626.tar.bz2 opensim-SC_OLD-252af020b05f386f88174cdd28191e0efbeba626.tar.xz |
Merge branch 'master' into connector_plugin
Conflicts:
OpenSim/Server/ServerMain.cs
Diffstat (limited to 'OpenSim/Region/Framework')
6 files changed, 91 insertions, 25 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs index 24cd069..f8088c3 100644 --- a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs +++ b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using System; | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
2 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
3 | 30 | ||
4 | using OpenMetaverse; | 31 | using OpenMetaverse; |
diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index 33041e9..ad421ee 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs | |||
@@ -87,7 +87,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
87 | { | 87 | { |
88 | if (m_defaultAnimation.AnimID == animID) | 88 | if (m_defaultAnimation.AnimID == animID) |
89 | { | 89 | { |
90 | ResetDefaultAnimation(); | 90 | m_defaultAnimation = new OpenSim.Framework.Animation(UUID.Zero, 1, UUID.Zero); |
91 | } | 91 | } |
92 | else if (HasAnimation(animID)) | 92 | else if (HasAnimation(animID)) |
93 | { | 93 | { |
@@ -149,19 +149,26 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
149 | { | 149 | { |
150 | lock (m_animations) | 150 | lock (m_animations) |
151 | { | 151 | { |
152 | animIDs = new UUID[m_animations.Count + 1]; | 152 | int defaultSize = 0; |
153 | sequenceNums = new int[m_animations.Count + 1]; | 153 | if (m_defaultAnimation.AnimID != UUID.Zero) |
154 | objectIDs = new UUID[m_animations.Count + 1]; | 154 | defaultSize++; |
155 | 155 | ||
156 | animIDs[0] = m_defaultAnimation.AnimID; | 156 | animIDs = new UUID[m_animations.Count + defaultSize]; |
157 | sequenceNums[0] = m_defaultAnimation.SequenceNum; | 157 | sequenceNums = new int[m_animations.Count + defaultSize]; |
158 | objectIDs[0] = m_defaultAnimation.ObjectID; | 158 | objectIDs = new UUID[m_animations.Count + defaultSize]; |
159 | |||
160 | if (m_defaultAnimation.AnimID != UUID.Zero) | ||
161 | { | ||
162 | animIDs[0] = m_defaultAnimation.AnimID; | ||
163 | sequenceNums[0] = m_defaultAnimation.SequenceNum; | ||
164 | objectIDs[0] = m_defaultAnimation.ObjectID; | ||
165 | } | ||
159 | 166 | ||
160 | for (int i = 0; i < m_animations.Count; ++i) | 167 | for (int i = 0; i < m_animations.Count; ++i) |
161 | { | 168 | { |
162 | animIDs[i + 1] = m_animations[i].AnimID; | 169 | animIDs[i + defaultSize] = m_animations[i].AnimID; |
163 | sequenceNums[i + 1] = m_animations[i].SequenceNum; | 170 | sequenceNums[i + defaultSize] = m_animations[i].SequenceNum; |
164 | objectIDs[i + 1] = m_animations[i].ObjectID; | 171 | objectIDs[i + defaultSize] = m_animations[i].ObjectID; |
165 | } | 172 | } |
166 | } | 173 | } |
167 | } | 174 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index ff53f45..bb33f07 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -408,13 +408,19 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
408 | { | 408 | { |
409 | lock (m_animations) | 409 | lock (m_animations) |
410 | { | 410 | { |
411 | CurrentMovementAnimation = DetermineMovementAnimation(); | 411 | string newMovementAnimation = DetermineMovementAnimation(); |
412 | if (CurrentMovementAnimation != newMovementAnimation) | ||
413 | { | ||
414 | CurrentMovementAnimation = DetermineMovementAnimation(); | ||
412 | 415 | ||
413 | // m_log.DebugFormat( | 416 | // m_log.DebugFormat( |
414 | // "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()", | 417 | // "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()", |
415 | // CurrentMovementAnimation, m_scenePresence.Name); | 418 | // CurrentMovementAnimation, m_scenePresence.Name); |
416 | 419 | ||
417 | TrySetMovementAnimation(CurrentMovementAnimation); | 420 | // Only set it if it's actually changed, give a script |
421 | // a chance to stop a default animation | ||
422 | TrySetMovementAnimation(CurrentMovementAnimation); | ||
423 | } | ||
418 | } | 424 | } |
419 | } | 425 | } |
420 | 426 | ||
@@ -536,4 +542,4 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
536 | SendAnimPack(animIDs, sequenceNums, objectIDs); | 542 | SendAnimPack(animIDs, sequenceNums, objectIDs); |
537 | } | 543 | } |
538 | } | 544 | } |
539 | } \ No newline at end of file | 545 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 3b59dc4..b23ddb4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1424,7 +1424,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1424 | return newFolderID; | 1424 | return newFolderID; |
1425 | } | 1425 | } |
1426 | 1426 | ||
1427 | private void SendInventoryUpdate(IClientAPI client, InventoryFolderBase folder, bool fetchFolders, bool fetchItems) | 1427 | public void SendInventoryUpdate(IClientAPI client, InventoryFolderBase folder, bool fetchFolders, bool fetchItems) |
1428 | { | 1428 | { |
1429 | if (folder == null) | 1429 | if (folder == null) |
1430 | return; | 1430 | return; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0a4aa4a..e6b8c16 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -801,13 +801,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
801 | SpawnPointRouting = startupConfig.GetString("SpawnPointRouting", "closest"); | 801 | SpawnPointRouting = startupConfig.GetString("SpawnPointRouting", "closest"); |
802 | TelehubAllowLandmarks = startupConfig.GetBoolean("TelehubAllowLandmark", false); | 802 | TelehubAllowLandmarks = startupConfig.GetBoolean("TelehubAllowLandmark", false); |
803 | 803 | ||
804 | IConfig packetConfig = m_config.Configs["PacketPool"]; | ||
805 | if (packetConfig != null) | ||
806 | { | ||
807 | PacketPool.Instance.RecyclePackets = packetConfig.GetBoolean("RecyclePackets", true); | ||
808 | PacketPool.Instance.RecycleDataBlocks = packetConfig.GetBoolean("RecycleDataBlocks", true); | ||
809 | } | ||
810 | |||
811 | m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); | 804 | m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); |
812 | 805 | ||
813 | m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true); | 806 | m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true); |
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index 96317c3..2addb5b 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | |||
@@ -47,6 +47,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
47 | = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 47 | = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
48 | 48 | ||
49 | public const string LastReportedObjectUpdateStatName = "LastReportedObjectUpdates"; | 49 | public const string LastReportedObjectUpdateStatName = "LastReportedObjectUpdates"; |
50 | public const string SlowFramesStatName = "SlowFrames"; | ||
50 | 51 | ||
51 | public delegate void SendStatResult(SimStats stats); | 52 | public delegate void SendStatResult(SimStats stats); |
52 | 53 | ||
@@ -129,6 +130,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
129 | } | 130 | } |
130 | 131 | ||
131 | /// <summary> | 132 | /// <summary> |
133 | /// Number of frames that have taken longer to process than Scene.MIN_FRAME_TIME | ||
134 | /// </summary> | ||
135 | public Stat SlowFramesStat { get; private set; } | ||
136 | |||
137 | /// <summary> | ||
138 | /// The threshold at which we log a slow frame. | ||
139 | /// </summary> | ||
140 | public int SlowFramesStatReportThreshold { get; private set; } | ||
141 | |||
142 | /// <summary> | ||
132 | /// Extra sim statistics that are used by monitors but not sent to the client. | 143 | /// Extra sim statistics that are used by monitors but not sent to the client. |
133 | /// </summary> | 144 | /// </summary> |
134 | /// <value> | 145 | /// <value> |
@@ -225,6 +236,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
225 | 236 | ||
226 | if (StatsManager.SimExtraStats != null) | 237 | if (StatsManager.SimExtraStats != null) |
227 | OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket; | 238 | OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket; |
239 | |||
240 | /// At the moment, we'll only report if a frame is over 120% of target, since commonly frames are a bit | ||
241 | /// longer than ideal (which in itself is a concern). | ||
242 | SlowFramesStatReportThreshold = (int)Math.Ceiling(m_scene.MinFrameTime * 1000 * 1.2); | ||
243 | |||
244 | SlowFramesStat | ||
245 | = new Stat( | ||
246 | "SlowFrames", | ||
247 | "Slow Frames", | ||
248 | " frames", | ||
249 | "scene", | ||
250 | m_scene.Name, | ||
251 | StatVerbosity.Info, | ||
252 | "Number of frames where frame time has been significantly longer than the desired frame time."); | ||
253 | |||
254 | StatsManager.RegisterStat(SlowFramesStat); | ||
228 | } | 255 | } |
229 | 256 | ||
230 | public void Close() | 257 | public void Close() |
@@ -418,6 +445,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
418 | lock (m_lastReportedExtraSimStats) | 445 | lock (m_lastReportedExtraSimStats) |
419 | { | 446 | { |
420 | m_lastReportedExtraSimStats[LastReportedObjectUpdateStatName] = m_objectUpdates / m_statsUpdateFactor; | 447 | m_lastReportedExtraSimStats[LastReportedObjectUpdateStatName] = m_objectUpdates / m_statsUpdateFactor; |
448 | m_lastReportedExtraSimStats[SlowFramesStat.ShortName] = (float)SlowFramesStat.Value; | ||
421 | 449 | ||
422 | Dictionary<string, float> physicsStats = m_scene.PhysicsScene.GetStats(); | 450 | Dictionary<string, float> physicsStats = m_scene.PhysicsScene.GetStats(); |
423 | 451 | ||
@@ -535,6 +563,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
535 | public void addFrameMS(int ms) | 563 | public void addFrameMS(int ms) |
536 | { | 564 | { |
537 | m_frameMS += ms; | 565 | m_frameMS += ms; |
566 | |||
567 | // At the moment, we'll only report if a frame is over 120% of target, since commonly frames are a bit | ||
568 | // longer than ideal due to the inaccuracy of the Sleep in Scene.Update() (which in itself is a concern). | ||
569 | if (ms > SlowFramesStatReportThreshold) | ||
570 | SlowFramesStat.Value++; | ||
538 | } | 571 | } |
539 | 572 | ||
540 | public void AddSpareMS(int ms) | 573 | public void AddSpareMS(int ms) |