aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorBlueWall2012-10-09 06:44:14 -0400
committerBlueWall2012-10-09 06:44:14 -0400
commit252af020b05f386f88174cdd28191e0efbeba626 (patch)
treef425499b4338fa3a15f51b7621f4d37dec1d5ce7 /OpenSim
parentAdded parts to manage repositories and plugin management (diff)
parentFix build break (diff)
downloadopensim-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')
-rw-r--r--OpenSim/Framework/Console/ConsoleUtil.cs114
-rw-r--r--OpenSim/Framework/GridInstantMessage.cs9
-rw-r--r--OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs13
-rw-r--r--OpenSim/Framework/Monitoring/StatsManager.cs145
-rw-r--r--OpenSim/Framework/Util.cs13
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs3
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs9
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/PacketPool.cs (renamed from OpenSim/Framework/PacketPool.cs)8
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs42
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs22
-rw-r--r--OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs175
-rw-r--r--OpenSim/Region/Framework/Interfaces/IUserManagement.cs29
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs27
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs33
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs19
-rw-r--r--OpenSim/Region/UserStatistics/WebStatsModule.cs56
-rw-r--r--OpenSim/Server/ServerMain.cs23
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs11
-rw-r--r--OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs9
28 files changed, 683 insertions, 117 deletions
diff --git a/OpenSim/Framework/Console/ConsoleUtil.cs b/OpenSim/Framework/Console/ConsoleUtil.cs
new file mode 100644
index 0000000..2612a50
--- /dev/null
+++ b/OpenSim/Framework/Console/ConsoleUtil.cs
@@ -0,0 +1,114 @@
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
28using System;
29using System.Collections.Generic;
30using System.Linq;
31using System.Reflection;
32using log4net;
33using OpenMetaverse;
34
35public class ConsoleUtil
36{
37 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
38
39 public const string MinRawConsoleVectorValue = "-~";
40 public const string MaxRawConsoleVectorValue = "~";
41
42 public const string VectorSeparator = ",";
43 public static char[] VectorSeparatorChars = VectorSeparator.ToCharArray();
44
45 /// <summary>
46 /// Convert a minimum vector input from the console to an OpenMetaverse.Vector3
47 /// </summary>
48 /// <param name='rawConsoleVector'>/param>
49 /// <param name='vector'></param>
50 /// <returns></returns>
51 public static bool TryParseConsoleMinVector(string rawConsoleVector, out Vector3 vector)
52 {
53 return TryParseConsoleVector(rawConsoleVector, c => float.MinValue.ToString(), out vector);
54 }
55
56 /// <summary>
57 /// Convert a maximum vector input from the console to an OpenMetaverse.Vector3
58 /// </summary>
59 /// <param name='rawConsoleVector'>/param>
60 /// <param name='vector'></param>
61 /// <returns></returns>
62 public static bool TryParseConsoleMaxVector(string rawConsoleVector, out Vector3 vector)
63 {
64 return TryParseConsoleVector(rawConsoleVector, c => float.MaxValue.ToString(), out vector);
65 }
66
67 /// <summary>
68 /// Convert a vector input from the console to an OpenMetaverse.Vector3
69 /// </summary>
70 /// <param name='rawConsoleVector'>
71 /// A string in the form <x>,<y>,<z> where there is no space between values.
72 /// Any component can be missing (e.g. ,,40). blankComponentFunc is invoked to replace the blank with a suitable value
73 /// Also, if the blank component is at the end, then the comma can be missed off entirely (e.g. 40,30 or 40)
74 /// The strings "~" and "-~" are valid in components. The first substitutes float.MaxValue whilst the second is float.MinValue
75 /// Other than that, component values must be numeric.
76 /// </param>
77 /// <param name='blankComponentFunc'></param>
78 /// <param name='vector'></param>
79 /// <returns></returns>
80 public static bool TryParseConsoleVector(
81 string rawConsoleVector, Func<string, string> blankComponentFunc, out Vector3 vector)
82 {
83 List<string> components = rawConsoleVector.Split(VectorSeparatorChars).ToList();
84
85 if (components.Count < 1 || components.Count > 3)
86 {
87 vector = Vector3.Zero;
88 return false;
89 }
90
91 for (int i = components.Count; i < 3; i++)
92 components.Add("");
93
94 List<string> semiDigestedComponents
95 = components.ConvertAll<string>(
96 c =>
97 {
98 if (c == "")
99 return blankComponentFunc.Invoke(c);
100 else if (c == MaxRawConsoleVectorValue)
101 return float.MaxValue.ToString();
102 else if (c == MinRawConsoleVectorValue)
103 return float.MinValue.ToString();
104 else
105 return c;
106 });
107
108 string semiDigestedConsoleVector = string.Join(VectorSeparator, semiDigestedComponents.ToArray());
109
110 m_log.DebugFormat("[CONSOLE UTIL]: Parsing {0} into OpenMetaverse.Vector3", semiDigestedConsoleVector);
111
112 return Vector3.TryParse(semiDigestedConsoleVector, out vector);
113 }
114} \ No newline at end of file
diff --git a/OpenSim/Framework/GridInstantMessage.cs b/OpenSim/Framework/GridInstantMessage.cs
index a6bf6e3..6ae0488 100644
--- a/OpenSim/Framework/GridInstantMessage.cs
+++ b/OpenSim/Framework/GridInstantMessage.cs
@@ -44,7 +44,6 @@ namespace OpenSim.Framework
44 public Vector3 Position; 44 public Vector3 Position;
45 public byte[] binaryBucket; 45 public byte[] binaryBucket;
46 46
47
48 public uint ParentEstateID; 47 public uint ParentEstateID;
49 public Guid RegionID; 48 public Guid RegionID;
50 public uint timestamp; 49 public uint timestamp;
@@ -58,7 +57,7 @@ namespace OpenSim.Framework
58 string _fromAgentName, UUID _toAgentID, 57 string _fromAgentName, UUID _toAgentID,
59 byte _dialog, bool _fromGroup, string _message, 58 byte _dialog, bool _fromGroup, string _message,
60 UUID _imSessionID, bool _offline, Vector3 _position, 59 UUID _imSessionID, bool _offline, Vector3 _position,
61 byte[] _binaryBucket) 60 byte[] _binaryBucket, bool addTimestamp)
62 { 61 {
63 fromAgentID = _fromAgentID.Guid; 62 fromAgentID = _fromAgentID.Guid;
64 fromAgentName = _fromAgentName; 63 fromAgentName = _fromAgentName;
@@ -79,7 +78,9 @@ namespace OpenSim.Framework
79 ParentEstateID = scene.RegionInfo.EstateSettings.ParentEstateID; 78 ParentEstateID = scene.RegionInfo.EstateSettings.ParentEstateID;
80 RegionID = scene.RegionInfo.RegionSettings.RegionUUID.Guid; 79 RegionID = scene.RegionInfo.RegionSettings.RegionUUID.Guid;
81 } 80 }
82 timestamp = (uint)Util.UnixTimeSinceEpoch(); 81
82 if (addTimestamp)
83 timestamp = (uint)Util.UnixTimeSinceEpoch();
83 } 84 }
84 85
85 public GridInstantMessage(IScene scene, UUID _fromAgentID, 86 public GridInstantMessage(IScene scene, UUID _fromAgentID,
@@ -87,7 +88,7 @@ namespace OpenSim.Framework
87 string _message, bool _offline, 88 string _message, bool _offline,
88 Vector3 _position) : this(scene, _fromAgentID, _fromAgentName, 89 Vector3 _position) : this(scene, _fromAgentID, _fromAgentName,
89 _toAgentID, _dialog, false, _message, 90 _toAgentID, _dialog, false, _message,
90 _fromAgentID ^ _toAgentID, _offline, _position, new byte[0]) 91 _fromAgentID ^ _toAgentID, _offline, _position, new byte[0], true)
91 { 92 {
92 } 93 }
93 } 94 }
diff --git a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
index cdd7cc7..8ac9090 100644
--- a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
+++ b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
@@ -355,10 +355,19 @@ Asset service request failures: {3}" + Environment.NewLine,
355 sb.Append(Environment.NewLine); 355 sb.Append(Environment.NewLine);
356 sb.Append( 356 sb.Append(
357 string.Format( 357 string.Format(
358 "{0,6:0} {1,6:0} {2,6:0} {3,6:0} {4,6:0} {5,6:0.0} {6,6:0.0} {7,6:0.0} {8,6:0.0} {9,6:0.0} {10,6:0.0}", 358 "{0,6:0} {1,6:0} {2,6:0} {3,6:0} {4,6:0} {5,6:0.0} {6,6:0.0} {7,6:0.0} {8,6:0.0} {9,6:0.0} {10,6:0.0}\n\n",
359 inPacketsPerSecond, outPacketsPerSecond, pendingDownloads, pendingUploads, unackedBytes, totalFrameTime, 359 inPacketsPerSecond, outPacketsPerSecond, pendingDownloads, pendingUploads, unackedBytes, totalFrameTime,
360 netFrameTime, physicsFrameTime, otherFrameTime, agentFrameTime, imageFrameTime)); 360 netFrameTime, physicsFrameTime, otherFrameTime, agentFrameTime, imageFrameTime));
361 sb.Append(Environment.NewLine); 361
362 foreach (KeyValuePair<string, Stat> kvp in StatsManager.RegisteredStats)
363 {
364 Stat stat = kvp.Value;
365
366 if (stat.Category == "scene" && stat.Verbosity == StatVerbosity.Info)
367 {
368 sb.AppendFormat("Slow frames ({0}): {1}\n", stat.Container, stat.Value);
369 }
370 }
362 371
363 /* 372 /*
364 sb.Append(Environment.NewLine); 373 sb.Append(Environment.NewLine);
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs
index d78fa6a..b5dc24f 100644
--- a/OpenSim/Framework/Monitoring/StatsManager.cs
+++ b/OpenSim/Framework/Monitoring/StatsManager.cs
@@ -25,6 +25,9 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System;
29using System.Collections.Generic;
30
28namespace OpenSim.Framework.Monitoring 31namespace OpenSim.Framework.Monitoring
29{ 32{
30 /// <summary> 33 /// <summary>
@@ -32,6 +35,14 @@ namespace OpenSim.Framework.Monitoring
32 /// </summary> 35 /// </summary>
33 public class StatsManager 36 public class StatsManager
34 { 37 {
38 /// <summary>
39 /// Registered stats.
40 /// </summary>
41 /// <remarks>
42 /// Do not add or remove from this dictionary.
43 /// </remarks>
44 public static Dictionary<string, Stat> RegisteredStats = new Dictionary<string, Stat>();
45
35 private static AssetStatsCollector assetStats; 46 private static AssetStatsCollector assetStats;
36 private static UserStatsCollector userStats; 47 private static UserStatsCollector userStats;
37 private static SimExtraStatsCollector simExtraStats = new SimExtraStatsCollector(); 48 private static SimExtraStatsCollector simExtraStats = new SimExtraStatsCollector();
@@ -61,5 +72,139 @@ namespace OpenSim.Framework.Monitoring
61 72
62 return userStats; 73 return userStats;
63 } 74 }
75
76 public static bool RegisterStat(Stat stat)
77 {
78 lock (RegisteredStats)
79 {
80 if (RegisteredStats.ContainsKey(stat.UniqueName))
81 {
82 // XXX: For now just return false. This is to avoid problems in regression tests where all tests
83 // in a class are run in the same instance of the VM.
84 return false;
85
86// throw new Exception(
87// "StatsManager already contains stat with ShortName {0} in Category {1}", stat.ShortName, stat.Category);
88 }
89
90 // We take a replace-on-write approach here so that we don't need to generate a new Dictionary
91 Dictionary<string, Stat> newRegisteredStats = new Dictionary<string, Stat>(RegisteredStats);
92 newRegisteredStats[stat.UniqueName] = stat;
93 RegisteredStats = newRegisteredStats;
94 }
95
96 return true;
97 }
98
99 public static bool DeregisterStat(Stat stat)
100 {
101 lock (RegisteredStats)
102 {
103 if (!RegisteredStats.ContainsKey(stat.UniqueName))
104 return false;
105
106 Dictionary<string, Stat> newRegisteredStats = new Dictionary<string, Stat>(RegisteredStats);
107 newRegisteredStats.Remove(stat.UniqueName);
108 RegisteredStats = newRegisteredStats;
109
110 return true;
111 }
112 }
113 }
114
115 /// <summary>
116 /// Verbosity of stat.
117 /// </summary>
118 /// <remarks>
119 /// Info will always be displayed.
120 /// </remarks>
121 public enum StatVerbosity
122 {
123 Debug,
124 Info
125 }
126
127 /// <summary>
128 /// Holds individual static details
129 /// </summary>
130 public class Stat
131 {
132 /// <summary>
133 /// Unique stat name used for indexing. Each ShortName in a Category must be unique.
134 /// </summary>
135 public string UniqueName { get; private set; }
136
137 /// <summary>
138 /// Category of this stat (e.g. cache, scene, etc).
139 /// </summary>
140 public string Category { get; private set; }
141
142 /// <summary>
143 /// Containing name for this stat.
144 /// FIXME: In the case of a scene, this is currently the scene name (though this leaves
145 /// us with a to-be-resolved problem of non-unique region names).
146 /// </summary>
147 /// <value>
148 /// The container.
149 /// </value>
150 public string Container { get; private set; }
151
152 public StatVerbosity Verbosity { get; private set; }
153 public string ShortName { get; private set; }
154 public string Name { get; private set; }
155 public string Description { get; private set; }
156 public virtual string UnitName { get; private set; }
157
158 public virtual double Value { get; set; }
159
160 public Stat(
161 string shortName, string name, string unitName, string category, string container, StatVerbosity verbosity, string description)
162 {
163 ShortName = shortName;
164 Name = name;
165 UnitName = unitName;
166 Category = category;
167 Container = container;
168 Verbosity = verbosity;
169 Description = description;
170
171 UniqueName = GenUniqueName(Container, Category, ShortName);
172 }
173
174 public static string GenUniqueName(string container, string category, string shortName)
175 {
176 return string.Format("{0}+{1}+{2}", container, category, shortName);
177 }
178 }
179
180 public class PercentageStat : Stat
181 {
182 public int Antecedent { get; set; }
183 public int Consequent { get; set; }
184
185 public override double Value
186 {
187 get
188 {
189 int c = Consequent;
190
191 // Avoid any chance of a multi-threaded divide-by-zero
192 if (c == 0)
193 return 0;
194
195 return (double)Antecedent / c;
196 }
197
198 set
199 {
200 throw new Exception("Cannot set value on a PercentageStat");
201 }
202 }
203
204 public PercentageStat(
205 string shortName, string name, string category, string container, StatVerbosity verbosity, string description)
206 : base(shortName, name, " %", category, container, verbosity, description)
207 {
208 }
64 } 209 }
65} \ No newline at end of file 210} \ No newline at end of file
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 1b9777f..5c7797a 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -534,6 +534,19 @@ namespace OpenSim.Framework
534 } 534 }
535 535
536 /// <summary> 536 /// <summary>
537 /// Determines whether a point is inside a bounding box.
538 /// </summary>
539 /// <param name='v'>/param>
540 /// <param name='min'></param>
541 /// <param name='max'></param>
542 /// <returns></returns>
543 public static bool IsInsideBox(Vector3 v, Vector3 min, Vector3 max)
544 {
545 return v.X >= min.X & v.Y >= min.Y && v.Z >= min.Z
546 && v.X <= max.X && v.Y <= max.Y && v.Z <= max.Z;
547 }
548
549 /// <summary>
537 /// Are the co-ordinates of the new region visible from the old region? 550 /// Are the co-ordinates of the new region visible from the old region?
538 /// </summary> 551 /// </summary>
539 /// <param name="oldx">Old region x-coord</param> 552 /// <param name="oldx">Old region x-coord</param>
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index d05ffea..0869bd5 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -5862,7 +5862,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5862 msgpack.MessageBlock.ID, 5862 msgpack.MessageBlock.ID,
5863 msgpack.MessageBlock.Offline != 0 ? true : false, 5863 msgpack.MessageBlock.Offline != 0 ? true : false,
5864 msgpack.MessageBlock.Position, 5864 msgpack.MessageBlock.Position,
5865 msgpack.MessageBlock.BinaryBucket); 5865 msgpack.MessageBlock.BinaryBucket,
5866 true);
5866 5867
5867 handlerInstantMessage(this, im); 5868 handlerInstantMessage(this, im);
5868 } 5869 }
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 55780d6..d11fcbf 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -222,6 +222,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
222 m_pausedAckTimeout = 1000 * 300; // 5 minutes 222 m_pausedAckTimeout = 1000 * 300; // 5 minutes
223 } 223 }
224 224
225 // FIXME: This actually only needs to be done once since the PacketPool is shared across all servers.
226 // However, there is no harm in temporarily doing it multiple times.
227 IConfig packetConfig = configSource.Configs["PacketPool"];
228 if (packetConfig != null)
229 {
230 PacketPool.Instance.RecyclePackets = packetConfig.GetBoolean("RecyclePackets", true);
231 PacketPool.Instance.RecycleDataBlocks = packetConfig.GetBoolean("RecycleDataBlocks", true);
232 }
233
225 #region BinaryStats 234 #region BinaryStats
226 config = configSource.Configs["Statistics.Binary"]; 235 config = configSource.Configs["Statistics.Binary"];
227 m_shouldCollectStats = false; 236 m_shouldCollectStats = false;
diff --git a/OpenSim/Framework/PacketPool.cs b/OpenSim/Region/ClientStack/Linden/UDP/PacketPool.cs
index 41d17c5..fc9406b 100644
--- a/OpenSim/Framework/PacketPool.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/PacketPool.cs
@@ -32,9 +32,8 @@ using OpenMetaverse;
32using OpenMetaverse.Packets; 32using OpenMetaverse.Packets;
33using log4net; 33using log4net;
34 34
35namespace OpenSim.Framework 35namespace OpenSim.Region.ClientStack.LindenUDP
36{ 36{
37
38 public sealed class PacketPool 37 public sealed class PacketPool
39 { 38 {
40 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 39 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -44,6 +43,9 @@ namespace OpenSim.Framework
44 private bool packetPoolEnabled = true; 43 private bool packetPoolEnabled = true;
45 private bool dataBlockPoolEnabled = true; 44 private bool dataBlockPoolEnabled = true;
46 45
46 /// <summary>
47 /// Pool of packets available for reuse.
48 /// </summary>
47 private readonly Dictionary<PacketType, Stack<Packet>> pool = new Dictionary<PacketType, Stack<Packet>>(); 49 private readonly Dictionary<PacketType, Stack<Packet>> pool = new Dictionary<PacketType, Stack<Packet>>();
48 50
49 private static Dictionary<Type, Stack<Object>> DataBlocks = 51 private static Dictionary<Type, Stack<Object>> DataBlocks =
@@ -244,4 +246,4 @@ namespace OpenSim.Framework
244 } 246 }
245 } 247 }
246 } 248 }
247} 249} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs
index d942e87..5ec0ea9 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs
@@ -141,7 +141,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
141 client.FirstName+" "+client.LastName, 141 client.FirstName+" "+client.LastName,
142 destID, (byte)211, false, 142 destID, (byte)211, false,
143 String.Empty, 143 String.Empty,
144 transactionID, false, new Vector3(), new byte[0]), 144 transactionID, false, new Vector3(), new byte[0], true),
145 delegate(bool success) {} ); 145 delegate(bool success) {} );
146 } 146 }
147 } 147 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
index 91eda19..33b4839 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
@@ -297,6 +297,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
297 }); 297 });
298 } 298 }
299 } 299 }
300
301 // XXX: This code was placed here to try and accomdate RLV which moves given folders named #RLV/~<name>
302 // to a folder called name in #RLV. However, this approach may not be ultimately correct - from analysis
303 // of Firestorm 4.2.2 on sending an InventoryOffered instead of TaskInventoryOffered (as was previously
304 // done), the viewer itself would appear to move and rename the folder, rather than the simulator doing it here.
300 else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) 305 else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted)
301 { 306 {
302 UUID destinationFolderID = UUID.Zero; 307 UUID destinationFolderID = UUID.Zero;
@@ -308,6 +313,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
308 313
309 if (destinationFolderID != UUID.Zero) 314 if (destinationFolderID != UUID.Zero)
310 { 315 {
316 InventoryFolderBase destinationFolder = new InventoryFolderBase(destinationFolderID, client.AgentId);
317 if (destinationFolder == null)
318 {
319 m_log.WarnFormat(
320 "[INVENTORY TRANSFER]: TaskInventoryAccepted message from {0} in {1} specified folder {2} which does not exist",
321 client.Name, scene.Name, destinationFolderID);
322
323 return;
324 }
325
311 IInventoryService invService = scene.InventoryService; 326 IInventoryService invService = scene.InventoryService;
312 327
313 UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip 328 UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
@@ -315,9 +330,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
315 InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); 330 InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId);
316 item = invService.GetItem(item); 331 item = invService.GetItem(item);
317 InventoryFolderBase folder = null; 332 InventoryFolderBase folder = null;
333 UUID? previousParentFolderID = null;
318 334
319 if (item != null) // It's an item 335 if (item != null) // It's an item
320 { 336 {
337 previousParentFolderID = item.Folder;
321 item.Folder = destinationFolderID; 338 item.Folder = destinationFolderID;
322 339
323 invService.DeleteItems(item.Owner, new List<UUID>() { item.ID }); 340 invService.DeleteItems(item.Owner, new List<UUID>() { item.ID });
@@ -330,10 +347,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
330 347
331 if (folder != null) // It's a folder 348 if (folder != null) // It's a folder
332 { 349 {
350 previousParentFolderID = folder.ParentID;
333 folder.ParentID = destinationFolderID; 351 folder.ParentID = destinationFolderID;
334 invService.MoveFolder(folder); 352 invService.MoveFolder(folder);
335 } 353 }
336 } 354 }
355
356 // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code).
357 if (previousParentFolderID != null)
358 {
359 InventoryFolderBase previousParentFolder
360 = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId);
361 previousParentFolder = invService.GetFolder(previousParentFolder);
362 scene.SendInventoryUpdate(client, previousParentFolder, true, true);
363
364 scene.SendInventoryUpdate(client, destinationFolder, true, true);
365 }
337 } 366 }
338 } 367 }
339 else if ( 368 else if (
@@ -354,9 +383,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
354 InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); 383 InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId);
355 item = invService.GetItem(item); 384 item = invService.GetItem(item);
356 InventoryFolderBase folder = null; 385 InventoryFolderBase folder = null;
386 UUID? previousParentFolderID = null;
357 387
358 if (item != null && trashFolder != null) 388 if (item != null && trashFolder != null)
359 { 389 {
390 previousParentFolderID = item.Folder;
360 item.Folder = trashFolder.ID; 391 item.Folder = trashFolder.ID;
361 392
362 // Diva comment: can't we just update this item??? 393 // Diva comment: can't we just update this item???
@@ -372,6 +403,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
372 403
373 if (folder != null & trashFolder != null) 404 if (folder != null & trashFolder != null)
374 { 405 {
406 previousParentFolderID = folder.ParentID;
375 folder.ParentID = trashFolder.ID; 407 folder.ParentID = trashFolder.ID;
376 invService.MoveFolder(folder); 408 invService.MoveFolder(folder);
377 } 409 }
@@ -391,6 +423,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
391 client.SendAgentAlertMessage("Unable to delete "+ 423 client.SendAgentAlertMessage("Unable to delete "+
392 "received inventory" + reason, false); 424 "received inventory" + reason, false);
393 } 425 }
426 // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code).
427 else if (previousParentFolderID != null)
428 {
429 InventoryFolderBase previousParentFolder
430 = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId);
431 previousParentFolder = invService.GetFolder(previousParentFolder);
432 scene.SendInventoryUpdate(client, previousParentFolder, true, true);
433
434 scene.SendInventoryUpdate(client, trashFolder, true, true);
435 }
394 436
395 ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); 437 ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
396 438
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
index 92cf9d1..9c369f6 100644
--- a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
@@ -186,7 +186,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
186 client.FirstName+" "+client.LastName, targetid, 186 client.FirstName+" "+client.LastName, targetid,
187 (byte)InstantMessageDialog.RequestTeleport, false, 187 (byte)InstantMessageDialog.RequestTeleport, false,
188 message, sessionID, false, presence.AbsolutePosition, 188 message, sessionID, false, presence.AbsolutePosition,
189 new Byte[0]); 189 new Byte[0], true);
190 m.RegionID = client.Scene.RegionInfo.RegionID.Guid; 190 m.RegionID = client.Scene.RegionInfo.RegionID.Guid;
191 191
192 m_log.DebugFormat("[HG LURE MODULE]: RequestTeleport sessionID={0}, regionID={1}, message={2}", m.imSessionID, m.RegionID, m.message); 192 m_log.DebugFormat("[HG LURE MODULE]: RequestTeleport sessionID={0}, regionID={1}, message={2}", m.imSessionID, m.RegionID, m.message);
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs
index 2d4cffd..6ce9556 100644
--- a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs
@@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
169 client.FirstName+" "+client.LastName, targetid, 169 client.FirstName+" "+client.LastName, targetid,
170 (byte)InstantMessageDialog.RequestTeleport, false, 170 (byte)InstantMessageDialog.RequestTeleport, false,
171 message, dest, false, presence.AbsolutePosition, 171 message, dest, false, presence.AbsolutePosition,
172 new Byte[0]); 172 new Byte[0], true);
173 173
174 if (m_TransferModule != null) 174 if (m_TransferModule != null)
175 { 175 {
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index b51570f..617a350 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1068,6 +1068,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1068 Scene initiatingScene) 1068 Scene initiatingScene)
1069 { 1069 {
1070 Thread.Sleep(10000); 1070 Thread.Sleep(10000);
1071
1071 IMessageTransferModule im = initiatingScene.RequestModuleInterface<IMessageTransferModule>(); 1072 IMessageTransferModule im = initiatingScene.RequestModuleInterface<IMessageTransferModule>();
1072 if (im != null) 1073 if (im != null)
1073 { 1074 {
@@ -1080,11 +1081,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1080 (uint)(int)position.X, 1081 (uint)(int)position.X,
1081 (uint)(int)position.Y, 1082 (uint)(int)position.Y,
1082 (uint)(int)position.Z); 1083 (uint)(int)position.Z);
1083 GridInstantMessage m = new GridInstantMessage(initiatingScene, UUID.Zero, 1084
1084 "Region", agent.UUID, 1085 GridInstantMessage m
1085 (byte)InstantMessageDialog.GodLikeRequestTeleport, false, 1086 = new GridInstantMessage(
1086 "", gotoLocation, false, new Vector3(127, 0, 0), 1087 initiatingScene,
1087 new Byte[0]); 1088 UUID.Zero,
1089 "Region",
1090 agent.UUID,
1091 (byte)InstantMessageDialog.GodLikeRequestTeleport,
1092 false,
1093 "",
1094 gotoLocation,
1095 false,
1096 new Vector3(127, 0, 0),
1097 new Byte[0],
1098 false);
1099
1088 im.SendInstantMessage(m, delegate(bool success) 1100 im.SendInstantMessage(m, delegate(bool success)
1089 { 1101 {
1090 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Client Initiating Teleport sending IM success = {0}", success); 1102 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Client Initiating Teleport sending IM success = {0}", success);
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs
index e135c21..e411585 100644
--- a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs
@@ -95,14 +95,14 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring
95 { 95 {
96 foreach (IMonitor monitor in m_staticMonitors) 96 foreach (IMonitor monitor in m_staticMonitors)
97 { 97 {
98 m_log.InfoFormat( 98 MainConsole.Instance.OutputFormat(
99 "[MONITOR MODULE]: {0} reports {1} = {2}", 99 "[MONITOR MODULE]: {0} reports {1} = {2}",
100 m_scene.RegionInfo.RegionName, monitor.GetFriendlyName(), monitor.GetFriendlyValue()); 100 m_scene.RegionInfo.RegionName, monitor.GetFriendlyName(), monitor.GetFriendlyValue());
101 } 101 }
102 102
103 foreach (KeyValuePair<string, float> tuple in m_scene.StatsReporter.GetExtraSimStats()) 103 foreach (KeyValuePair<string, float> tuple in m_scene.StatsReporter.GetExtraSimStats())
104 { 104 {
105 m_log.InfoFormat( 105 MainConsole.Instance.OutputFormat(
106 "[MONITOR MODULE]: {0} reports {1} = {2}", 106 "[MONITOR MODULE]: {0} reports {1} = {2}",
107 m_scene.RegionInfo.RegionName, tuple.Key, tuple.Value); 107 m_scene.RegionInfo.RegionName, tuple.Key, tuple.Value);
108 } 108 }
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index 36c84c7..b4811da 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -31,6 +31,7 @@ using System.Reflection;
31 31
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Framework.Console; 33using OpenSim.Framework.Console;
34using OpenSim.Region.ClientStack.LindenUDP;
34using OpenSim.Region.Framework; 35using OpenSim.Region.Framework;
35using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
36using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
index 09f6758..6e39e9a 100644
--- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
@@ -126,6 +126,25 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
126 m_console.Commands.AddCommand( 126 m_console.Commands.AddCommand(
127 "Objects", 127 "Objects",
128 false, 128 false,
129 "show object pos",
130 "show object pos <start-coord> to <end-coord>",
131 "Show details of scene objects within the given area.",
132 "Each component of the coord is comma separated. There must be no spaces between the commas.\n"
133 + "If you don't care about the z component you can simply omit it.\n"
134 + "If you don't care about the x or y components then you can leave them blank (though a comma is still required)\n"
135 + "If you want to specify the maxmimum value of a component then you can use ~ instead of a number\n"
136 + "If you want to specify the minimum value of a component then you can use -~ instead of a number\n"
137 + "e.g.\n"
138 + "show object pos 20,20,20 to 40,40,40\n"
139 + "show object pos 20,20 to 40,40\n"
140 + "show object pos ,20,20 to ,40,40\n"
141 + "show object pos ,,30 to ,,~\n"
142 + "show object pos ,,-~ to ,,30",
143 HandleShowObjectByPos);
144
145 m_console.Commands.AddCommand(
146 "Objects",
147 false,
129 "show part uuid", 148 "show part uuid",
130 "show part uuid <UUID>", 149 "show part uuid <UUID>",
131 "Show details of a scene object parts with the given UUID", HandleShowPartByUuid); 150 "Show details of a scene object parts with the given UUID", HandleShowPartByUuid);
@@ -138,6 +157,25 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
138 "Show details of scene object parts with the given name.", 157 "Show details of scene object parts with the given name.",
139 "If --regex is specified then the name is treatead as a regular expression", 158 "If --regex is specified then the name is treatead as a regular expression",
140 HandleShowPartByName); 159 HandleShowPartByName);
160
161 m_console.Commands.AddCommand(
162 "Objects",
163 false,
164 "show part pos",
165 "show part pos <start-coord> to <end-coord>",
166 "Show details of scene object parts within the given area.",
167 "Each component of the coord is comma separated. There must be no spaces between the commas.\n"
168 + "If you don't care about the z component you can simply omit it.\n"
169 + "If you don't care about the x or y components then you can leave them blank (though a comma is still required)\n"
170 + "If you want to specify the maxmimum value of a component then you can use ~ instead of a number\n"
171 + "If you want to specify the minimum value of a component then you can use -~ instead of a number\n"
172 + "e.g.\n"
173 + "show object pos 20,20,20 to 40,40,40\n"
174 + "show object pos 20,20 to 40,40\n"
175 + "show object pos ,20,20 to ,40,40\n"
176 + "show object pos ,,30 to ,,~\n"
177 + "show object pos ,,-~ to ,,30",
178 HandleShowPartByPos);
141 } 179 }
142 180
143 public void RemoveRegion(Scene scene) 181 public void RemoveRegion(Scene scene)
@@ -150,6 +188,43 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
150// m_log.DebugFormat("[OBJECTS COMMANDS MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); 188// m_log.DebugFormat("[OBJECTS COMMANDS MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
151 } 189 }
152 190
191 private void OutputSogsToConsole(Predicate<SceneObjectGroup> searchPredicate)
192 {
193 List<SceneObjectGroup> sceneObjects = m_scene.GetSceneObjectGroups().FindAll(searchPredicate);
194
195 StringBuilder sb = new StringBuilder();
196
197 foreach (SceneObjectGroup so in sceneObjects)
198 {
199 AddSceneObjectReport(sb, so);
200 sb.Append("\n");
201 }
202
203 sb.AppendFormat("{0} object(s) found in {1}\n", sceneObjects.Count, m_scene.Name);
204
205 m_console.OutputFormat(sb.ToString());
206 }
207
208 private void OutputSopsToConsole(Predicate<SceneObjectPart> searchPredicate)
209 {
210 List<SceneObjectGroup> sceneObjects = m_scene.GetSceneObjectGroups();
211 List<SceneObjectPart> parts = new List<SceneObjectPart>();
212
213 sceneObjects.ForEach(so => parts.AddRange(Array.FindAll<SceneObjectPart>(so.Parts, searchPredicate)));
214
215 StringBuilder sb = new StringBuilder();
216
217 foreach (SceneObjectPart part in parts)
218 {
219 AddScenePartReport(sb, part);
220 sb.Append("\n");
221 }
222
223 sb.AppendFormat("{0} parts found in {1}\n", parts.Count, m_scene.Name);
224
225 m_console.OutputFormat(sb.ToString());
226 }
227
153 private void HandleShowObjectByUuid(string module, string[] cmd) 228 private void HandleShowObjectByUuid(string module, string[] cmd)
154 { 229 {
155 if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene)) 230 if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
@@ -200,36 +275,54 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
200 275
201 string name = mainParams[3]; 276 string name = mainParams[3];
202 277
203 List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); 278 Predicate<SceneObjectGroup> searchPredicate;
204 Action<SceneObjectGroup> searchAction;
205 279
206 if (useRegex) 280 if (useRegex)
207 { 281 {
208 Regex nameRegex = new Regex(name); 282 Regex nameRegex = new Regex(name);
209 searchAction = so => { if (nameRegex.IsMatch(so.Name)) { sceneObjects.Add(so); }}; 283 searchPredicate = so => nameRegex.IsMatch(so.Name);
210 } 284 }
211 else 285 else
212 { 286 {
213 searchAction = so => { if (so.Name == name) { sceneObjects.Add(so); }}; 287 searchPredicate = so => so.Name == name;
214 } 288 }
215 289
216 m_scene.ForEachSOG(searchAction); 290 OutputSogsToConsole(searchPredicate);
291 }
217 292
218 if (sceneObjects.Count == 0) 293 private void HandleShowObjectByPos(string module, string[] cmdparams)
294 {
295 if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
296 return;
297
298 if (cmdparams.Length < 5)
219 { 299 {
220 m_console.OutputFormat("No objects with name {0} found in {1}", name, m_scene.RegionInfo.RegionName); 300 m_console.OutputFormat("Usage: show object pos <start-coord> to <end-coord>");
221 return; 301 return;
222 } 302 }
223 303
224 StringBuilder sb = new StringBuilder(); 304 string rawConsoleStartVector = cmdparams[3];
305 Vector3 startVector;
225 306
226 foreach (SceneObjectGroup so in sceneObjects) 307 if (!ConsoleUtil.TryParseConsoleMinVector(rawConsoleStartVector, out startVector))
227 { 308 {
228 AddSceneObjectReport(sb, so); 309 m_console.OutputFormat("Error: Start vector {0} does not have a valid format", rawConsoleStartVector);
229 sb.Append("\n"); 310 return;
230 } 311 }
231 312
232 m_console.OutputFormat(sb.ToString()); 313 string rawConsoleEndVector = cmdparams[5];
314 Vector3 endVector;
315
316 if (!ConsoleUtil.TryParseConsoleMaxVector(rawConsoleEndVector, out endVector))
317 {
318 m_console.OutputFormat("Error: End vector {0} does not have a valid format", rawConsoleEndVector);
319 return;
320 }
321
322 Predicate<SceneObjectGroup> searchPredicate
323 = so => Util.IsInsideBox(so.AbsolutePosition, startVector, endVector);
324
325 OutputSogsToConsole(searchPredicate);
233 } 326 }
234 327
235 private void HandleShowPartByUuid(string module, string[] cmd) 328 private void HandleShowPartByUuid(string module, string[] cmd)
@@ -264,6 +357,38 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
264 m_console.OutputFormat(sb.ToString()); 357 m_console.OutputFormat(sb.ToString());
265 } 358 }
266 359
360 private void HandleShowPartByPos(string module, string[] cmdparams)
361 {
362 if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
363 return;
364
365 if (cmdparams.Length < 5)
366 {
367 m_console.OutputFormat("Usage: show part pos <start-coord> to <end-coord>");
368 return;
369 }
370
371 string rawConsoleStartVector = cmdparams[3];
372 Vector3 startVector;
373
374 if (!ConsoleUtil.TryParseConsoleMinVector(rawConsoleStartVector, out startVector))
375 {
376 m_console.OutputFormat("Error: Start vector {0} does not have a valid format", rawConsoleStartVector);
377 return;
378 }
379
380 string rawConsoleEndVector = cmdparams[5];
381 Vector3 endVector;
382
383 if (!ConsoleUtil.TryParseConsoleMaxVector(rawConsoleEndVector, out endVector))
384 {
385 m_console.OutputFormat("Error: End vector {0} does not have a valid format", rawConsoleEndVector);
386 return;
387 }
388
389 OutputSopsToConsole(sop => Util.IsInsideBox(sop.AbsolutePosition, startVector, endVector));
390 }
391
267 private void HandleShowPartByName(string module, string[] cmdparams) 392 private void HandleShowPartByName(string module, string[] cmdparams)
268 { 393 {
269 if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene)) 394 if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
@@ -282,37 +407,19 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
282 407
283 string name = mainParams[3]; 408 string name = mainParams[3];
284 409
285 List<SceneObjectPart> parts = new List<SceneObjectPart>(); 410 Predicate<SceneObjectPart> searchPredicate;
286
287 Action<SceneObjectGroup> searchAction;
288 411
289 if (useRegex) 412 if (useRegex)
290 { 413 {
291 Regex nameRegex = new Regex(name); 414 Regex nameRegex = new Regex(name);
292 searchAction = so => so.ForEachPart(sop => { if (nameRegex.IsMatch(sop.Name)) { parts.Add(sop); } }); 415 searchPredicate = sop => nameRegex.IsMatch(sop.Name);
293 } 416 }
294 else 417 else
295 { 418 {
296 searchAction = so => so.ForEachPart(sop => { if (sop.Name == name) { parts.Add(sop); } }); 419 searchPredicate = sop => sop.Name == name;
297 } 420 }
298 421
299 m_scene.ForEachSOG(searchAction); 422 OutputSopsToConsole(searchPredicate);
300
301 if (parts.Count == 0)
302 {
303 m_console.OutputFormat("No parts with name {0} found in {1}", name, m_scene.RegionInfo.RegionName);
304 return;
305 }
306
307 StringBuilder sb = new StringBuilder();
308
309 foreach (SceneObjectPart part in parts)
310 {
311 AddScenePartReport(sb, part);
312 sb.Append("\n");
313 }
314
315 m_console.OutputFormat(sb.ToString());
316 } 423 }
317 424
318 private StringBuilder AddSceneObjectReport(StringBuilder sb, SceneObjectGroup so) 425 private StringBuilder AddSceneObjectReport(StringBuilder sb, SceneObjectGroup so)
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 @@
1using 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
28using System;
2using System.Collections.Generic; 29using System.Collections.Generic;
3 30
4using OpenMetaverse; 31using 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)
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index a8e4d90..ffd4222 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -148,7 +148,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
148 OnInstantMessage(this, new GridInstantMessage(m_scene, 148 OnInstantMessage(this, new GridInstantMessage(m_scene,
149 m_uuid, m_firstname + " " + m_lastname, 149 m_uuid, m_firstname + " " + m_lastname,
150 target, 0, false, message, 150 target, 0, false, message,
151 UUID.Zero, false, Position, new byte[0])); 151 UUID.Zero, false, Position, new byte[0], true));
152 } 152 }
153 153
154 public void SendAgentOffline(UUID[] agentIDs) 154 public void SendAgentOffline(UUID[] agentIDs)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 7fa6f05..7620df3 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3978,7 +3978,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3978 World.RegionInfo.RegionName+" "+ 3978 World.RegionInfo.RegionName+" "+
3979 m_host.AbsolutePosition.ToString(), 3979 m_host.AbsolutePosition.ToString(),
3980 agentItem.ID, true, m_host.AbsolutePosition, 3980 agentItem.ID, true, m_host.AbsolutePosition,
3981 bucket); 3981 bucket, true); // TODO: May actually send no timestamp
3982 3982
3983 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); 3983 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
3984 } 3984 }
@@ -6452,16 +6452,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6452 if (m_TransferModule != null) 6452 if (m_TransferModule != null)
6453 { 6453 {
6454 byte[] bucket = new byte[] { (byte)AssetType.Folder }; 6454 byte[] bucket = new byte[] { (byte)AssetType.Folder };
6455 6455
6456 Vector3 pos = m_host.AbsolutePosition;
6457
6456 GridInstantMessage msg = new GridInstantMessage(World, 6458 GridInstantMessage msg = new GridInstantMessage(World,
6457 m_host.UUID, m_host.Name + ", an object owned by " + 6459 m_host.OwnerID, m_host.Name, destID,
6458 resolveName(m_host.OwnerID) + ",", destID,
6459 (byte)InstantMessageDialog.TaskInventoryOffered, 6460 (byte)InstantMessageDialog.TaskInventoryOffered,
6460 false, category + "\n" + m_host.Name + " is located at " + 6461 false, string.Format("'{0}'"),
6461 World.RegionInfo.RegionName + " " + 6462// We won't go so far as to add a SLURL, but this is the format used by LL as of 2012-10-06
6462 m_host.AbsolutePosition.ToString(), 6463// false, string.Format("'{0}' ( http://slurl.com/secondlife/{1}/{2}/{3}/{4} )", category, World.Name, (int)pos.X, (int)pos.Y, (int)pos.Z),
6463 folderID, true, m_host.AbsolutePosition, 6464 folderID, false, pos,
6464 bucket); 6465 bucket, false);
6465 6466
6466 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); 6467 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
6467 } 6468 }
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index c11ea02..625eba4 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Region.UserStatistics
61 /// <summary> 61 /// <summary>
62 /// User statistics sessions keyed by agent ID 62 /// User statistics sessions keyed by agent ID
63 /// </summary> 63 /// </summary>
64 private Dictionary<UUID, UserSessionID> m_sessions = new Dictionary<UUID, UserSessionID>(); 64 private Dictionary<UUID, UserSession> m_sessions = new Dictionary<UUID, UserSession>();
65 65
66 private List<Scene> m_scenes = new List<Scene>(); 66 private List<Scene> m_scenes = new List<Scene>();
67 private Dictionary<string, IStatsController> reports = new Dictionary<string, IStatsController>(); 67 private Dictionary<string, IStatsController> reports = new Dictionary<string, IStatsController>();
@@ -319,14 +319,18 @@ namespace OpenSim.Region.UserStatistics
319 319
320 private void OnMakeRootAgent(ScenePresence agent) 320 private void OnMakeRootAgent(ScenePresence agent)
321 { 321 {
322// m_log.DebugFormat(
323// "[WEB STATS MODULE]: Looking for session {0} for {1} in {2}",
324// agent.ControllingClient.SessionId, agent.Name, agent.Scene.Name);
325
322 lock (m_sessions) 326 lock (m_sessions)
323 { 327 {
324 UserSessionID uid; 328 UserSession uid;
325 329
326 if (!m_sessions.ContainsKey(agent.UUID)) 330 if (!m_sessions.ContainsKey(agent.UUID))
327 { 331 {
328 UserSessionData usd = UserSessionUtil.newUserSessionData(); 332 UserSessionData usd = UserSessionUtil.newUserSessionData();
329 uid = new UserSessionID(); 333 uid = new UserSession();
330 uid.name_f = agent.Firstname; 334 uid.name_f = agent.Firstname;
331 uid.name_l = agent.Lastname; 335 uid.name_l = agent.Lastname;
332 uid.session_data = usd; 336 uid.session_data = usd;
@@ -411,9 +415,9 @@ namespace OpenSim.Region.UserStatistics
411 return String.Empty; 415 return String.Empty;
412 } 416 }
413 417
414 private UserSessionID ParseViewerStats(string request, UUID agentID) 418 private UserSession ParseViewerStats(string request, UUID agentID)
415 { 419 {
416 UserSessionID uid = new UserSessionID(); 420 UserSession uid = new UserSession();
417 UserSessionData usd; 421 UserSessionData usd;
418 OSD message = OSDParser.DeserializeLLSDXml(request); 422 OSD message = OSDParser.DeserializeLLSDXml(request);
419 OSDMap mmap; 423 OSDMap mmap;
@@ -425,22 +429,25 @@ namespace OpenSim.Region.UserStatistics
425 if (!m_sessions.ContainsKey(agentID)) 429 if (!m_sessions.ContainsKey(agentID))
426 { 430 {
427 m_log.WarnFormat("[WEB STATS MODULE]: no session for stat disclosure for agent {0}", agentID); 431 m_log.WarnFormat("[WEB STATS MODULE]: no session for stat disclosure for agent {0}", agentID);
428 return new UserSessionID(); 432 return new UserSession();
429 } 433 }
434
430 uid = m_sessions[agentID]; 435 uid = m_sessions[agentID];
436
437// m_log.DebugFormat("[WEB STATS MODULE]: Got session {0} for {1}", uid.session_id, agentID);
431 } 438 }
432 else 439 else
433 { 440 {
434 // parse through the beginning to locate the session 441 // parse through the beginning to locate the session
435 if (message.Type != OSDType.Map) 442 if (message.Type != OSDType.Map)
436 return new UserSessionID(); 443 return new UserSession();
437 444
438 mmap = (OSDMap)message; 445 mmap = (OSDMap)message;
439 { 446 {
440 UUID sessionID = mmap["session_id"].AsUUID(); 447 UUID sessionID = mmap["session_id"].AsUUID();
441 448
442 if (sessionID == UUID.Zero) 449 if (sessionID == UUID.Zero)
443 return new UserSessionID(); 450 return new UserSession();
444 451
445 452
446 // search through each session looking for the owner 453 // search through each session looking for the owner
@@ -459,7 +466,7 @@ namespace OpenSim.Region.UserStatistics
459 // can't find a session 466 // can't find a session
460 if (agentID == UUID.Zero) 467 if (agentID == UUID.Zero)
461 { 468 {
462 return new UserSessionID(); 469 return new UserSession();
463 } 470 }
464 } 471 }
465 } 472 }
@@ -468,12 +475,12 @@ namespace OpenSim.Region.UserStatistics
468 usd = uid.session_data; 475 usd = uid.session_data;
469 476
470 if (message.Type != OSDType.Map) 477 if (message.Type != OSDType.Map)
471 return new UserSessionID(); 478 return new UserSession();
472 479
473 mmap = (OSDMap)message; 480 mmap = (OSDMap)message;
474 { 481 {
475 if (mmap["agent"].Type != OSDType.Map) 482 if (mmap["agent"].Type != OSDType.Map)
476 return new UserSessionID(); 483 return new UserSession();
477 OSDMap agent_map = (OSDMap)mmap["agent"]; 484 OSDMap agent_map = (OSDMap)mmap["agent"];
478 usd.agent_id = agentID; 485 usd.agent_id = agentID;
479 usd.name_f = uid.name_f; 486 usd.name_f = uid.name_f;
@@ -493,17 +500,18 @@ namespace OpenSim.Region.UserStatistics
493 (float)agent_map["fps"].AsReal()); 500 (float)agent_map["fps"].AsReal());
494 501
495 if (mmap["downloads"].Type != OSDType.Map) 502 if (mmap["downloads"].Type != OSDType.Map)
496 return new UserSessionID(); 503 return new UserSession();
497 OSDMap downloads_map = (OSDMap)mmap["downloads"]; 504 OSDMap downloads_map = (OSDMap)mmap["downloads"];
498 usd.d_object_kb = (float)downloads_map["object_kbytes"].AsReal(); 505 usd.d_object_kb = (float)downloads_map["object_kbytes"].AsReal();
499 usd.d_texture_kb = (float)downloads_map["texture_kbytes"].AsReal(); 506 usd.d_texture_kb = (float)downloads_map["texture_kbytes"].AsReal();
500 usd.d_world_kb = (float)downloads_map["workd_kbytes"].AsReal(); 507 usd.d_world_kb = (float)downloads_map["workd_kbytes"].AsReal();
501 508
509// m_log.DebugFormat("[WEB STATS MODULE]: mmap[\"session_id\"] = [{0}]", mmap["session_id"].AsUUID());
502 510
503 usd.session_id = mmap["session_id"].AsUUID(); 511 usd.session_id = mmap["session_id"].AsUUID();
504 512
505 if (mmap["system"].Type != OSDType.Map) 513 if (mmap["system"].Type != OSDType.Map)
506 return new UserSessionID(); 514 return new UserSession();
507 OSDMap system_map = (OSDMap)mmap["system"]; 515 OSDMap system_map = (OSDMap)mmap["system"];
508 516
509 usd.s_cpu = system_map["cpu"].AsString(); 517 usd.s_cpu = system_map["cpu"].AsString();
@@ -512,13 +520,13 @@ namespace OpenSim.Region.UserStatistics
512 usd.s_ram = system_map["ram"].AsInteger(); 520 usd.s_ram = system_map["ram"].AsInteger();
513 521
514 if (mmap["stats"].Type != OSDType.Map) 522 if (mmap["stats"].Type != OSDType.Map)
515 return new UserSessionID(); 523 return new UserSession();
516 524
517 OSDMap stats_map = (OSDMap)mmap["stats"]; 525 OSDMap stats_map = (OSDMap)mmap["stats"];
518 { 526 {
519 527
520 if (stats_map["failures"].Type != OSDType.Map) 528 if (stats_map["failures"].Type != OSDType.Map)
521 return new UserSessionID(); 529 return new UserSession();
522 OSDMap stats_failures = (OSDMap)stats_map["failures"]; 530 OSDMap stats_failures = (OSDMap)stats_map["failures"];
523 usd.f_dropped = stats_failures["dropped"].AsInteger(); 531 usd.f_dropped = stats_failures["dropped"].AsInteger();
524 usd.f_failed_resends = stats_failures["failed_resends"].AsInteger(); 532 usd.f_failed_resends = stats_failures["failed_resends"].AsInteger();
@@ -527,18 +535,18 @@ namespace OpenSim.Region.UserStatistics
527 usd.f_send_packet = stats_failures["send_packet"].AsInteger(); 535 usd.f_send_packet = stats_failures["send_packet"].AsInteger();
528 536
529 if (stats_map["net"].Type != OSDType.Map) 537 if (stats_map["net"].Type != OSDType.Map)
530 return new UserSessionID(); 538 return new UserSession();
531 OSDMap stats_net = (OSDMap)stats_map["net"]; 539 OSDMap stats_net = (OSDMap)stats_map["net"];
532 { 540 {
533 if (stats_net["in"].Type != OSDType.Map) 541 if (stats_net["in"].Type != OSDType.Map)
534 return new UserSessionID(); 542 return new UserSession();
535 543
536 OSDMap net_in = (OSDMap)stats_net["in"]; 544 OSDMap net_in = (OSDMap)stats_net["in"];
537 usd.n_in_kb = (float)net_in["kbytes"].AsReal(); 545 usd.n_in_kb = (float)net_in["kbytes"].AsReal();
538 usd.n_in_pk = net_in["packets"].AsInteger(); 546 usd.n_in_pk = net_in["packets"].AsInteger();
539 547
540 if (stats_net["out"].Type != OSDType.Map) 548 if (stats_net["out"].Type != OSDType.Map)
541 return new UserSessionID(); 549 return new UserSession();
542 OSDMap net_out = (OSDMap)stats_net["out"]; 550 OSDMap net_out = (OSDMap)stats_net["out"];
543 551
544 usd.n_out_kb = (float)net_out["kbytes"].AsReal(); 552 usd.n_out_kb = (float)net_out["kbytes"].AsReal();
@@ -549,11 +557,18 @@ namespace OpenSim.Region.UserStatistics
549 557
550 uid.session_data = usd; 558 uid.session_data = usd;
551 m_sessions[agentID] = uid; 559 m_sessions[agentID] = uid;
560
561// m_log.DebugFormat(
562// "[WEB STATS MODULE]: Parse data for {0} {1}, session {2}", uid.name_f, uid.name_l, uid.session_id);
563
552 return uid; 564 return uid;
553 } 565 }
554 566
555 private void UpdateUserStats(UserSessionID uid, SqliteConnection db) 567 private void UpdateUserStats(UserSession uid, SqliteConnection db)
556 { 568 {
569// m_log.DebugFormat(
570// "[WEB STATS MODULE]: Updating user stats for {0} {1}, session {2}", uid.name_f, uid.name_l, uid.session_id);
571
557 if (uid.session_id == UUID.Zero) 572 if (uid.session_id == UUID.Zero)
558 return; 573 return;
559 574
@@ -740,7 +755,6 @@ VALUES
740 s.min_ping = ArrayMin_f(__ping); 755 s.min_ping = ArrayMin_f(__ping);
741 s.max_ping = ArrayMax_f(__ping); 756 s.max_ping = ArrayMax_f(__ping);
742 s.mode_ping = ArrayMode_f(__ping); 757 s.mode_ping = ArrayMode_f(__ping);
743
744 } 758 }
745 759
746 #region Statistics 760 #region Statistics
@@ -985,7 +999,7 @@ VALUES
985 } 999 }
986 #region structs 1000 #region structs
987 1001
988 public struct UserSessionID 1002 public class UserSession
989 { 1003 {
990 public UUID session_id; 1004 public UUID session_id;
991 public UUID region_id; 1005 public UUID region_id;
diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs
index 575d560..be12f8a 100644
--- a/OpenSim/Server/ServerMain.cs
+++ b/OpenSim/Server/ServerMain.cs
@@ -65,10 +65,29 @@ namespace OpenSim.Server
65 } 65 }
66 66
67 string connList = serverConfig.GetString("ServiceConnectors", String.Empty); 67 string connList = serverConfig.GetString("ServiceConnectors", String.Empty);
68 string[] conns = connList.Split(new char[] {',', ' '});
69 68
70 registryLocation = serverConfig.GetString("RegistryLocation","."); 69 registryLocation = serverConfig.GetString("RegistryLocation",".");
71 70
71 IConfig servicesConfig = m_Server.Config.Configs["ServiceList"];
72 if (servicesConfig != null)
73 {
74 List<string> servicesList = new List<string>();
75 if (connList != String.Empty)
76 servicesList.Add(connList);
77
78 foreach (string k in servicesConfig.GetKeys())
79 {
80 string v = servicesConfig.GetString(k);
81 if (v != String.Empty)
82 servicesList.Add(v);
83 }
84
85 connList = String.Join(",", servicesList.ToArray());
86 }
87
88 string[] conns = connList.Split(new char[] {',', ' ', '\n', '\r', '\t'});
89>>>>>>> master
90
72// int i = 0; 91// int i = 0;
73 foreach (string c in conns) 92 foreach (string c in conns)
74 { 93 {
@@ -140,4 +159,4 @@ namespace OpenSim.Server
140 return 0; 159 return 0;
141 } 160 }
142 } 161 }
143} \ No newline at end of file 162}
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
index 086b5ad..2b2f11f 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
@@ -47,7 +47,8 @@ namespace OpenSim.Services.Connectors
47 47
48 private string m_ServerURI = String.Empty; 48 private string m_ServerURI = String.Empty;
49 private IImprovedAssetCache m_Cache = null; 49 private IImprovedAssetCache m_Cache = null;
50 50 private int m_maxAssetRequestConcurrency = 30;
51
51 private delegate void AssetRetrievedEx(AssetBase asset); 52 private delegate void AssetRetrievedEx(AssetBase asset);
52 53
53 // Keeps track of concurrent requests for the same asset, so that it's only loaded once. 54 // Keeps track of concurrent requests for the same asset, so that it's only loaded once.
@@ -71,6 +72,10 @@ namespace OpenSim.Services.Connectors
71 72
72 public virtual void Initialise(IConfigSource source) 73 public virtual void Initialise(IConfigSource source)
73 { 74 {
75 IConfig netconfig = source.Configs["Network"];
76 if (netconfig != null)
77 m_maxAssetRequestConcurrency = netconfig.GetInt("MaxRequestConcurrency",m_maxAssetRequestConcurrency);
78
74 IConfig assetConfig = source.Configs["AssetService"]; 79 IConfig assetConfig = source.Configs["AssetService"];
75 if (assetConfig == null) 80 if (assetConfig == null)
76 { 81 {
@@ -108,7 +113,7 @@ namespace OpenSim.Services.Connectors
108 if (asset == null) 113 if (asset == null)
109 { 114 {
110 asset = SynchronousRestObjectRequester. 115 asset = SynchronousRestObjectRequester.
111 MakeRequest<int, AssetBase>("GET", uri, 0, 30); 116 MakeRequest<int, AssetBase>("GET", uri, 0, m_maxAssetRequestConcurrency);
112 117
113 if (m_Cache != null) 118 if (m_Cache != null)
114 m_Cache.Cache(asset); 119 m_Cache.Cache(asset);
@@ -221,7 +226,7 @@ namespace OpenSim.Services.Connectors
221 m_AssetHandlers.Remove(id); 226 m_AssetHandlers.Remove(id);
222 } 227 }
223 handlers.Invoke(a); 228 handlers.Invoke(a);
224 }, 30); 229 }, m_maxAssetRequestConcurrency);
225 230
226 success = true; 231 success = true;
227 } 232 }
diff --git a/OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs b/OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs
index 20d7eaf..94bda82 100644
--- a/OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs
+++ b/OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs
@@ -207,7 +207,7 @@ namespace OpenSim.Services.Connectors
207 if ((replyData != null) && replyData.ContainsKey("result") && (replyData["result"] != null)) 207 if ((replyData != null) && replyData.ContainsKey("result") && (replyData["result"] != null))
208 { 208 {
209 if (replyData["result"] is Dictionary<string, object>) 209 if (replyData["result"] is Dictionary<string, object>)
210 guinfo = new GridUserInfo((Dictionary<string, object>)replyData["result"]); 210 guinfo = Create((Dictionary<string, object>)replyData["result"]);
211 } 211 }
212 212
213 return guinfo; 213 return guinfo;
@@ -273,7 +273,7 @@ namespace OpenSim.Services.Connectors
273 { 273 {
274 if (griduser is Dictionary<string, object>) 274 if (griduser is Dictionary<string, object>)
275 { 275 {
276 GridUserInfo pinfo = new GridUserInfo((Dictionary<string, object>)griduser); 276 GridUserInfo pinfo = Create((Dictionary<string, object>)griduser);
277 rinfos.Add(pinfo); 277 rinfos.Add(pinfo);
278 } 278 }
279 else 279 else
@@ -286,5 +286,10 @@ namespace OpenSim.Services.Connectors
286 286
287 return rinfos.ToArray(); 287 return rinfos.ToArray();
288 } 288 }
289
290 protected virtual GridUserInfo Create(Dictionary<string, object> griduser)
291 {
292 return new GridUserInfo(griduser);
293 }
289 } 294 }
290} 295}