aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs173
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs1
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs18
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs8
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs12
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs5
-rw-r--r--OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs15
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs1
-rw-r--r--OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs53
-rw-r--r--OpenSim/Region/CoreModules/World/Sound/SoundModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Warp3DMap/Perlin.cs4
-rw-r--r--OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs348
17 files changed, 466 insertions, 200 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 7a188fd..1c84e3f 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -283,10 +283,6 @@ namespace OpenSim
283 "kick user <first> <last> [message]", 283 "kick user <first> <last> [message]",
284 "Kick a user off the simulator", KickUserCommand); 284 "Kick a user off the simulator", KickUserCommand);
285 285
286 m_console.Commands.AddCommand("region", false, "show assets",
287 "show assets",
288 "Show asset data", HandleShow);
289
290 m_console.Commands.AddCommand("region", false, "show users", 286 m_console.Commands.AddCommand("region", false, "show users",
291 "show users [full]", 287 "show users [full]",
292 "Show user data for users currently on the region", 288 "Show user data for users currently on the region",
@@ -305,13 +301,6 @@ namespace OpenSim
305 m_console.Commands.AddCommand("region", false, "show regions", 301 m_console.Commands.AddCommand("region", false, "show regions",
306 "show regions", 302 "show regions",
307 "Show region data", HandleShow); 303 "Show region data", HandleShow);
308
309 m_console.Commands.AddCommand("region", false, "show queues",
310 "show queues [full]",
311 "Show queue data for each client",
312 "Without the 'full' option, only users actually on the region are shown."
313 + " With the 'full' option child agents of users in neighbouring regions are also shown.",
314 HandleShow);
315 304
316 m_console.Commands.AddCommand("region", false, "show ratings", 305 m_console.Commands.AddCommand("region", false, "show ratings",
317 "show ratings", 306 "show ratings",
@@ -335,16 +324,19 @@ namespace OpenSim
335 "Restart all sims in this instance", RunCommand); 324 "Restart all sims in this instance", RunCommand);
336 325
337 m_console.Commands.AddCommand("region", false, "config set", 326 m_console.Commands.AddCommand("region", false, "config set",
338 "config set <section> <field> <value>", 327 "config set <section> <key> <value>",
339 "Set a config option", HandleConfig); 328 "Set a config option. In most cases this is not useful since changed parameters are not dynamically reloaded. Neither do changed parameters persist - you will have to change a config file manually and restart.", HandleConfig);
340 329
341 m_console.Commands.AddCommand("region", false, "config get", 330 m_console.Commands.AddCommand("region", false, "config get",
342 "config get <section> <field>", 331 "config get [<section>] [<key>]",
343 "Read a config option", HandleConfig); 332 "Show a config option",
333 "If neither section nor field are specified, then the whole current configuration is printed." + Environment.NewLine
334 + "If a section is given but not a field, then all fields in that section are printed.",
335 HandleConfig);
344 336
345 m_console.Commands.AddCommand("region", false, "config save", 337 m_console.Commands.AddCommand("region", false, "config save",
346 "config save", 338 "config save <path>",
347 "Save current configuration", HandleConfig); 339 "Save current configuration to a file at the given path", HandleConfig);
348 340
349 m_console.Commands.AddCommand("region", false, "command-script", 341 m_console.Commands.AddCommand("region", false, "command-script",
350 "command-script <script>", 342 "command-script <script>",
@@ -586,7 +578,6 @@ namespace OpenSim
586 List<string> args = new List<string>(cmd); 578 List<string> args = new List<string>(cmd);
587 args.RemoveAt(0); 579 args.RemoveAt(0);
588 string[] cmdparams = args.ToArray(); 580 string[] cmdparams = args.ToArray();
589 string n = "CONFIG";
590 581
591 if (cmdparams.Length > 0) 582 if (cmdparams.Length > 0)
592 { 583 {
@@ -595,8 +586,8 @@ namespace OpenSim
595 case "set": 586 case "set":
596 if (cmdparams.Length < 4) 587 if (cmdparams.Length < 4)
597 { 588 {
598 MainConsole.Instance.Output(String.Format("SYNTAX: {0} SET SECTION KEY VALUE",n)); 589 Notice("Syntax: config set <section> <key> <value>");
599 MainConsole.Instance.Output(String.Format("EXAMPLE: {0} SET ScriptEngine.DotNetEngine NumberOfScriptThreads 5",n)); 590 Notice("Example: config set ScriptEngine.DotNetEngine NumberOfScriptThreads 5");
600 } 591 }
601 else 592 else
602 { 593 {
@@ -609,48 +600,68 @@ namespace OpenSim
609 c.Set(cmdparams[2], _value); 600 c.Set(cmdparams[2], _value);
610 m_config.Source.Merge(source); 601 m_config.Source.Merge(source);
611 602
612 MainConsole.Instance.Output(String.Format("{0} {0} {1} {2} {3}",n,cmdparams[1],cmdparams[2],_value)); 603 Notice("In section [{0}], set {1} = {2}", c.Name, cmdparams[2], _value);
613 } 604 }
614 } 605 }
615 break; 606 break;
616 607
617 case "get": 608 case "get":
618 if (cmdparams.Length < 3) 609 if (cmdparams.Length == 1)
619 { 610 {
620 MainConsole.Instance.Output(String.Format("SYNTAX: {0} GET SECTION KEY",n)); 611 foreach (IConfig config in m_config.Source.Configs)
621 MainConsole.Instance.Output(String.Format("EXAMPLE: {0} GET ScriptEngine.DotNetEngine NumberOfScriptThreads",n)); 612 {
613 Notice("[{0}]", config.Name);
614 string[] keys = config.GetKeys();
615 foreach (string key in keys)
616 Notice(" {0} = {1}", key, config.GetString(key));
617 }
622 } 618 }
623 else 619 else if (cmdparams.Length == 2 || cmdparams.Length == 3)
624 { 620 {
625 IConfig c = m_config.Source.Configs[cmdparams[1]]; 621 IConfig config = m_config.Source.Configs[cmdparams[1]];
626 if (c == null) 622 if (config == null)
627 { 623 {
628 MainConsole.Instance.Output(String.Format("Section \"{0}\" does not exist.",cmdparams[1])); 624 Notice("Section \"{0}\" does not exist.",cmdparams[1]);
629 break; 625 break;
630 } 626 }
631 else 627 else
632 { 628 {
633 MainConsole.Instance.Output(String.Format("{0} GET {1} {2} : {3}",n,cmdparams[1],cmdparams[2], 629 if (cmdparams.Length == 2)
634 c.GetString(cmdparams[2]))); 630 {
631 Notice("[{0}]", config.Name);
632 foreach (string key in config.GetKeys())
633 Notice(" {0} = {1}", key, config.GetString(key));
634 }
635 else
636 {
637 Notice(
638 "config get {0} {1} : {2}",
639 cmdparams[1], cmdparams[2], config.GetString(cmdparams[2]));
640 }
635 } 641 }
636 } 642 }
643 else
644 {
645 Notice("Syntax: config get [<section>] [<key>]");
646 Notice("Example: config get ScriptEngine.DotNetEngine NumberOfScriptThreads");
647 }
637 648
638 break; 649 break;
639 650
640 case "save": 651 case "save":
641 if (cmdparams.Length < 2) 652 if (cmdparams.Length < 2)
642 { 653 {
643 MainConsole.Instance.Output("SYNTAX: " + n + " SAVE FILE"); 654 Notice("Syntax: config save <path>");
644 return; 655 return;
645 } 656 }
646 657
647 if (Application.iniFilePath == cmdparams[1]) 658 if (Application.iniFilePath == cmdparams[1])
648 { 659 {
649 MainConsole.Instance.Output("FILE can not be " + Application.iniFilePath); 660 Notice("Path can not be " + Application.iniFilePath);
650 return; 661 return;
651 } 662 }
652 663
653 MainConsole.Instance.Output("Saving configuration file: " + cmdparams[1]); 664 Notice("Saving configuration file: " + cmdparams[1]);
654 m_config.Save(cmdparams[1]); 665 m_config.Save(cmdparams[1]);
655 break; 666 break;
656 } 667 }
@@ -869,10 +880,6 @@ namespace OpenSim
869 880
870 switch (showParams[0]) 881 switch (showParams[0])
871 { 882 {
872 case "assets":
873 MainConsole.Instance.Output("Not implemented.");
874 break;
875
876 case "users": 883 case "users":
877 IList agents; 884 IList agents;
878 if (showParams.Length > 1 && showParams[1] == "full") 885 if (showParams.Length > 1 && showParams[1] == "full")
@@ -959,10 +966,6 @@ namespace OpenSim
959 }); 966 });
960 break; 967 break;
961 968
962 case "queues":
963 Notice(GetQueuesReport(showParams));
964 break;
965
966 case "ratings": 969 case "ratings":
967 m_sceneManager.ForEachScene( 970 m_sceneManager.ForEachScene(
968 delegate(Scene scene) 971 delegate(Scene scene)
@@ -990,94 +993,6 @@ namespace OpenSim
990 } 993 }
991 994
992 /// <summary> 995 /// <summary>
993 /// Generate UDP Queue data report for each client
994 /// </summary>
995 /// <param name="showParams"></param>
996 /// <returns></returns>
997 private string GetQueuesReport(string[] showParams)
998 {
999 bool showChildren = false;
1000
1001 if (showParams.Length > 1 && showParams[1] == "full")
1002 showChildren = true;
1003
1004 StringBuilder report = new StringBuilder();
1005
1006 int columnPadding = 2;
1007 int maxNameLength = 18;
1008 int maxRegionNameLength = 14;
1009 int maxTypeLength = 4;
1010 int totalInfoFieldsLength = maxNameLength + columnPadding + maxRegionNameLength + columnPadding + maxTypeLength + columnPadding;
1011
1012 report.AppendFormat("{0,-" + maxNameLength + "}{1,-" + columnPadding + "}", "User", "");
1013 report.AppendFormat("{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}", "Region", "");
1014 report.AppendFormat("{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}", "Type", "");
1015
1016 report.AppendFormat(
1017 "{0,9} {1,9} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}\n",
1018 "Packets",
1019 "Packets",
1020 "Bytes",
1021 "Bytes",
1022 "Bytes",
1023 "Bytes",
1024 "Bytes",
1025 "Bytes",
1026 "Bytes",
1027 "Bytes",
1028 "Bytes");
1029
1030 report.AppendFormat("{0,-" + totalInfoFieldsLength + "}", "");
1031 report.AppendFormat(
1032 "{0,9} {1,9} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}\n",
1033 "Out",
1034 "In",
1035 "Unacked",
1036 "Resend",
1037 "Land",
1038 "Wind",
1039 "Cloud",
1040 "Task",
1041 "Texture",
1042 "Asset",
1043 "State");
1044
1045 m_sceneManager.ForEachScene(
1046 delegate(Scene scene)
1047 {
1048 scene.ForEachClient(
1049 delegate(IClientAPI client)
1050 {
1051 if (client is IStatsCollector)
1052 {
1053 bool isChild = scene.PresenceChildStatus(client.AgentId);
1054 if (isChild && !showChildren)
1055 return;
1056
1057 string name = client.Name;
1058 string regionName = scene.RegionInfo.RegionName;
1059
1060 report.AppendFormat(
1061 "{0,-" + maxNameLength + "}{1,-" + columnPadding + "}",
1062 name.Length > maxNameLength ? name.Substring(0, maxNameLength) : name, "");
1063 report.AppendFormat(
1064 "{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}",
1065 regionName.Length > maxRegionNameLength ? regionName.Substring(0, maxRegionNameLength) : regionName, "");
1066 report.AppendFormat(
1067 "{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}",
1068 isChild ? "Cd" : "Rt", "");
1069
1070 IStatsCollector stats = (IStatsCollector)client;
1071
1072 report.AppendLine(stats.Report());
1073 }
1074 });
1075 });
1076
1077 return report.ToString();
1078 }
1079
1080 /// <summary>
1081 /// Use XML2 format to serialize data to a file 996 /// Use XML2 format to serialize data to a file
1082 /// </summary> 997 /// </summary>
1083 /// <param name="module"></param> 998 /// <param name="module"></param>
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index eb5c0f5..72348b9 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -370,6 +370,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
370 #region Properties 370 #region Properties
371 371
372 public LLUDPClient UDPClient { get { return m_udpClient; } } 372 public LLUDPClient UDPClient { get { return m_udpClient; } }
373 public LLUDPServer UDPServer { get { return m_udpServer; } }
373 public IPEndPoint RemoteEndPoint { get { return m_udpClient.RemoteEndPoint; } } 374 public IPEndPoint RemoteEndPoint { get { return m_udpClient.RemoteEndPoint; } }
374 public UUID SecureSessionId { get { return m_secureSessionId; } } 375 public UUID SecureSessionId { get { return m_secureSessionId; } }
375 public IScene Scene { get { return m_scene; } } 376 public IScene Scene { get { return m_scene; } }
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
index 5aa9b40..f1fdbc5 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
@@ -257,18 +257,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
257 public string GetStats() 257 public string GetStats()
258 { 258 {
259 return string.Format( 259 return string.Format(
260 "{0,9} {1,9} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}", 260 "{0,7} {1,7} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}",
261 PacketsSent, 261 PacketsSent,
262 PacketsReceived, 262 PacketsReceived,
263 UnackedBytes, 263 UnackedBytes,
264 m_throttleCategories[(int)ThrottleOutPacketType.Resend].Content, 264 m_packetOutboxes[(int)ThrottleOutPacketType.Resend].Count,
265 m_throttleCategories[(int)ThrottleOutPacketType.Land].Content, 265 m_packetOutboxes[(int)ThrottleOutPacketType.Land].Count,
266 m_throttleCategories[(int)ThrottleOutPacketType.Wind].Content, 266 m_packetOutboxes[(int)ThrottleOutPacketType.Wind].Count,
267 m_throttleCategories[(int)ThrottleOutPacketType.Cloud].Content, 267 m_packetOutboxes[(int)ThrottleOutPacketType.Cloud].Count,
268 m_throttleCategories[(int)ThrottleOutPacketType.Task].Content, 268 m_packetOutboxes[(int)ThrottleOutPacketType.Task].Count,
269 m_throttleCategories[(int)ThrottleOutPacketType.Texture].Content, 269 m_packetOutboxes[(int)ThrottleOutPacketType.Texture].Count,
270 m_throttleCategories[(int)ThrottleOutPacketType.Asset].Content, 270 m_packetOutboxes[(int)ThrottleOutPacketType.Asset].Count,
271 m_throttleCategories[(int)ThrottleOutPacketType.State].Content); 271 m_packetOutboxes[(int)ThrottleOutPacketType.State].Count);
272 } 272 }
273 273
274 public void SendPacketStats() 274 public void SendPacketStats()
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index f969bc3..703176c 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -114,8 +114,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
114 //private UDPClientCollection m_clients = new UDPClientCollection(); 114 //private UDPClientCollection m_clients = new UDPClientCollection();
115 /// <summary>Bandwidth throttle for this UDP server</summary> 115 /// <summary>Bandwidth throttle for this UDP server</summary>
116 protected TokenBucket m_throttle; 116 protected TokenBucket m_throttle;
117
117 /// <summary>Bandwidth throttle rates for this UDP server</summary> 118 /// <summary>Bandwidth throttle rates for this UDP server</summary>
118 protected ThrottleRates m_throttleRates; 119 public ThrottleRates ThrottleRates { get; private set; }
120
119 /// <summary>Manages authentication for agent circuits</summary> 121 /// <summary>Manages authentication for agent circuits</summary>
120 private AgentCircuitManager m_circuitManager; 122 private AgentCircuitManager m_circuitManager;
121 /// <summary>Reference to the scene this UDP server is attached to</summary> 123 /// <summary>Reference to the scene this UDP server is attached to</summary>
@@ -226,7 +228,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
226 #endregion BinaryStats 228 #endregion BinaryStats
227 229
228 m_throttle = new TokenBucket(null, sceneThrottleBps, sceneThrottleBps); 230 m_throttle = new TokenBucket(null, sceneThrottleBps, sceneThrottleBps);
229 m_throttleRates = new ThrottleRates(configSource); 231 ThrottleRates = new ThrottleRates(configSource);
230 } 232 }
231 233
232 public void Start() 234 public void Start()
@@ -922,7 +924,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
922 protected virtual void AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo) 924 protected virtual void AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo)
923 { 925 {
924 // Create the LLUDPClient 926 // Create the LLUDPClient
925 LLUDPClient udpClient = new LLUDPClient(this, m_throttleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO); 927 LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
926 IClientAPI existingClient; 928 IClientAPI existingClient;
927 929
928 if (!m_scene.TryGetClient(agentID, out existingClient)) 930 if (!m_scene.TryGetClient(agentID, out existingClient))
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index d7f3f2c..4255c79 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
@@ -41,8 +41,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
41 /// </summary> 41 /// </summary>
42 public class AgentAssetTransactions 42 public class AgentAssetTransactions
43 { 43 {
44 private static readonly ILog m_log = LogManager.GetLogger( 44// private static readonly ILog m_log = LogManager.GetLogger(
45 MethodBase.GetCurrentMethod().DeclaringType); 45// MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 // Fields 47 // Fields
48 private bool m_dumpAssetsToFile; 48 private bool m_dumpAssetsToFile;
@@ -167,8 +167,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
167 { 167 {
168 if (XferUploaders.ContainsKey(transactionID)) 168 if (XferUploaders.ContainsKey(transactionID))
169 { 169 {
170 m_log.DebugFormat("[XFER]: Asked to update item {0} ({1})", 170// m_log.DebugFormat("[XFER]: Asked to update item {0} ({1})",
171 item.Name, item.ID); 171// item.Name, item.ID);
172 172
173 // Here we need to get the old asset to extract the 173 // Here we need to get the old asset to extract the
174 // texture UUIDs if it's a wearable. 174 // texture UUIDs if it's a wearable.
@@ -195,8 +195,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
195 IInventoryService invService = m_Scene.InventoryService; 195 IInventoryService invService = m_Scene.InventoryService;
196 invService.UpdateItem(item); 196 invService.UpdateItem(item);
197 197
198 m_log.DebugFormat("[XFER]: Updated item {0} ({1}) with asset {2}", 198// m_log.DebugFormat("[XFER]: Updated item {0} ({1}) with asset {2}",
199 item.Name, item.ID, asset.FullID); 199// item.Name, item.ID, asset.FullID);
200 } 200 }
201 } 201 }
202 } 202 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
index 8347e35..878242a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
@@ -49,8 +49,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
49 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 49 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
50 public class GetMeshModule : INonSharedRegionModule 50 public class GetMeshModule : INonSharedRegionModule
51 { 51 {
52 private static readonly ILog m_log = 52// private static readonly ILog m_log =
53 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 53// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
54
54 private Scene m_scene; 55 private Scene m_scene;
55 private IAssetService m_assetService; 56 private IAssetService m_assetService;
56 57
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
index af26b2b..542af25 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
@@ -50,8 +50,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
50 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 50 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
51 public class NewFileAgentInventoryVariablePriceModule : INonSharedRegionModule 51 public class NewFileAgentInventoryVariablePriceModule : INonSharedRegionModule
52 { 52 {
53 private static readonly ILog m_log = 53// private static readonly ILog m_log =
54 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55
55 private Scene m_scene; 56 private Scene m_scene;
56 private IAssetService m_assetService; 57 private IAssetService m_assetService;
57 private bool m_dumpAssetsToFile = false; 58 private bool m_dumpAssetsToFile = false;
@@ -104,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
104 { 105 {
105 UUID capID = UUID.Random(); 106 UUID capID = UUID.Random();
106 107
107 m_log.Info("[GETMESH]: /CAPS/" + capID); 108// m_log.Debug("[NEW FILE AGENT INVENTORY VARIABLE PRICE]: /CAPS/" + capID);
108 caps.RegisterHandler("NewFileAgentInventoryVariablePrice", 109 caps.RegisterHandler("NewFileAgentInventoryVariablePrice",
109 110
110 new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDNewFileAngentInventoryVariablePriceReplyResponse>("POST", 111 new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDNewFileAngentInventoryVariablePriceReplyResponse>("POST",
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 7d6d191..ed0a290 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
167 } 167 }
168 } 168 }
169 169
170 m_log.InfoFormat("[AVFACTORY]: complete texture check for {0}",client.AgentId); 170 m_log.InfoFormat("[AVFACTORY]: complete texture check for {0}", client.AgentId);
171 171
172 // If we only found default textures, then the appearance is not cached 172 // If we only found default textures, then the appearance is not cached
173 return (defonly ? false : true); 173 return (defonly ? false : true);
@@ -187,7 +187,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
187 return; 187 return;
188 } 188 }
189 189
190 m_log.InfoFormat("[AVFACTORY]: start SetAppearance for {0}",client.AgentId); 190// m_log.InfoFormat("[AVFACTORY]: start SetAppearance for {0}", client.AgentId);
191 191
192 // TODO: This is probably not necessary any longer, just assume the 192 // TODO: This is probably not necessary any longer, just assume the
193 // textureEntry set implies that the appearance transaction is complete 193 // textureEntry set implies that the appearance transaction is complete
@@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
210 { 210 {
211 changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; 211 changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
212 212
213 m_log.InfoFormat("[AVFACTORY]: received texture update for {0}",client.AgentId); 213 m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", client.AgentId);
214 Util.FireAndForget(delegate(object o) { ValidateBakedTextureCache(client,false); }); 214 Util.FireAndForget(delegate(object o) { ValidateBakedTextureCache(client,false); });
215 215
216 // This appears to be set only in the final stage of the appearance 216 // This appears to be set only in the final stage of the appearance
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index 0d5401b..dd9819a 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -180,7 +180,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
180 } 180 }
181 } 181 }
182 182
183 m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID); 183// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID);
184 SendGridInstantMessageViaXMLRPC(im, result); 184 SendGridInstantMessageViaXMLRPC(im, result);
185 185
186 return; 186 return;
diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs
index 008233b..a0d72ed 100644
--- a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs
+++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs
@@ -43,8 +43,9 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
43{ 43{
44 public class ObjectAdd : IRegionModule 44 public class ObjectAdd : IRegionModule
45 { 45 {
46 private static readonly ILog m_log = 46// private static readonly ILog m_log =
47 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48
48 private Scene m_scene; 49 private Scene m_scene;
49 #region IRegionModule Members 50 #region IRegionModule Members
50 51
diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs
index 09b9719..3114d7f 100644
--- a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs
@@ -105,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
105 { 105 {
106 UUID capID = UUID.Random(); 106 UUID capID = UUID.Random();
107 107
108 m_log.Info("[UploadObjectAssetModule]: /CAPS/" + capID); 108// m_log.Debug("[UPLOAD OBJECT ASSET MODULE]: /CAPS/" + capID);
109 caps.RegisterHandler("UploadObjectAsset", 109 caps.RegisterHandler("UploadObjectAsset",
110 new RestHTTPHandler("POST", "/CAPS/OA/" + capID + "/", 110 new RestHTTPHandler("POST", "/CAPS/OA/" + capID + "/",
111 delegate(Hashtable m_dhttpMethod) 111 delegate(Hashtable m_dhttpMethod)
@@ -156,7 +156,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
156 } 156 }
157 catch (Exception ex) 157 catch (Exception ex)
158 { 158 {
159 m_log.Error("[UploadObjectAssetModule]: Error deserializing message " + ex.ToString()); 159 m_log.Error("[UPLOAD OBJECT ASSET MODULE]: Error deserializing message " + ex.ToString());
160 message = null; 160 message = null;
161 } 161 }
162 162
@@ -174,7 +174,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
174 Vector3 pos = avatar.AbsolutePosition + (Vector3.UnitX * avatar.Rotation); 174 Vector3 pos = avatar.AbsolutePosition + (Vector3.UnitX * avatar.Rotation);
175 Quaternion rot = Quaternion.Identity; 175 Quaternion rot = Quaternion.Identity;
176 Vector3 rootpos = Vector3.Zero; 176 Vector3 rootpos = Vector3.Zero;
177 Quaternion rootrot = Quaternion.Identity; 177// Quaternion rootrot = Quaternion.Identity;
178 178
179 SceneObjectGroup rootGroup = null; 179 SceneObjectGroup rootGroup = null;
180 SceneObjectGroup[] allparts = new SceneObjectGroup[message.Objects.Length]; 180 SceneObjectGroup[] allparts = new SceneObjectGroup[message.Objects.Length];
@@ -186,11 +186,9 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
186 if (i == 0) 186 if (i == 0)
187 { 187 {
188 rootpos = obj.Position; 188 rootpos = obj.Position;
189 rootrot = obj.Rotation; 189// rootrot = obj.Rotation;
190
191 } 190 }
192 191
193
194 // Combine the extraparams data into it's ugly blob again.... 192 // Combine the extraparams data into it's ugly blob again....
195 //int bytelength = 0; 193 //int bytelength = 0;
196 //for (int extparams = 0; extparams < obj.ExtraParams.Length; extparams++) 194 //for (int extparams = 0; extparams < obj.ExtraParams.Length; extparams++)
@@ -363,9 +361,8 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
363 responsedata["str_response_string"] = String.Format("<llsd><map><key>local_id</key>{0}</map></llsd>", ConvertUintToBytes(allparts[0].LocalId)); 361 responsedata["str_response_string"] = String.Format("<llsd><map><key>local_id</key>{0}</map></llsd>", ConvertUintToBytes(allparts[0].LocalId));
364 362
365 return responsedata; 363 return responsedata;
366
367
368 } 364 }
365
369 private string ConvertUintToBytes(uint val) 366 private string ConvertUintToBytes(uint val)
370 { 367 {
371 byte[] resultbytes = Utils.UIntToBytes(val); 368 byte[] resultbytes = Utils.UIntToBytes(val);
@@ -374,4 +371,4 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
374 return String.Format("<binary encoding=\"base64\">{0}</binary>", Convert.ToBase64String(resultbytes)); 371 return String.Format("<binary encoding=\"base64\">{0}</binary>", Convert.ToBase64String(resultbytes));
375 } 372 }
376 } 373 }
377} 374} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 60e8c1a..e7ebab3 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -781,6 +781,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
781 LookupUUIDS icon = (LookupUUIDS)iar.AsyncState; 781 LookupUUIDS icon = (LookupUUIDS)iar.AsyncState;
782 icon.EndInvoke(iar); 782 icon.EndInvoke(iar);
783 } 783 }
784
784 private void LookupUUID(List<UUID> uuidLst) 785 private void LookupUUID(List<UUID> uuidLst)
785 { 786 {
786 LookupUUIDS d = LookupUUIDsAsync; 787 LookupUUIDS d = LookupUUIDsAsync;
@@ -789,6 +790,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
789 LookupUUIDSCompleted, 790 LookupUUIDSCompleted,
790 d); 791 d);
791 } 792 }
793
792 private void LookupUUIDsAsync(List<UUID> uuidLst) 794 private void LookupUUIDsAsync(List<UUID> uuidLst)
793 { 795 {
794 UUID[] uuidarr; 796 UUID[] uuidarr;
@@ -803,12 +805,12 @@ namespace OpenSim.Region.CoreModules.World.Estate
803 // string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]); 805 // string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]);
804 806
805 IUserManagement userManager = m_scene.RequestModuleInterface<IUserManagement>(); 807 IUserManagement userManager = m_scene.RequestModuleInterface<IUserManagement>();
806 string userName = "Unkown User";
807 if (userManager != null) 808 if (userManager != null)
808 userName = userManager.GetUserName(uuidarr[i]); 809 userManager.GetUserName(uuidarr[i]);
809 810
810 // we drop it. It gets cached though... so we're ready for the next request. 811 // we drop it. It gets cached though... so we're ready for the next request.
811 // diva commnent 11/21/2010: uh?!? wft? 812 // diva commnent 11/21/2010: uh?!? wft?
813 // justincc comment 21/01/2011: A side effect of userManager.GetUserName() I presume.
812 } 814 }
813 } 815 }
814 #endregion 816 #endregion
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index f4ebbf0..a00b6b2 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -217,6 +217,7 @@ namespace OpenSim.Region.CoreModules.World.Land
217 ParcelFlags.AllowDamage | 217 ParcelFlags.AllowDamage |
218 ParcelFlags.CreateObjects | 218 ParcelFlags.CreateObjects |
219 ParcelFlags.RestrictPushObject | 219 ParcelFlags.RestrictPushObject |
220 ParcelFlags.AllowOtherScripts |
220 ParcelFlags.AllowGroupScripts | 221 ParcelFlags.AllowGroupScripts |
221 ParcelFlags.CreateGroupObjects | 222 ParcelFlags.CreateGroupObjects |
222 ParcelFlags.AllowAPrimitiveEntry | 223 ParcelFlags.AllowAPrimitiveEntry |
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs
index ec97acd..0e861a1 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
46 private static readonly ILog m_log = 46 private static readonly ILog m_log =
47 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 private Commander m_commander = new Commander("export"); 49// private Commander m_commander = new Commander("export");
50 private List<Scene> m_regions = new List<Scene>(); 50 private List<Scene> m_regions = new List<Scene>();
51 private string m_savedir = "exports"; 51 private string m_savedir = "exports";
52 private List<IFileSerialiser> m_serialisers = new List<IFileSerialiser>(); 52 private List<IFileSerialiser> m_serialisers = new List<IFileSerialiser>();
@@ -77,14 +77,13 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
77 m_serialisers.Add(new SerialiseObjects()); 77 m_serialisers.Add(new SerialiseObjects());
78 } 78 }
79 79
80 LoadCommanderCommands(); 80// LoadCommanderCommands();
81 } 81 }
82 82
83
84 public void AddRegion(Scene scene) 83 public void AddRegion(Scene scene)
85 { 84 {
86 scene.RegisterModuleCommander(m_commander); 85// scene.RegisterModuleCommander(m_commander);
87 scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; 86// scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
88 scene.RegisterModuleInterface<IRegionSerialiserModule>(this); 87 scene.RegisterModuleInterface<IRegionSerialiserModule>(this);
89 88
90 lock (m_regions) 89 lock (m_regions)
@@ -211,18 +210,18 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
211 210
212 #endregion 211 #endregion
213 212
214 private void EventManager_OnPluginConsole(string[] args) 213// private void EventManager_OnPluginConsole(string[] args)
215 { 214// {
216 if (args[0] == "export") 215// if (args[0] == "export")
217 { 216// {
218 string[] tmpArgs = new string[args.Length - 2]; 217// string[] tmpArgs = new string[args.Length - 2];
219 int i = 0; 218// int i = 0;
220 for (i = 2; i < args.Length; i++) 219// for (i = 2; i < args.Length; i++)
221 tmpArgs[i - 2] = args[i]; 220// tmpArgs[i - 2] = args[i];
222 221//
223 m_commander.ProcessConsoleCommand(args[1], tmpArgs); 222// m_commander.ProcessConsoleCommand(args[1], tmpArgs);
224 } 223// }
225 } 224// }
226 225
227 private void InterfaceSaveRegion(Object[] args) 226 private void InterfaceSaveRegion(Object[] args)
228 { 227 {
@@ -245,15 +244,15 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
245 } 244 }
246 } 245 }
247 246
248 private void LoadCommanderCommands() 247// private void LoadCommanderCommands()
249 { 248// {
250 Command serialiseSceneCommand = new Command("save", CommandIntentions.COMMAND_NON_HAZARDOUS, InterfaceSaveRegion, "Saves the named region into the exports directory."); 249// Command serialiseSceneCommand = new Command("save", CommandIntentions.COMMAND_NON_HAZARDOUS, InterfaceSaveRegion, "Saves the named region into the exports directory.");
251 serialiseSceneCommand.AddArgument("region-name", "The name of the region you wish to export", "String"); 250// serialiseSceneCommand.AddArgument("region-name", "The name of the region you wish to export", "String");
252 251//
253 Command serialiseAllScenesCommand = new Command("save-all",CommandIntentions.COMMAND_NON_HAZARDOUS, InterfaceSaveAllRegions, "Saves all regions into the exports directory."); 252// Command serialiseAllScenesCommand = new Command("save-all",CommandIntentions.COMMAND_NON_HAZARDOUS, InterfaceSaveAllRegions, "Saves all regions into the exports directory.");
254 253//
255 m_commander.RegisterCommand("save", serialiseSceneCommand); 254// m_commander.RegisterCommand("save", serialiseSceneCommand);
256 m_commander.RegisterCommand("save-all", serialiseAllScenesCommand); 255// m_commander.RegisterCommand("save-all", serialiseAllScenesCommand);
257 } 256// }
258 } 257 }
259} 258}
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
index 8df44fe..09c0ebb 100644
--- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
+++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
38{ 38{
39 public class SoundModule : IRegionModule, ISoundModule 39 public class SoundModule : IRegionModule, ISoundModule
40 { 40 {
41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 41// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 42
43 protected Scene m_scene; 43 protected Scene m_scene;
44 44
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Perlin.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Perlin.cs
index af59d7a..522a7eb 100644
--- a/OpenSim/Region/CoreModules/World/Warp3DMap/Perlin.cs
+++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Perlin.cs
@@ -85,9 +85,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
85 public static float noise1(float arg) 85 public static float noise1(float arg)
86 { 86 {
87 int bx0, bx1; 87 int bx0, bx1;
88 float rx0, rx1, sx, t, u, v, a; 88 float rx0, rx1, sx, t, u, v;
89
90 a = arg;
91 89
92 t = arg + N; 90 t = arg + N;
93 bx0 = ((int)t) & BM; 91 bx0 = ((int)t) & BM;
diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
new file mode 100644
index 0000000..87d067c
--- /dev/null
+++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
@@ -0,0 +1,348 @@
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.Reflection;
31using System.Text;
32using log4net;
33using Mono.Addins;
34using Nini.Config;
35using OpenMetaverse;
36using OpenSim.Framework;
37using OpenSim.Framework.Console;
38using OpenSim.Framework.Statistics;
39using OpenSim.Region.ClientStack.LindenUDP;
40using OpenSim.Region.Framework.Interfaces;
41using OpenSim.Region.Framework.Scenes;
42
43namespace OpenSim.Region.CoreModules.UDP.Linden
44{
45 /// <summary>
46 /// A module that just holds commands for inspecting the current state of the Linden UDP stack.
47 /// </summary>
48 /// <remarks>
49 /// All actual client stack functionality remains in OpenSim.Region.ClientStack.LindenUDP
50 /// </remarks>
51 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LindenUDPInfoModule")]
52 public class LindenUDPInfoModule : ISharedRegionModule
53 {
54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55
56 protected Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
57
58 public string Name { get { return "Linden UDP Module"; } }
59
60 public Type ReplaceableInterface { get { return null; } }
61
62 public void Initialise(IConfigSource source)
63 {
64// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: INITIALIZED MODULE");
65 }
66
67 public void PostInitialise()
68 {
69// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: POST INITIALIZED MODULE");
70 }
71
72 public void Close()
73 {
74// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: CLOSED MODULE");
75 }
76
77 public void AddRegion(Scene scene)
78 {
79// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName);
80
81 lock (m_scenes)
82 m_scenes[scene.RegionInfo.RegionID] = scene;
83
84 scene.AddCommand(
85 this, "show queues",
86 "show queues [full]",
87 "Show queue data for each client",
88 "Without the 'full' option, only root agents are shown."
89 + " With the 'full' option child agents are also shown.",
90 ShowQueuesReport);
91
92 scene.AddCommand(
93 this, "show throttles",
94 "show throttles [full]",
95 "Show throttle settings for each client and for the server overall",
96 "Without the 'full' option, only root agents are shown."
97 + " With the 'full' option child agents are also shown.",
98 ShowThrottlesReport);
99 }
100
101 public void RemoveRegion(Scene scene)
102 {
103// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName);
104
105 lock (m_scenes)
106 m_scenes.Remove(scene.RegionInfo.RegionID);
107 }
108
109 public void RegionLoaded(Scene scene)
110 {
111// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
112 }
113
114 protected void ShowQueuesReport(string module, string[] cmd)
115 {
116 MainConsole.Instance.Output(GetQueuesReport(cmd));
117 }
118
119 protected void ShowThrottlesReport(string module, string[] cmd)
120 {
121 MainConsole.Instance.Output(GetThrottlesReport(cmd));
122 }
123
124 protected string GetColumnEntry(string entry, int maxLength, int columnPadding)
125 {
126 return string.Format(
127 "{0,-" + maxLength + "}{1,-" + columnPadding + "}",
128 entry.Length > maxLength ? entry.Substring(0, maxLength) : entry,
129 "");
130 }
131
132 /// <summary>
133 /// Generate UDP Queue data report for each client
134 /// </summary>
135 /// <param name="showParams"></param>
136 /// <returns></returns>
137 protected string GetQueuesReport(string[] showParams)
138 {
139 bool showChildren = false;
140
141 if (showParams.Length > 2 && showParams[2] == "full")
142 showChildren = true;
143
144 StringBuilder report = new StringBuilder();
145
146 int columnPadding = 2;
147 int maxNameLength = 18;
148 int maxRegionNameLength = 14;
149 int maxTypeLength = 4;
150 int totalInfoFieldsLength = maxNameLength + columnPadding + maxRegionNameLength + columnPadding + maxTypeLength + columnPadding;
151
152 report.Append(GetColumnEntry("User", maxNameLength, columnPadding));
153 report.Append(GetColumnEntry("Region", maxRegionNameLength, columnPadding));
154 report.Append(GetColumnEntry("Type", maxTypeLength, columnPadding));
155
156 report.AppendFormat(
157 "{0,7} {1,7} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}\n",
158 "Pkts",
159 "Pkts",
160 "Bytes",
161 "Pkts",
162 "Pkts",
163 "Pkts",
164 "Pkts",
165 "Pkts",
166 "Pkts",
167 "Pkts",
168 "Pkts");
169
170 report.AppendFormat("{0,-" + totalInfoFieldsLength + "}", "");
171 report.AppendFormat(
172 "{0,7} {1,7} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}\n",
173 "Out",
174 "In",
175 "Unacked",
176 "Resend",
177 "Land",
178 "Wind",
179 "Cloud",
180 "Task",
181 "Texture",
182 "Asset",
183 "State");
184
185 lock (m_scenes)
186 {
187 foreach (Scene scene in m_scenes.Values)
188 {
189 scene.ForEachClient(
190 delegate(IClientAPI client)
191 {
192 if (client is IStatsCollector)
193 {
194 bool isChild = scene.PresenceChildStatus(client.AgentId);
195 if (isChild && !showChildren)
196 return;
197
198 string name = client.Name;
199 string regionName = scene.RegionInfo.RegionName;
200
201 report.Append(GetColumnEntry(name, maxNameLength, columnPadding));
202 report.Append(GetColumnEntry(regionName, maxRegionNameLength, columnPadding));
203 report.Append(GetColumnEntry(isChild ? "Cd" : "Rt", maxTypeLength, columnPadding));
204
205 IStatsCollector stats = (IStatsCollector)client;
206
207 report.AppendLine(stats.Report());
208 }
209 });
210 }
211 }
212
213 return report.ToString();
214 }
215
216 /// <summary>
217 /// Show throttle data
218 /// </summary>
219 /// <param name="showParams"></param>
220 /// <returns></returns>
221 protected string GetThrottlesReport(string[] showParams)
222 {
223 bool showChildren = false;
224
225 if (showParams.Length > 2 && showParams[2] == "full")
226 showChildren = true;
227
228 StringBuilder report = new StringBuilder();
229
230 int columnPadding = 2;
231 int maxNameLength = 18;
232 int maxRegionNameLength = 14;
233 int maxTypeLength = 4;
234 int totalInfoFieldsLength = maxNameLength + columnPadding + maxRegionNameLength + columnPadding + maxTypeLength + columnPadding;
235
236 report.Append(GetColumnEntry("User", maxNameLength, columnPadding));
237 report.Append(GetColumnEntry("Region", maxRegionNameLength, columnPadding));
238 report.Append(GetColumnEntry("Type", maxTypeLength, columnPadding));
239
240 report.AppendFormat(
241 "{0,7} {1,8} {2,7} {3,7} {4,7} {5,7} {6,9} {7,7}\n",
242 "Total",
243 "Resend",
244 "Land",
245 "Wind",
246 "Cloud",
247 "Task",
248 "Texture",
249 "Asset");
250
251 report.AppendFormat("{0,-" + totalInfoFieldsLength + "}", "");
252 report.AppendFormat(
253 "{0,7} {1,8} {2,7} {3,7} {4,7} {5,7} {6,9} {7,7}",
254 "kb/s",
255 "kb/s",
256 "kb/s",
257 "kb/s",
258 "kb/s",
259 "kb/s",
260 "kb/s",
261 "kb/s");
262
263 report.AppendLine();
264
265 bool firstClient = true;
266
267 lock (m_scenes)
268 {
269 foreach (Scene scene in m_scenes.Values)
270 {
271 scene.ForEachClient(
272 delegate(IClientAPI client)
273 {
274 if (client is LLClientView)
275 {
276 LLClientView llClient = client as LLClientView;
277
278 if (firstClient)
279 {
280 report.AppendLine(GetServerThrottlesReport(llClient.UDPServer));
281 firstClient = false;
282 }
283
284 bool isChild = scene.PresenceChildStatus(client.AgentId);
285 if (isChild && !showChildren)
286 return;
287
288 string name = client.Name;
289 string regionName = scene.RegionInfo.RegionName;
290
291 LLUDPClient llUdpClient = llClient.UDPClient;
292 ClientInfo ci = llUdpClient.GetClientInfo();
293
294 report.Append(GetColumnEntry(name, maxNameLength, columnPadding));
295 report.Append(GetColumnEntry(regionName, maxRegionNameLength, columnPadding));
296 report.Append(GetColumnEntry(isChild ? "Cd" : "Rt", maxTypeLength, columnPadding));
297
298 report.AppendFormat(
299 "{0,7} {1,8} {2,7} {3,7} {4,7} {5,7} {6,9} {7,7}",
300 (ci.totalThrottle * 8) / 1000,
301 (ci.resendThrottle * 8) / 1000,
302 (ci.landThrottle * 8) / 1000,
303 (ci.windThrottle * 8) / 1000,
304 (ci.cloudThrottle * 8) / 1000,
305 (ci.taskThrottle * 8) / 1000,
306 (ci.textureThrottle * 8) / 1000,
307 (ci.assetThrottle * 8) / 1000);
308
309 report.AppendLine();
310 }
311 });
312 }
313 }
314
315 return report.ToString();
316 }
317
318 protected string GetServerThrottlesReport(LLUDPServer udpServer)
319 {
320 StringBuilder report = new StringBuilder();
321
322 int columnPadding = 2;
323 int maxNameLength = 18;
324 int maxRegionNameLength = 14;
325 int maxTypeLength = 4;
326
327 string name = "SERVER AGENT LIMITS";
328
329 report.Append(GetColumnEntry(name, maxNameLength, columnPadding));
330 report.Append(GetColumnEntry("-", maxRegionNameLength, columnPadding));
331 report.Append(GetColumnEntry("-", maxTypeLength, columnPadding));
332
333 ThrottleRates throttleRates = udpServer.ThrottleRates;
334 report.AppendFormat(
335 "{0,7} {1,8} {2,7} {3,7} {4,7} {5,7} {6,9} {7,7}",
336 "n/a",
337 (throttleRates.ResendLimit * 8) / 1000,
338 (throttleRates.LandLimit * 8) / 1000,
339 (throttleRates.WindLimit * 8) / 1000,
340 (throttleRates.CloudLimit * 8) / 1000,
341 (throttleRates.TaskLimit * 8) / 1000,
342 (throttleRates.TextureLimit * 8) / 1000,
343 (throttleRates.AssetLimit * 8) / 1000);
344
345 return report.ToString();
346 }
347 }
348} \ No newline at end of file