aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Client/Linden/LLClientStackModule.cs136
-rw-r--r--OpenSim/Client/Linden/Resources/LindenModules.addin.xml13
-rw-r--r--OpenSim/Data/MySQL/MySQLInventoryData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLXInventoryData.cs2
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs23
-rw-r--r--OpenSim/Framework/Capabilities/Caps.cs8
-rwxr-xr-xOpenSim/Framework/Console/ConsoleBase.cs5
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs36
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs5
-rw-r--r--OpenSim/Framework/WebUtil.cs2
-rw-r--r--OpenSim/Region/Application/OpenSim.cs173
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs8
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs18
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs16
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs47
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs22
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs10
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs7
-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/LandChannel.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs97
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs41
-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/CoreModules/World/WorldMap/WorldMapModule.cs12
-rw-r--r--OpenSim/Region/Framework/Interfaces/ILandObject.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs81
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs27
-rw-r--r--OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs348
-rw-r--r--OpenSim/Server/Handlers/Grid/GridInfoServerInConnector.cs2
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs3
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs6
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs19
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs6
-rw-r--r--OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs9
-rw-r--r--OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs2
-rw-r--r--OpenSim/Server/Handlers/Simulation/AgentHandlers.cs19
-rw-r--r--OpenSim/Server/Handlers/Simulation/SimulationServiceInConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs6
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs4
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs27
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs8
-rw-r--r--OpenSim/Services/Connectors/Simulation/EstateDataService.cs6
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationDataService.cs6
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs6
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs2
-rw-r--r--OpenSim/Services/HypergridService/UserAccountCache.cs7
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginResponse.cs2
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs25
-rw-r--r--prebuild.xml150
60 files changed, 898 insertions, 699 deletions
diff --git a/OpenSim/Client/Linden/LLClientStackModule.cs b/OpenSim/Client/Linden/LLClientStackModule.cs
deleted file mode 100644
index f882d5d..0000000
--- a/OpenSim/Client/Linden/LLClientStackModule.cs
+++ /dev/null
@@ -1,136 +0,0 @@
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.Net;
31using System.Reflection;
32using System.Text;
33using log4net;
34using Nini.Config;
35using OpenMetaverse;
36using OpenSim.Region.ClientStack;
37using OpenSim.Region.ClientStack.LindenUDP;
38using OpenSim.Framework;
39using OpenSim.Region.Framework.Scenes;
40using OpenSim.Region.Framework.Interfaces;
41
42namespace OpenSim.Client.Linden
43{
44 /// <summary>
45 /// Linden UDP Stack Region Module
46 /// </summary>
47 public class LLClientStackModule : INonSharedRegionModule
48 {
49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50
51 #region IRegionModule Members
52
53 /// <summary>
54 /// Scene that contains the region's data
55 /// </summary>
56 protected Scene m_scene;
57 protected bool m_createClientStack = false;
58 protected IClientNetworkServer m_clientServer;
59 protected ClientStackManager m_clientStackManager;
60 protected IConfigSource m_source;
61
62 protected string m_clientStackDll = "OpenSim.Region.ClientStack.LindenUDP.dll";
63
64 public void Initialise(IConfigSource source)
65 {
66 if (m_scene == null)
67 {
68 m_source = source;
69
70 IConfig startupConfig = m_source.Configs["Startup"];
71 if (startupConfig != null)
72 {
73 m_clientStackDll = startupConfig.GetString("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll");
74 }
75 }
76 }
77
78 public void AddRegion(Scene scene)
79 {
80
81 }
82
83 public void RemoveRegion(Scene scene)
84 {
85
86 }
87
88 public void RegionLoaded(Scene scene)
89 {
90 if (m_scene == null)
91 {
92 m_scene = scene;
93 }
94
95 if ((m_scene != null) && (m_createClientStack))
96 {
97 m_log.Info("[LLClientStackModule] Starting up LLClientStack.");
98 IPEndPoint endPoint = m_scene.RegionInfo.InternalEndPoint;
99
100 uint port = (uint)endPoint.Port;
101 m_clientStackManager = new ClientStackManager(m_clientStackDll);
102
103 m_clientServer
104 = m_clientStackManager.CreateServer(endPoint.Address,
105 ref port, m_scene.RegionInfo.ProxyOffset, m_scene.RegionInfo.m_allow_alternate_ports, m_source,
106 m_scene.AuthenticateHandler);
107
108 m_clientServer.AddScene(m_scene);
109
110 m_clientServer.Start();
111 }
112 }
113
114 public void Close()
115 {
116
117 }
118
119 public Type ReplaceableInterface
120 {
121 get { return null; }
122 }
123
124 public string Name
125 {
126 get { return "LLClientStackModule"; }
127 }
128
129 public bool IsSharedModule
130 {
131 get { return false; }
132 }
133
134 #endregion
135 }
136}
diff --git a/OpenSim/Client/Linden/Resources/LindenModules.addin.xml b/OpenSim/Client/Linden/Resources/LindenModules.addin.xml
deleted file mode 100644
index af41e98..0000000
--- a/OpenSim/Client/Linden/Resources/LindenModules.addin.xml
+++ /dev/null
@@ -1,13 +0,0 @@
1<Addin id="OpenSim.Client.Linden.LindenModules" version="0.2">
2 <Runtime>
3 <Import assembly="OpenSim.Client.Linden.dll"/>
4 </Runtime>
5
6 <Dependencies>
7 <Addin id="OpenSim" version="0.5" />
8 </Dependencies>
9
10 <Extension path = "/OpenSim/RegionModules">
11 <RegionModule id="LLClientStackModule" type="OpenSim.Client.Linden.LLClientStackModule" />
12 </Extension>
13</Addin>
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs
index 2dca3eb..9d70acb 100644
--- a/OpenSim/Data/MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs
@@ -867,7 +867,7 @@ namespace OpenSim.Data.MySQL
867 dbcon.Open(); 867 dbcon.Open();
868 868
869 using (MySqlCommand sqlCmd = new MySqlCommand( 869 using (MySqlCommand sqlCmd = new MySqlCommand(
870 "SELECT * FROM inventoryitems WHERE avatarId = ?uuid AND assetType = ?type and flags = 1", dbcon)) 870 "SELECT * FROM inventoryitems WHERE avatarId = ?uuid AND assetType = ?type and flags & 1", dbcon))
871 { 871 {
872 sqlCmd.Parameters.AddWithValue("?uuid", avatarID.ToString()); 872 sqlCmd.Parameters.AddWithValue("?uuid", avatarID.ToString());
873 sqlCmd.Parameters.AddWithValue("?type", (int)AssetType.Gesture); 873 sqlCmd.Parameters.AddWithValue("?type", (int)AssetType.Gesture);
diff --git a/OpenSim/Data/MySQL/MySQLXInventoryData.cs b/OpenSim/Data/MySQL/MySQLXInventoryData.cs
index 3c73095..287c4dd 100644
--- a/OpenSim/Data/MySQL/MySQLXInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLXInventoryData.cs
@@ -130,7 +130,7 @@ namespace OpenSim.Data.MySQL
130 { 130 {
131 using (MySqlCommand cmd = new MySqlCommand()) 131 using (MySqlCommand cmd = new MySqlCommand())
132 { 132 {
133 cmd.CommandText = String.Format("select * from inventoryitems where avatarId = ?uuid and assetType = ?type and flags = 1", m_Realm); 133 cmd.CommandText = String.Format("select * from inventoryitems where avatarId = ?uuid and assetType = ?type and flags & 1", m_Realm);
134 134
135 cmd.Parameters.AddWithValue("?uuid", principalID.ToString()); 135 cmd.Parameters.AddWithValue("?uuid", principalID.ToString());
136 cmd.Parameters.AddWithValue("?type", (int)AssetType.Gesture); 136 cmd.Parameters.AddWithValue("?type", (int)AssetType.Gesture);
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 18a5733..5a6b265 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -427,19 +427,30 @@ namespace OpenSim.Framework
427 /// 0x80 bit set then we assume this is an append 427 /// 0x80 bit set then we assume this is an append
428 /// operation otherwise we replace whatever is 428 /// operation otherwise we replace whatever is
429 /// currently attached at the attachpoint 429 /// currently attached at the attachpoint
430 /// return true if something actually changed
430 /// </summary> 431 /// </summary>
431 public void SetAttachment(int attachpoint, UUID item, UUID asset) 432 public bool SetAttachment(int attachpoint, UUID item, UUID asset)
432 { 433 {
433 if (attachpoint == 0) 434 if (attachpoint == 0)
434 return; 435 return false;
435 436
436 if (item == UUID.Zero) 437 if (item == UUID.Zero)
437 { 438 {
438 if (m_attachments.ContainsKey(attachpoint)) 439 if (m_attachments.ContainsKey(attachpoint))
440 {
439 m_attachments.Remove(attachpoint); 441 m_attachments.Remove(attachpoint);
440 return; 442 return true;
443 }
444 return false;
441 } 445 }
442 446
447 // check if the item is already attached at this point
448 if (GetAttachpoint(item) == (attachpoint & 0x7F))
449 {
450 // m_log.DebugFormat("[AVATAR APPEARANCE] attempt to attach an already attached item {0}",item);
451 return false;
452 }
453
443 // check if this is an append or a replace, 0x80 marks it as an append 454 // check if this is an append or a replace, 0x80 marks it as an append
444 if ((attachpoint & 0x80) > 0) 455 if ((attachpoint & 0x80) > 0)
445 { 456 {
@@ -451,6 +462,7 @@ namespace OpenSim.Framework
451 { 462 {
452 ReplaceAttachment(new AvatarAttachment(attachpoint,item,asset)); 463 ReplaceAttachment(new AvatarAttachment(attachpoint,item,asset));
453 } 464 }
465 return true;
454 } 466 }
455 467
456 public int GetAttachpoint(UUID itemID) 468 public int GetAttachpoint(UUID itemID)
@@ -465,7 +477,7 @@ namespace OpenSim.Framework
465 return 0; 477 return 0;
466 } 478 }
467 479
468 public void DetachAttachment(UUID itemID) 480 public bool DetachAttachment(UUID itemID)
469 { 481 {
470 foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments) 482 foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments)
471 { 483 {
@@ -478,9 +490,10 @@ namespace OpenSim.Framework
478 // And remove the list if there are no more attachments here 490 // And remove the list if there are no more attachments here
479 if (m_attachments[kvp.Key].Count == 0) 491 if (m_attachments[kvp.Key].Count == 0)
480 m_attachments.Remove(kvp.Key); 492 m_attachments.Remove(kvp.Key);
481 return; 493 return true;
482 } 494 }
483 } 495 }
496 return false;
484 } 497 }
485 498
486 public void ClearAttachments() 499 public void ClearAttachments()
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs
index dbb0781..c2f9c3a 100644
--- a/OpenSim/Framework/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Capabilities/Caps.cs
@@ -765,8 +765,8 @@ namespace OpenSim.Framework.Capabilities
765 { 765 {
766 try 766 try
767 { 767 {
768 m_log.Debug("[CAPS]: UploadBakedTexture Request in region: " + 768// m_log.Debug("[CAPS]: UploadBakedTexture Request in region: " +
769 m_regionName); 769// m_regionName);
770 770
771 string capsBase = "/CAPS/" + m_capsObjectPath; 771 string capsBase = "/CAPS/" + m_capsObjectPath;
772 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); 772 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
@@ -1332,7 +1332,7 @@ namespace OpenSim.Framework.Capabilities
1332 newAssetID = UUID.Random(); 1332 newAssetID = UUID.Random();
1333 uploaderPath = path; 1333 uploaderPath = path;
1334 httpListener = httpServer; 1334 httpListener = httpServer;
1335 m_log.InfoFormat("[CAPS] baked texture upload starting for {0}",newAssetID); 1335// m_log.InfoFormat("[CAPS] baked texture upload starting for {0}",newAssetID);
1336 } 1336 }
1337 1337
1338 /// <summary> 1338 /// <summary>
@@ -1360,7 +1360,7 @@ namespace OpenSim.Framework.Capabilities
1360 1360
1361 httpListener.RemoveStreamHandler("POST", uploaderPath); 1361 httpListener.RemoveStreamHandler("POST", uploaderPath);
1362 1362
1363 m_log.InfoFormat("[CAPS] baked texture upload completed for {0}",newAssetID); 1363// m_log.InfoFormat("[CAPS] baked texture upload completed for {0}",newAssetID);
1364 1364
1365 return res; 1365 return res;
1366 } 1366 }
diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs
index 22ce880..c59fbca 100755
--- a/OpenSim/Framework/Console/ConsoleBase.cs
+++ b/OpenSim/Framework/Console/ConsoleBase.cs
@@ -75,6 +75,11 @@ namespace OpenSim.Framework.Console
75 { 75 {
76 System.Console.WriteLine(text); 76 System.Console.WriteLine(text);
77 } 77 }
78
79 public virtual void OutputFormat(string format, params object[] components)
80 {
81 Output(string.Format(format, components));
82 }
78 83
79 public string CmdPrompt(string p) 84 public string CmdPrompt(string p)
80 { 85 {
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index cbab2db..b28ad69 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -175,7 +175,7 @@ namespace OpenSim.Framework.Servers
175 175
176 m_console.Commands.AddCommand("base", false, "show info", 176 m_console.Commands.AddCommand("base", false, "show info",
177 "show info", 177 "show info",
178 "Show general information", HandleShow); 178 "Show general information about the server", HandleShow);
179 179
180 m_console.Commands.AddCommand("base", false, "show stats", 180 m_console.Commands.AddCommand("base", false, "show stats",
181 "show stats", 181 "show stats",
@@ -371,8 +371,7 @@ namespace OpenSim.Framework.Servers
371 switch (showParams[0]) 371 switch (showParams[0])
372 { 372 {
373 case "info": 373 case "info":
374 Notice("Version: " + m_version); 374 ShowInfo();
375 Notice("Startup directory: " + m_startupDirectory);
376 break; 375 break;
377 376
378 case "stats": 377 case "stats":
@@ -389,18 +388,30 @@ namespace OpenSim.Framework.Servers
389 break; 388 break;
390 389
391 case "version": 390 case "version":
392 Notice( 391 Notice(GetVersionText());
393 String.Format(
394 "Version: {0} (interface version {1})", m_version, VersionInfo.MajorInterfaceVersion));
395 break; 392 break;
396 } 393 }
397 } 394 }
395
396 protected void ShowInfo()
397 {
398 Notice(GetVersionText());
399 Notice("Startup directory: " + m_startupDirectory);
400 if (null != m_consoleAppender)
401 Notice(String.Format("Console log level: {0}", m_consoleAppender.Threshold));
402 }
403
404 protected string GetVersionText()
405 {
406 return String.Format("Version: {0} (interface version {1})", m_version, VersionInfo.MajorInterfaceVersion);
407 }
398 408
399 /// <summary> 409 /// <summary>
400 /// Console output is only possible if a console has been established. 410 /// Console output is only possible if a console has been established.
401 /// That is something that cannot be determined within this class. So 411 /// That is something that cannot be determined within this class. So
402 /// all attempts to use the console MUST be verified. 412 /// all attempts to use the console MUST be verified.
403 /// </summary> 413 /// </summary>
414 /// <param name="msg"></param>
404 protected void Notice(string msg) 415 protected void Notice(string msg)
405 { 416 {
406 if (m_console != null) 417 if (m_console != null)
@@ -408,6 +419,19 @@ namespace OpenSim.Framework.Servers
408 m_console.Output(msg); 419 m_console.Output(msg);
409 } 420 }
410 } 421 }
422
423 /// <summary>
424 /// Console output is only possible if a console has been established.
425 /// That is something that cannot be determined within this class. So
426 /// all attempts to use the console MUST be verified.
427 /// </summary>
428 /// <param name="format"></param>
429 /// <param name="components"></param>
430 protected void Notice(string format, params string[] components)
431 {
432 if (m_console != null)
433 m_console.OutputFormat(format, components);
434 }
411 435
412 /// <summary> 436 /// <summary>
413 /// Enhance the version string with extra information if it's available. 437 /// Enhance the version string with extra information if it's available.
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 86ad7aa..d4ee7ba 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -587,8 +587,9 @@ namespace OpenSim.Framework.Servers.HttpServer
587 // Every month or so this will wrap and give bad numbers, not really a problem 587 // Every month or so this will wrap and give bad numbers, not really a problem
588 // since its just for reporting, 200ms limit can be adjusted 588 // since its just for reporting, 200ms limit can be adjusted
589 int tickdiff = Environment.TickCount - tickstart; 589 int tickdiff = Environment.TickCount - tickstart;
590 if (tickdiff > 200) 590 if (tickdiff > 500)
591 m_log.InfoFormat("[BASE HTTP SERVER]: slow request <{0}> for {1} took {2} ms",reqnum,request.RawUrl,tickdiff); 591 m_log.InfoFormat(
592 "[BASE HTTP SERVER]: slow request <{0}> for {1} took {2} ms", reqnum, request.RawUrl, tickdiff);
592 } 593 }
593 } 594 }
594 595
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index d88d095..d731ac5 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Framework
58 58
59 // number of milliseconds a call can take before it is considered 59 // number of milliseconds a call can take before it is considered
60 // a "long" call for warning & debugging purposes 60 // a "long" call for warning & debugging purposes
61 public const int LongCallTime = 200; 61 public const int LongCallTime = 500;
62 62
63 /// <summary> 63 /// <summary>
64 /// Send LLSD to an HTTP client in application/llsd+json form 64 /// Send LLSD to an HTTP client in application/llsd+json form
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 51eb396..ed4b620 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 ee4f04e..5dab1bc 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -368,6 +368,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
368 #region Properties 368 #region Properties
369 369
370 public LLUDPClient UDPClient { get { return m_udpClient; } } 370 public LLUDPClient UDPClient { get { return m_udpClient; } }
371 public LLUDPServer UDPServer { get { return m_udpServer; } }
371 public IPEndPoint RemoteEndPoint { get { return m_udpClient.RemoteEndPoint; } } 372 public IPEndPoint RemoteEndPoint { get { return m_udpClient.RemoteEndPoint; } }
372 public UUID SecureSessionId { get { return m_secureSessionId; } } 373 public UUID SecureSessionId { get { return m_secureSessionId; } }
373 public IScene Scene { get { return m_scene; } } 374 public IScene Scene { get { return m_scene; } }
@@ -3465,9 +3466,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3465 ani.AnimationList[i].AnimSequenceID = seqs[i]; 3466 ani.AnimationList[i].AnimSequenceID = seqs[i];
3466 3467
3467 ani.AnimationSourceList[i] = new AvatarAnimationPacket.AnimationSourceListBlock(); 3468 ani.AnimationSourceList[i] = new AvatarAnimationPacket.AnimationSourceListBlock();
3468 ani.AnimationSourceList[i].ObjectID = objectIDs[i]; 3469 if (objectIDs[i].Equals(sourceAgentId))
3469 if (objectIDs[i] == UUID.Zero) 3470 ani.AnimationSourceList[i].ObjectID = UUID.Zero;
3470 ani.AnimationSourceList[i].ObjectID = sourceAgentId; 3471 else
3472 ani.AnimationSourceList[i].ObjectID = objectIDs[i];
3471 } 3473 }
3472 ani.Header.Reliable = false; 3474 ani.Header.Reliable = false;
3473 OutPacket(ani, ThrottleOutPacketType.Task); 3475 OutPacket(ani, ThrottleOutPacketType.Task);
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
index e02783a..d4c3307 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
@@ -256,18 +256,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
256 public string GetStats() 256 public string GetStats()
257 { 257 {
258 return string.Format( 258 return string.Format(
259 "{0,9} {1,9} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}", 259 "{0,7} {1,7} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}",
260 PacketsSent, 260 PacketsSent,
261 PacketsReceived, 261 PacketsReceived,
262 UnackedBytes, 262 UnackedBytes,
263 m_throttleCategories[(int)ThrottleOutPacketType.Resend].Content, 263 m_packetOutboxes[(int)ThrottleOutPacketType.Resend].Count,
264 m_throttleCategories[(int)ThrottleOutPacketType.Land].Content, 264 m_packetOutboxes[(int)ThrottleOutPacketType.Land].Count,
265 m_throttleCategories[(int)ThrottleOutPacketType.Wind].Content, 265 m_packetOutboxes[(int)ThrottleOutPacketType.Wind].Count,
266 m_throttleCategories[(int)ThrottleOutPacketType.Cloud].Content, 266 m_packetOutboxes[(int)ThrottleOutPacketType.Cloud].Count,
267 m_throttleCategories[(int)ThrottleOutPacketType.Task].Content, 267 m_packetOutboxes[(int)ThrottleOutPacketType.Task].Count,
268 m_throttleCategories[(int)ThrottleOutPacketType.Texture].Content, 268 m_packetOutboxes[(int)ThrottleOutPacketType.Texture].Count,
269 m_throttleCategories[(int)ThrottleOutPacketType.Asset].Content, 269 m_packetOutboxes[(int)ThrottleOutPacketType.Asset].Count,
270 m_throttleCategories[(int)ThrottleOutPacketType.State].Content); 270 m_packetOutboxes[(int)ThrottleOutPacketType.State].Count);
271 } 271 }
272 272
273 public void SendPacketStats() 273 public void SendPacketStats()
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index e54cfc2..df8ddbb 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()
@@ -585,8 +587,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
585 587
586 // Stats tracking 588 // Stats tracking
587 Interlocked.Increment(ref udpClient.PacketsSent); 589 Interlocked.Increment(ref udpClient.PacketsSent);
588 if (isReliable)
589 Interlocked.Add(ref udpClient.UnackedBytes, outgoingPacket.Buffer.DataLength);
590 590
591 // Put the UDP payload on the wire 591 // Put the UDP payload on the wire
592 AsyncBeginSend(buffer); 592 AsyncBeginSend(buffer);
@@ -859,9 +859,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
859 // Acknowledge the UseCircuitCode packet 859 // Acknowledge the UseCircuitCode packet
860 SendAckImmediate(remoteEndPoint, packet.Header.Sequence); 860 SendAckImmediate(remoteEndPoint, packet.Header.Sequence);
861 861
862 m_log.DebugFormat( 862// m_log.DebugFormat(
863 "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms", 863// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
864 buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds); 864// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
865 } 865 }
866 866
867 private void SendAckImmediate(IPEndPoint remoteEndpoint, uint sequenceNumber) 867 private void SendAckImmediate(IPEndPoint remoteEndpoint, uint sequenceNumber)
@@ -924,7 +924,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
924 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)
925 { 925 {
926 // Create the LLUDPClient 926 // Create the LLUDPClient
927 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);
928 IClientAPI existingClient; 928 IClientAPI existingClient;
929 929
930 if (!m_scene.TryGetClient(agentID, out existingClient)) 930 if (!m_scene.TryGetClient(agentID, out existingClient))
diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
index 4cb4aee..9d40688 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Net; 30using System.Net;
31using System.Threading;
31using OpenMetaverse; 32using OpenMetaverse;
32 33
33namespace OpenSim.Region.ClientStack.LindenUDP 34namespace OpenSim.Region.ClientStack.LindenUDP
@@ -77,6 +78,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
77 public void Add(OutgoingPacket packet) 78 public void Add(OutgoingPacket packet)
78 { 79 {
79 m_pendingAdds.Enqueue(packet); 80 m_pendingAdds.Enqueue(packet);
81 Interlocked.Add(ref packet.Client.UnackedBytes, packet.Buffer.DataLength);
80 } 82 }
81 83
82 /// <summary> 84 /// <summary>
@@ -139,46 +141,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP
139 private void ProcessQueues() 141 private void ProcessQueues()
140 { 142 {
141 // Process all the pending adds 143 // Process all the pending adds
142
143 OutgoingPacket pendingAdd; 144 OutgoingPacket pendingAdd;
144 if (m_pendingAdds != null) 145 while (m_pendingAdds.TryDequeue(out pendingAdd))
145 { 146 m_packets[pendingAdd.SequenceNumber] = pendingAdd;
146 while (m_pendingAdds.TryDequeue(out pendingAdd))
147 {
148 if (pendingAdd != null && m_packets != null)
149 {
150 m_packets[pendingAdd.SequenceNumber] = pendingAdd;
151 }
152 }
153 }
154 147
155 // Process all the pending removes, including updating statistics and round-trip times 148 // Process all the pending removes, including updating statistics and round-trip times
156 PendingAck pendingRemove; 149 PendingAck pendingRemove;
157 OutgoingPacket ackedPacket; 150 OutgoingPacket ackedPacket;
158 if (m_pendingRemoves != null) 151 while (m_pendingRemoves.TryDequeue(out pendingRemove))
159 { 152 {
160 while (m_pendingRemoves.TryDequeue(out pendingRemove)) 153 if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket))
161 { 154 {
162 if (m_pendingRemoves != null && m_packets != null) 155 m_packets.Remove(pendingRemove.SequenceNumber);
156
157 // Update stats
158 Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
159
160 if (!pendingRemove.FromResend)
163 { 161 {
164 if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) 162 // Calculate the round-trip time for this packet and its ACK
165 { 163 int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount;
166 m_packets.Remove(pendingRemove.SequenceNumber); 164 if (rtt > 0)
167 165 ackedPacket.Client.UpdateRoundTrip(rtt);
168 // Update stats
169 System.Threading.Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
170
171 if (!pendingRemove.FromResend)
172 {
173 // Calculate the round-trip time for this packet and its ACK
174 int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount;
175 if (rtt > 0)
176 ackedPacket.Client.UpdateRoundTrip(rtt);
177 }
178 }
179 } 166 }
180 } 167 }
181 } 168 }
182 } 169 }
183 } 170 }
184} 171} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index c66a4ea..771038e 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;
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
index 36aaab3..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
@@ -102,7 +103,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
102 { 103 {
103 UUID capID = UUID.Random(); 104 UUID capID = UUID.Random();
104 105
105 m_log.Info("[GETMESH]: /CAPS/" + capID); 106// m_log.Info("[GETMESH]: /CAPS/" + capID);
106 caps.RegisterHandler("GetMesh", 107 caps.RegisterHandler("GetMesh",
107 new RestHTTPHandler("GET", "/CAPS/" + capID, 108 new RestHTTPHandler("GET", "/CAPS/" + capID,
108 delegate(Hashtable m_dhttpMethod) 109 delegate(Hashtable m_dhttpMethod)
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs
index 1f60e36..6fb8b46 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.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.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); 108// m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
109 caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture)); 109 caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
110 } 110 }
111 111
@@ -171,7 +171,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
171 /// <returns>False for "caller try another codec"; true otherwise</returns> 171 /// <returns>False for "caller try another codec"; true otherwise</returns>
172 private bool FetchTexture(OSHttpRequest httpRequest, OSHttpResponse httpResponse, UUID textureID, string format) 172 private bool FetchTexture(OSHttpRequest httpRequest, OSHttpResponse httpResponse, UUID textureID, string format)
173 { 173 {
174 m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format); 174// m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format);
175 AssetBase texture; 175 AssetBase texture;
176 176
177 string fullID = textureID.ToString(); 177 string fullID = textureID.ToString();
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/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 360a014..ff26264 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -132,8 +132,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
132 "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId 132 "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId
133 + ", AttachmentPoint: " + AttachmentPt); 133 + ", AttachmentPoint: " + AttachmentPt);
134 134
135 if (m_scene.AvatarFactory != null)
136 m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId);
137 } 135 }
138 } 136 }
139 catch (Exception e) 137 catch (Exception e)
@@ -336,7 +334,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
336 InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); 334 InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
337 item = m_scene.InventoryService.GetItem(item); 335 item = m_scene.InventoryService.GetItem(item);
338 336
339 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); 337 bool changed = presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID);
338 if (changed && m_scene.AvatarFactory != null)
339 m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId);
340 } 340 }
341 341
342 return att.UUID; 342 return att.UUID;
@@ -380,9 +380,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
380 // XXYY!! 380 // XXYY!!
381 InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); 381 InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
382 item = m_scene.InventoryService.GetItem(item); 382 item = m_scene.InventoryService.GetItem(item);
383 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); 383 bool changed = presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID);
384 384 if (changed && m_scene.AvatarFactory != null)
385 if (m_scene.AvatarFactory != null)
386 m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); 385 m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId);
387 } 386 }
388 } 387 }
@@ -402,11 +401,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
402 ScenePresence presence; 401 ScenePresence presence;
403 if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) 402 if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
404 { 403 {
405 presence.Appearance.DetachAttachment(itemID);
406
407 // Save avatar attachment information 404 // Save avatar attachment information
408 m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID); 405 m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID);
409 if (m_scene.AvatarFactory != null) 406
407 bool changed = presence.Appearance.DetachAttachment(itemID);
408 if (changed && m_scene.AvatarFactory != null)
410 m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); 409 m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId);
411 } 410 }
412 411
@@ -431,9 +430,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
431 part.ParentGroup.PrimCount, remoteClient.AgentId, presence.AbsolutePosition)) 430 part.ParentGroup.PrimCount, remoteClient.AgentId, presence.AbsolutePosition))
432 return; 431 return;
433 432
434 presence.Appearance.DetachAttachment(itemID); 433 bool changed = presence.Appearance.DetachAttachment(itemID);
435 434 if (changed && m_scene.AvatarFactory != null)
436 if (m_scene.AvatarFactory != null)
437 m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); 435 m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId);
438 436
439 part.ParentGroup.DetachToGround(); 437 part.ParentGroup.DetachToGround();
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 7d6d191..f8ce444 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,14 +210,16 @@ 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
217 // update transaction. In theory, we should be able to do an immediate 217 // update transaction. In theory, we should be able to do an immediate
218 // appearance send and save here. 218 // appearance send and save here.
219 219
220 QueueAppearanceSave(client.AgentId); 220 // save only if there were changes, send no matter what (doesn't hurt to send twice)
221 if (changed)
222 QueueAppearanceSave(client.AgentId);
221 QueueAppearanceSend(client.AgentId); 223 QueueAppearanceSend(client.AgentId);
222 } 224 }
223 225
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
index 7303fe7..7df2beb 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
69 item = invService.GetItem(item); 69 item = invService.GetItem(item);
70 if (item != null) 70 if (item != null)
71 { 71 {
72 item.Flags = 1; 72 item.Flags |= 1;
73 invService.UpdateItem(item); 73 invService.UpdateItem(item);
74 } 74 }
75 else 75 else
@@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
85 item = invService.GetItem(item); 85 item = invService.GetItem(item);
86 if (item != null) 86 if (item != null)
87 { 87 {
88 item.Flags = 0; 88 item.Flags &= ~(uint)1;
89 invService.UpdateItem(item); 89 invService.UpdateItem(item);
90 } 90 }
91 else 91 else
@@ -93,4 +93,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
93 "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name); 93 "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name);
94 } 94 }
95 } 95 }
96} \ No newline at end of file 96}
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index 21a61a7..77c7147 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -146,7 +146,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
146 if (!user.IsChildAgent) 146 if (!user.IsChildAgent)
147 { 147 {
148 // Local message 148 // Local message
149 m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID); 149// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID);
150 user.ControllingClient.SendInstantMessage(im); 150 user.ControllingClient.SendInstantMessage(im);
151 151
152 // Message sent 152 // Message sent
@@ -168,7 +168,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
168 // Local message 168 // Local message
169 ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; 169 ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
170 170
171 m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID); 171// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID);
172 user.ControllingClient.SendInstantMessage(im); 172 user.ControllingClient.SendInstantMessage(im);
173 173
174 // Message sent 174 // Message sent
@@ -177,7 +177,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
177 } 177 }
178 } 178 }
179 179
180 m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID); 180// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID);
181 SendGridInstantMessageViaXMLRPC(im, result); 181 SendGridInstantMessageViaXMLRPC(im, result);
182 182
183 return; 183 return;
diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs
index c011776..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
@@ -63,7 +64,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
63 { 64 {
64 UUID capuuid = UUID.Random(); 65 UUID capuuid = UUID.Random();
65 66
66 m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/"); 67// m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/");
67 68
68 caps.RegisterHandler("ObjectAdd", 69 caps.RegisterHandler("ObjectAdd",
69 new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/", 70 new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/",
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 ddae20f..b0563c5 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -767,6 +767,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
767 LookupUUIDS icon = (LookupUUIDS)iar.AsyncState; 767 LookupUUIDS icon = (LookupUUIDS)iar.AsyncState;
768 icon.EndInvoke(iar); 768 icon.EndInvoke(iar);
769 } 769 }
770
770 private void LookupUUID(List<UUID> uuidLst) 771 private void LookupUUID(List<UUID> uuidLst)
771 { 772 {
772 LookupUUIDS d = LookupUUIDsAsync; 773 LookupUUIDS d = LookupUUIDsAsync;
@@ -775,6 +776,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
775 LookupUUIDSCompleted, 776 LookupUUIDSCompleted,
776 d); 777 d);
777 } 778 }
779
778 private void LookupUUIDsAsync(List<UUID> uuidLst) 780 private void LookupUUIDsAsync(List<UUID> uuidLst)
779 { 781 {
780 UUID[] uuidarr; 782 UUID[] uuidarr;
@@ -789,12 +791,12 @@ namespace OpenSim.Region.CoreModules.World.Estate
789 // string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]); 791 // string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]);
790 792
791 IUserManagement userManager = m_scene.RequestModuleInterface<IUserManagement>(); 793 IUserManagement userManager = m_scene.RequestModuleInterface<IUserManagement>();
792 string userName = "Unkown User";
793 if (userManager != null) 794 if (userManager != null)
794 userName = userManager.GetUserName(uuidarr[i]); 795 userManager.GetUserName(uuidarr[i]);
795 796
796 // we drop it. It gets cached though... so we're ready for the next request. 797 // we drop it. It gets cached though... so we're ready for the next request.
797 // diva commnent 11/21/2010: uh?!? wft? 798 // diva commnent 11/21/2010: uh?!? wft?
799 // justincc comment 21/01/2011: A side effect of userManager.GetUserName() I presume.
798 } 800 }
799 } 801 }
800 #endregion 802 #endregion
diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs
index 1ad4db2..9e27ef0 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Region.CoreModules.World.Land
64 #endregion 64 #endregion
65 65
66 private readonly Scene m_scene; 66 private readonly Scene m_scene;
67 private readonly LandManagementModule m_landManagementModule; 67 private readonly LandManagementModule m_landManagementModule;
68 68
69 public LandChannel(Scene scene, LandManagementModule landManagementMod) 69 public LandChannel(Scene scene, LandManagementModule landManagementMod)
70 { 70 {
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 4f8e205..70767f7 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -30,6 +30,7 @@ using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Diagnostics; 31using System.Diagnostics;
32using System.Reflection; 32using System.Reflection;
33using System.Text;
33using log4net; 34using log4net;
34using Nini.Config; 35using Nini.Config;
35using OpenMetaverse; 36using OpenMetaverse;
@@ -37,19 +38,22 @@ using OpenMetaverse.StructuredData;
37using OpenMetaverse.Messages.Linden; 38using OpenMetaverse.Messages.Linden;
38using OpenSim.Framework; 39using OpenSim.Framework;
39using OpenSim.Framework.Capabilities; 40using OpenSim.Framework.Capabilities;
41using OpenSim.Framework.Console;
40using OpenSim.Framework.Servers; 42using OpenSim.Framework.Servers;
41using OpenSim.Framework.Servers.HttpServer; 43using OpenSim.Framework.Servers.HttpServer;
42using OpenSim.Services.Interfaces; 44using OpenSim.Region.CoreModules.Framework.InterfaceCommander;
43using OpenSim.Region.Framework.Interfaces; 45using OpenSim.Region.Framework.Interfaces;
44using OpenSim.Region.Framework.Scenes; 46using OpenSim.Region.Framework.Scenes;
45using OpenSim.Region.Physics.Manager; 47using OpenSim.Region.Physics.Manager;
46using Caps=OpenSim.Framework.Capabilities.Caps; 48using OpenSim.Services.Interfaces;
49using Caps = OpenSim.Framework.Capabilities.Caps;
47using GridRegion = OpenSim.Services.Interfaces.GridRegion; 50using GridRegion = OpenSim.Services.Interfaces.GridRegion;
48 51
49namespace OpenSim.Region.CoreModules.World.Land 52namespace OpenSim.Region.CoreModules.World.Land
50{ 53{
51 // used for caching 54 // used for caching
52 internal class ExtendedLandData { 55 internal class ExtendedLandData
56 {
53 public LandData LandData; 57 public LandData LandData;
54 public ulong RegionHandle; 58 public ulong RegionHandle;
55 public uint X, Y; 59 public uint X, Y;
@@ -65,6 +69,9 @@ namespace OpenSim.Region.CoreModules.World.Land
65 69
66 private LandChannel landChannel; 70 private LandChannel landChannel;
67 private Scene m_scene; 71 private Scene m_scene;
72 protected Commander m_commander = new Commander("land");
73
74 protected IUserManagement m_userManager;
68 75
69 // Minimum for parcels to work is 64m even if we don't actually use them. 76 // Minimum for parcels to work is 64m even if we don't actually use them.
70 #pragma warning disable 0429 77 #pragma warning disable 0429
@@ -127,19 +134,27 @@ namespace OpenSim.Region.CoreModules.World.Land
127 m_scene.EventManager.OnRequestParcelPrimCountUpdate += EventManagerOnRequestParcelPrimCountUpdate; 134 m_scene.EventManager.OnRequestParcelPrimCountUpdate += EventManagerOnRequestParcelPrimCountUpdate;
128 m_scene.EventManager.OnParcelPrimCountTainted += EventManagerOnParcelPrimCountTainted; 135 m_scene.EventManager.OnParcelPrimCountTainted += EventManagerOnParcelPrimCountTainted;
129 m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; 136 m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps;
137 m_scene.EventManager.OnPluginConsole += EventManagerOnPluginConsole;
130 138
131 lock (m_scene) 139 lock (m_scene)
132 { 140 {
133 m_scene.LandChannel = (ILandChannel)landChannel; 141 m_scene.LandChannel = (ILandChannel)landChannel;
134 } 142 }
143
144 InstallInterfaces();
135 } 145 }
136 146
137 public void RegionLoaded(Scene scene) 147 public void RegionLoaded(Scene scene)
138 { 148 {
149 m_userManager = m_scene.RequestModuleInterface<IUserManagement>();
139 } 150 }
140 151
141 public void RemoveRegion(Scene scene) 152 public void RemoveRegion(Scene scene)
142 { 153 {
154 // TODO: Also release other event manager listeners here
155
156 m_scene.EventManager.OnPluginConsole -= EventManagerOnPluginConsole;
157 m_scene.UnregisterModuleCommander(m_commander.Name);
143 } 158 }
144 159
145// private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason) 160// private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason)
@@ -148,6 +163,29 @@ namespace OpenSim.Region.CoreModules.World.Land
148// reason = "You are not allowed to enter this sim."; 163// reason = "You are not allowed to enter this sim.";
149// return nearestParcel != null; 164// return nearestParcel != null;
150// } 165// }
166
167 /// <summary>
168 /// Processes commandline input. Do not call directly.
169 /// </summary>
170 /// <param name="args">Commandline arguments</param>
171 protected void EventManagerOnPluginConsole(string[] args)
172 {
173 if (args[0] == "land")
174 {
175 if (args.Length == 1)
176 {
177 m_commander.ProcessConsoleCommand("help", new string[0]);
178 return;
179 }
180
181 string[] tmpArgs = new string[args.Length - 2];
182 int i;
183 for (i = 2; i < args.Length; i++)
184 tmpArgs[i - 2] = args[i];
185
186 m_commander.ProcessConsoleCommand(args[1], tmpArgs);
187 }
188 }
151 189
152 void EventManagerOnNewClient(IClientAPI client) 190 void EventManagerOnNewClient(IClientAPI client)
153 { 191 {
@@ -209,11 +247,6 @@ namespace OpenSim.Region.CoreModules.World.Land
209 } 247 }
210 } 248 }
211 249
212
213 public void PostInitialise()
214 {
215 }
216
217 public void Close() 250 public void Close()
218 { 251 {
219 } 252 }
@@ -223,11 +256,6 @@ namespace OpenSim.Region.CoreModules.World.Land
223 get { return "LandManagementModule"; } 256 get { return "LandManagementModule"; }
224 } 257 }
225 258
226 public bool IsSharedModule
227 {
228 get { return false; }
229 }
230
231 #endregion 259 #endregion
232 260
233 #region Parcel Add/Remove/Get/Create 261 #region Parcel Add/Remove/Get/Create
@@ -1591,5 +1619,44 @@ namespace OpenSim.Region.CoreModules.World.Land
1591 1619
1592 UpdateLandObject(localID, land.LandData); 1620 UpdateLandObject(localID, land.LandData);
1593 } 1621 }
1622
1623 protected void InstallInterfaces()
1624 {
1625 Command showCommand =
1626 new Command("show", CommandIntentions.COMMAND_STATISTICAL, ShowParcelsCommand, "Shows all parcels on the current region.");
1627
1628 m_commander.RegisterCommand("show", showCommand);
1629
1630 // Add this to our scene so scripts can call these functions
1631 m_scene.RegisterModuleCommander(m_commander);
1632 }
1633
1634 protected void ShowParcelsCommand(Object[] args)
1635 {
1636 StringBuilder report = new StringBuilder();
1637
1638 report.AppendFormat("Land information for {0}\n", m_scene.RegionInfo.RegionName);
1639 report.AppendFormat(
1640 "{0,-20} {1,-9} {2,-18} {3,-18} {4,-20}\n",
1641 "Parcel Name",
1642 "Area",
1643 "Starts",
1644 "Ends",
1645 "Owner");
1646
1647 lock (m_landList)
1648 {
1649 foreach (ILandObject lo in m_landList.Values)
1650 {
1651 LandData ld = lo.LandData;
1652
1653 report.AppendFormat(
1654 "{0,-20} {1,-9} {2,-18} {3,-18} {4,-20}\n",
1655 ld.Name, ld.Area, lo.StartPoint, lo.EndPoint, m_userManager.GetUserName(ld.OwnerID));
1656 }
1657 }
1658
1659 MainConsole.Instance.Output(report.ToString());
1660 }
1594 } 1661 }
1595} 1662} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 3e41c55..b90e307 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -77,7 +77,43 @@ namespace OpenSim.Region.CoreModules.World.Land
77 { 77 {
78 get { return m_scene.RegionInfo.RegionID; } 78 get { return m_scene.RegionInfo.RegionID; }
79 } 79 }
80 80
81 public Vector3 StartPoint
82 {
83 get
84 {
85 for (int y = 0; y < landArrayMax; y++)
86 {
87 for (int x = 0; x < landArrayMax; x++)
88 {
89 if (LandBitmap[x, y])
90 return new Vector3(x * 4, y * 4, 0);
91 }
92 }
93
94 return new Vector3(-1, -1, -1);
95 }
96 }
97
98 public Vector3 EndPoint
99 {
100 get
101 {
102 for (int y = landArrayMax - 1; y >= 0; y--)
103 {
104 for (int x = landArrayMax - 1; x >= 0; x--)
105 {
106 if (LandBitmap[x, y])
107 {
108 return new Vector3(x * 4, y * 4, 0);
109 }
110 }
111 }
112
113 return new Vector3(-1, -1, -1);
114 }
115 }
116
81 #region Constructors 117 #region Constructors
82 118
83 public LandObject(UUID owner_id, bool is_group_owned, Scene scene) 119 public LandObject(UUID owner_id, bool is_group_owned, Scene scene)
@@ -96,7 +132,7 @@ namespace OpenSim.Region.CoreModules.World.Land
96 #region Member Functions 132 #region Member Functions
97 133
98 #region General Functions 134 #region General Functions
99 135
100 /// <summary> 136 /// <summary>
101 /// Checks to see if this land object contains a point 137 /// Checks to see if this land object contains a point
102 /// </summary> 138 /// </summary>
@@ -217,6 +253,7 @@ namespace OpenSim.Region.CoreModules.World.Land
217 ParcelFlags.AllowDamage | 253 ParcelFlags.AllowDamage |
218 ParcelFlags.CreateObjects | 254 ParcelFlags.CreateObjects |
219 ParcelFlags.RestrictPushObject | 255 ParcelFlags.RestrictPushObject |
256 ParcelFlags.AllowOtherScripts |
220 ParcelFlags.AllowGroupScripts | 257 ParcelFlags.AllowGroupScripts |
221 ParcelFlags.CreateGroupObjects | 258 ParcelFlags.CreateGroupObjects |
222 ParcelFlags.AllowAPrimitiveEntry | 259 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/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index f9d28b9..e0f36a2 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -641,7 +641,17 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
641 lock (m_openRequests) 641 lock (m_openRequests)
642 m_openRequests.Add(requestID, mrs); 642 m_openRequests.Add(requestID, mrs);
643 643
644 WebRequest mapitemsrequest = WebRequest.Create(httpserver); 644 WebRequest mapitemsrequest = null;
645 try
646 {
647 mapitemsrequest = WebRequest.Create(httpserver);
648 }
649 catch (Exception e)
650 {
651 m_log.DebugFormat("[WORLD MAP]: Access to {0} failed with {1}", httpserver, e);
652 return new OSDMap();
653 }
654
645 mapitemsrequest.Method = "POST"; 655 mapitemsrequest.Method = "POST";
646 mapitemsrequest.ContentType = "application/xml+llsd"; 656 mapitemsrequest.ContentType = "application/xml+llsd";
647 OSDMap RAMap = new OSDMap(); 657 OSDMap RAMap = new OSDMap();
diff --git a/OpenSim/Region/Framework/Interfaces/ILandObject.cs b/OpenSim/Region/Framework/Interfaces/ILandObject.cs
index 585eb00..576b645 100644
--- a/OpenSim/Region/Framework/Interfaces/ILandObject.cs
+++ b/OpenSim/Region/Framework/Interfaces/ILandObject.cs
@@ -43,7 +43,21 @@ namespace OpenSim.Region.Framework.Interfaces
43 LandData LandData { get; set; } 43 LandData LandData { get; set; }
44 bool[,] LandBitmap { get; set; } 44 bool[,] LandBitmap { get; set; }
45 UUID RegionUUID { get; } 45 UUID RegionUUID { get; }
46
47 /// <summary>
48 /// The start point for the land object. This is the western-most point as one scans land working from
49 /// north to south.
50 /// </summary>
51 Vector3 StartPoint { get; }
52
53 /// <summary>
54 /// The end point for the land object. This is the eastern-most point as one scans land working from
55 /// south to north.
56 /// </summary>
57 Vector3 EndPoint { get; }
58
46 bool ContainsPoint(int x, int y); 59 bool ContainsPoint(int x, int y);
60
47 ILandObject Copy(); 61 ILandObject Copy();
48 62
49 void SendLandUpdateToAvatarsOverMe(); 63 void SendLandUpdateToAvatarsOverMe();
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 12fd813..dc08b49 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -498,12 +498,6 @@ namespace OpenSim.Region.Framework.Scenes
498 get { return m_sceneGraph.Entities; } 498 get { return m_sceneGraph.Entities; }
499 } 499 }
500 500
501 public Dictionary<UUID, ScenePresence> m_restorePresences
502 {
503 get { return m_sceneGraph.RestorePresences; }
504 set { m_sceneGraph.RestorePresences = value; }
505 }
506
507 #endregion Properties 501 #endregion Properties
508 502
509 #region Constructors 503 #region Constructors
@@ -2483,56 +2477,26 @@ namespace OpenSim.Region.Framework.Scenes
2483 (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0; 2477 (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0;
2484 2478
2485 CheckHeartbeat(); 2479 CheckHeartbeat();
2486 ScenePresence presence;
2487 2480
2488 if (m_restorePresences.ContainsKey(client.AgentId)) 2481 if (GetScenePresence(client.AgentId) == null) // ensure there is no SP here
2489 { 2482 {
2490 m_log.DebugFormat("[SCENE]: Restoring agent {0} {1} in {2}", client.Name, client.AgentId, RegionInfo.RegionName); 2483 m_log.Debug("[SCENE]: Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName);
2491 2484
2492 m_clientManager.Add(client); 2485 m_clientManager.Add(client);
2493 SubscribeToClientEvents(client); 2486 SubscribeToClientEvents(client);
2494 2487
2495 presence = m_restorePresences[client.AgentId]; 2488 ScenePresence sp = m_sceneGraph.CreateAndAddChildScenePresence(client, aCircuit.Appearance);
2496 m_restorePresences.Remove(client.AgentId); 2489 m_eventManager.TriggerOnNewPresence(sp);
2497
2498 // This is one of two paths to create avatars that are
2499 // used. This tends to get called more in standalone
2500 // than grid, not really sure why, but as such needs
2501 // an explicity appearance lookup here.
2502 AvatarAppearance appearance = null;
2503 GetAvatarAppearance(client, out appearance);
2504 presence.Appearance = appearance;
2505 2490
2506 presence.initializeScenePresence(client, RegionInfo, this); 2491 sp.TeleportFlags = (TeleportFlags)aCircuit.teleportFlags;
2507 2492
2508 m_sceneGraph.AddScenePresence(presence); 2493 // HERE!!! Do the initial attachments right here
2509 2494 // first agent upon login is a root agent by design.
2510 lock (m_restorePresences) 2495 // All other AddNewClient calls find aCircuit.child to be true
2496 if (aCircuit.child == false)
2511 { 2497 {
2512 Monitor.PulseAll(m_restorePresences); 2498 sp.IsChildAgent = false;
2513 } 2499 Util.FireAndForget(delegate(object o) { sp.RezAttachments(); });
2514 }
2515 else
2516 {
2517 if (GetScenePresence(client.AgentId) == null) // ensure there is no SP here
2518 {
2519 m_log.Debug("[SCENE]: Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName);
2520
2521 m_clientManager.Add(client);
2522 SubscribeToClientEvents(client);
2523
2524 ScenePresence sp = CreateAndAddScenePresence(client);
2525 if (aCircuit != null)
2526 sp.Appearance = aCircuit.Appearance;
2527
2528 // HERE!!! Do the initial attachments right here
2529 // first agent upon login is a root agent by design.
2530 // All other AddNewClient calls find aCircuit.child to be true
2531 if (aCircuit == null || (aCircuit != null && aCircuit.child == false))
2532 {
2533 sp.IsChildAgent = false;
2534 Util.FireAndForget(delegate(object o) { sp.RezAttachments(); });
2535 }
2536 } 2500 }
2537 } 2501 }
2538 2502
@@ -2997,25 +2961,6 @@ namespace OpenSim.Region.Framework.Scenes
2997 } 2961 }
2998 2962
2999 /// <summary> 2963 /// <summary>
3000 /// Create a child agent scene presence and add it to this scene.
3001 /// </summary>
3002 /// <param name="client"></param>
3003 /// <returns></returns>
3004 protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client)
3005 {
3006 CheckHeartbeat();
3007 AvatarAppearance appearance = null;
3008 GetAvatarAppearance(client, out appearance);
3009
3010 ScenePresence avatar = m_sceneGraph.CreateAndAddChildScenePresence(client, appearance);
3011 //avatar.KnownRegions = GetChildrenSeeds(avatar.UUID);
3012
3013 m_eventManager.TriggerOnNewPresence(avatar);
3014
3015 return avatar;
3016 }
3017
3018 /// <summary>
3019 /// Get the avatar apperance for the given client. 2964 /// Get the avatar apperance for the given client.
3020 /// </summary> 2965 /// </summary>
3021 /// <param name="client"></param> 2966 /// <param name="client"></param>
@@ -3324,6 +3269,10 @@ namespace OpenSim.Region.Framework.Scenes
3324 } 3269 }
3325 else 3270 else
3326 { 3271 {
3272 // Let the SP know how we got here. This has a lot of interesting
3273 // uses down the line.
3274 sp.TeleportFlags = (TeleportFlags)teleportFlags;
3275
3327 if (sp.IsChildAgent) 3276 if (sp.IsChildAgent)
3328 { 3277 {
3329 m_log.DebugFormat( 3278 m_log.DebugFormat(
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index a2ed54f..969ff13 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -73,7 +73,6 @@ namespace OpenSim.Region.Framework.Scenes
73 protected List<ScenePresence> m_scenePresenceArray = new List<ScenePresence>(); 73 protected List<ScenePresence> m_scenePresenceArray = new List<ScenePresence>();
74 74
75 protected internal EntityManager Entities = new EntityManager(); 75 protected internal EntityManager Entities = new EntityManager();
76 protected internal Dictionary<UUID, ScenePresence> RestorePresences = new Dictionary<UUID, ScenePresence>();
77 76
78 protected RegionInfo m_regInfo; 77 protected RegionInfo m_regInfo;
79 protected Scene m_parentScene; 78 protected Scene m_parentScene;
@@ -564,8 +563,8 @@ namespace OpenSim.Region.Framework.Scenes
564 { 563 {
565 ScenePresence newAvatar = null; 564 ScenePresence newAvatar = null;
566 565
566 // ScenePresence always defaults to child agent
567 newAvatar = new ScenePresence(client, m_parentScene, m_regInfo, appearance); 567 newAvatar = new ScenePresence(client, m_parentScene, m_regInfo, appearance);
568 newAvatar.IsChildAgent = true;
569 568
570 AddScenePresence(newAvatar); 569 AddScenePresence(newAvatar);
571 570
@@ -578,6 +577,7 @@ namespace OpenSim.Region.Framework.Scenes
578 /// <param name="presence"></param> 577 /// <param name="presence"></param>
579 protected internal void AddScenePresence(ScenePresence presence) 578 protected internal void AddScenePresence(ScenePresence presence)
580 { 579 {
580 // Always a child when added to the scene
581 bool child = presence.IsChildAgent; 581 bool child = presence.IsChildAgent;
582 582
583 if (child) 583 if (child)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 91bb3a5..67e59c6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -178,6 +178,8 @@ namespace OpenSim.Region.Framework.Scenes
178 { 178 {
179 item.LastOwnerID = item.OwnerID; 179 item.LastOwnerID = item.OwnerID;
180 item.OwnerID = ownerId; 180 item.OwnerID = ownerId;
181 item.PermsMask = 0;
182 item.PermsGranter = UUID.Zero;
181 } 183 }
182 } 184 }
183 } 185 }
@@ -695,7 +697,6 @@ namespace OpenSim.Region.Framework.Scenes
695 { 697 {
696 item.ParentID = m_part.UUID; 698 item.ParentID = m_part.UUID;
697 item.ParentPartID = m_part.UUID; 699 item.ParentPartID = m_part.UUID;
698 item.Flags = m_items[item.ItemID].Flags;
699 700
700 // If group permissions have been set on, check that the groupID is up to date in case it has 701 // If group permissions have been set on, check that the groupID is up to date in case it has
701 // changed since permissions were last set. 702 // changed since permissions were last set.
@@ -850,7 +851,7 @@ namespace OpenSim.Region.Framework.Scenes
850 /// <param name="xferManager"></param> 851 /// <param name="xferManager"></param>
851 public void RequestInventoryFile(IClientAPI client, IXfer xferManager) 852 public void RequestInventoryFile(IClientAPI client, IXfer xferManager)
852 { 853 {
853 bool changed = CreateInventoryFile(); 854 CreateInventoryFile();
854 855
855 if (m_inventorySerial == 0) // No inventory 856 if (m_inventorySerial == 0) // No inventory
856 { 857 {
@@ -1013,6 +1014,8 @@ namespace OpenSim.Region.Framework.Scenes
1013 item.BasePermissions &= item.NextPermissions; 1014 item.BasePermissions &= item.NextPermissions;
1014 item.EveryonePermissions &= item.NextPermissions; 1015 item.EveryonePermissions &= item.NextPermissions;
1015 item.OwnerChanged = true; 1016 item.OwnerChanged = true;
1017 item.PermsMask = 0;
1018 item.PermsGranter = UUID.Zero;
1016 } 1019 }
1017 } 1020 }
1018 } 1021 }
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 3a40196..1c276fa 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -130,6 +130,13 @@ namespace OpenSim.Region.Framework.Scenes
130 private bool m_updateflag; 130 private bool m_updateflag;
131 private byte m_movementflag; 131 private byte m_movementflag;
132 private Vector3? m_forceToApply; 132 private Vector3? m_forceToApply;
133 private TeleportFlags m_teleportFlags;
134 public TeleportFlags TeleportFlags
135 {
136 get { return m_teleportFlags; }
137 set { m_teleportFlags = value; }
138 }
139
133 private uint m_requestedSitTargetID; 140 private uint m_requestedSitTargetID;
134 private UUID m_requestedSitTargetUUID; 141 private UUID m_requestedSitTargetUUID;
135 public bool SitGround = false; 142 public bool SitGround = false;
@@ -928,10 +935,6 @@ namespace OpenSim.Region.Framework.Scenes
928 //else 935 //else
929 // m_log.ErrorFormat("[SCENE]: Could not find user info for {0} when making it a root agent", m_uuid); 936 // m_log.ErrorFormat("[SCENE]: Could not find user info for {0} when making it a root agent", m_uuid);
930 937
931 // On the next prim update, all objects will be sent
932 //
933 m_sceneViewer.Reset();
934
935 m_isChildAgent = false; 938 m_isChildAgent = false;
936 939
937 // send the animations of the other presences to me 940 // send the animations of the other presences to me
@@ -953,6 +956,10 @@ namespace OpenSim.Region.Framework.Scenes
953 /// </summary> 956 /// </summary>
954 public void MakeChildAgent() 957 public void MakeChildAgent()
955 { 958 {
959 // Reset these so that teleporting in and walking out isn't seen
960 // as teleporting back
961 m_teleportFlags = TeleportFlags.Default;
962
956 // It looks like m_animator is set to null somewhere, and MakeChild 963 // It looks like m_animator is set to null somewhere, and MakeChild
957 // is called after that. Probably in aborted teleports. 964 // is called after that. Probably in aborted teleports.
958 if (m_animator == null) 965 if (m_animator == null)
@@ -1108,7 +1115,7 @@ namespace OpenSim.Region.Framework.Scenes
1108 /// </summary> 1115 /// </summary>
1109 public void CompleteMovement(IClientAPI client) 1116 public void CompleteMovement(IClientAPI client)
1110 { 1117 {
1111 DateTime startTime = DateTime.Now; 1118// DateTime startTime = DateTime.Now;
1112 1119
1113 m_log.DebugFormat( 1120 m_log.DebugFormat(
1114 "[SCENE PRESENCE]: Completing movement of {0} into region {1}", 1121 "[SCENE PRESENCE]: Completing movement of {0} into region {1}",
@@ -1161,9 +1168,9 @@ namespace OpenSim.Region.Framework.Scenes
1161 friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); 1168 friendsModule.SendFriendsOnlineIfNeeded(ControllingClient);
1162 } 1169 }
1163 1170
1164 m_log.DebugFormat( 1171// m_log.DebugFormat(
1165 "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", 1172// "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms",
1166 client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); 1173// client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds);
1167 } 1174 }
1168 1175
1169 /// <summary> 1176 /// <summary>
@@ -2952,10 +2959,6 @@ namespace OpenSim.Region.Framework.Scenes
2952 if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) 2959 if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0)
2953 ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); 2960 ControllingClient.SetChildAgentThrottle(cAgentData.Throttles);
2954 2961
2955 // Sends out the objects in the user's draw distance if m_sendTasksToChild is true.
2956 if (m_scene.m_seeIntoRegionFromNeighbor)
2957 m_sceneViewer.Reset();
2958
2959 //cAgentData.AVHeight; 2962 //cAgentData.AVHeight;
2960 m_rootRegionHandle = cAgentData.RegionHandle; 2963 m_rootRegionHandle = cAgentData.RegionHandle;
2961 //m_velocity = cAgentData.Velocity; 2964 //m_velocity = cAgentData.Velocity;
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
diff --git a/OpenSim/Server/Handlers/Grid/GridInfoServerInConnector.cs b/OpenSim/Server/Handlers/Grid/GridInfoServerInConnector.cs
index c9e80d9..8472d34 100644
--- a/OpenSim/Server/Handlers/Grid/GridInfoServerInConnector.cs
+++ b/OpenSim/Server/Handlers/Grid/GridInfoServerInConnector.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Server.Handlers.Grid
39{ 39{
40 public class GridInfoServerInConnector : ServiceConnector 40 public class GridInfoServerInConnector : ServiceConnector
41 { 41 {
42 private string m_ConfigName = "GridInfoService"; 42// private string m_ConfigName = "GridInfoService";
43 43
44 public GridInfoServerInConnector(IConfigSource config, IHttpServer server, string configName) : 44 public GridInfoServerInConnector(IConfigSource config, IHttpServer server, string configName) :
45 base(config, server, configName) 45 base(config, server, configName)
diff --git a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs
index 31eefb1..f3f81b0 100644
--- a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs
@@ -51,7 +51,8 @@ namespace OpenSim.Server.Handlers.Hypergrid
51{ 51{
52 public class GatekeeperAgentHandler : OpenSim.Server.Handlers.Simulation.AgentHandler 52 public class GatekeeperAgentHandler : OpenSim.Server.Handlers.Simulation.AgentHandler
53 { 53 {
54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55
55 private IGatekeeperService m_GatekeeperService; 56 private IGatekeeperService m_GatekeeperService;
56 57
57 public GatekeeperAgentHandler(IGatekeeperService gatekeeper, bool proxy) 58 public GatekeeperAgentHandler(IGatekeeperService gatekeeper, bool proxy)
diff --git a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs
index 49de8b1..3d0967f 100644
--- a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs
@@ -41,9 +41,9 @@ namespace OpenSim.Server.Handlers.Hypergrid
41{ 41{
42 public class GatekeeperServiceInConnector : ServiceConnector 42 public class GatekeeperServiceInConnector : ServiceConnector
43 { 43 {
44 private static readonly ILog m_log = 44// private static readonly ILog m_log =
45 LogManager.GetLogger( 45// LogManager.GetLogger(
46 MethodBase.GetCurrentMethod().DeclaringType); 46// MethodBase.GetCurrentMethod().DeclaringType);
47 47
48 private IGatekeeperService m_GatekeeperService; 48 private IGatekeeperService m_GatekeeperService;
49 public IGatekeeperService GateKeeper 49 public IGatekeeperService GateKeeper
diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
index 0066bd4..968c1e6 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
@@ -215,15 +215,22 @@ namespace OpenSim.Server.Handlers.Hypergrid
215 215
216 // We're behind a proxy 216 // We're behind a proxy
217 Hashtable headers = (Hashtable)request["headers"]; 217 Hashtable headers = (Hashtable)request["headers"];
218 if (headers.ContainsKey("X-Forwarded-For") && headers["X-Forwarded-For"] != null) 218 string xff = "X-Forwarded-For";
219 { 219 if (headers.ContainsKey(xff.ToLower()))
220 m_log.DebugFormat("[HOME AGENT HANDLER]: XFF is {0}", headers["X-Forwarded-For"]); 220 xff = xff.ToLower();
221 221
222 IPEndPoint ep = Util.GetClientIPFromXFF((string)headers["X-Forwarded-For"]); 222 if (!headers.ContainsKey(xff) || headers[xff] == null)
223 if (ep != null) 223 {
224 return ep.Address.ToString(); 224 m_log.WarnFormat("[AGENT HANDLER]: No XFF header");
225 return Util.GetCallerIP(request);
225 } 226 }
226 227
228 m_log.DebugFormat("[AGENT HANDLER]: XFF is {0}", headers[xff]);
229
230 IPEndPoint ep = Util.GetClientIPFromXFF((string)headers[xff]);
231 if (ep != null)
232 return ep.Address.ToString();
233
227 // Oops 234 // Oops
228 return Util.GetCallerIP(request); 235 return Util.GetCallerIP(request);
229 } 236 }
diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
index e5f6a5d..0e8ce80 100644
--- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
@@ -47,9 +47,9 @@ namespace OpenSim.Server.Handlers.Hypergrid
47{ 47{
48 public class UserAgentServerConnector : ServiceConnector 48 public class UserAgentServerConnector : ServiceConnector
49 { 49 {
50 private static readonly ILog m_log = 50// private static readonly ILog m_log =
51 LogManager.GetLogger( 51// LogManager.GetLogger(
52 MethodBase.GetCurrentMethod().DeclaringType); 52// MethodBase.GetCurrentMethod().DeclaringType);
53 53
54 private IUserAgentService m_HomeUsersService; 54 private IUserAgentService m_HomeUsersService;
55 55
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index 00f035c..899f9c0 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -347,7 +347,6 @@ namespace OpenSim.Server.Handlers.Asset
347 347
348 byte[] HandleAddFolder(Dictionary<string,object> request) 348 byte[] HandleAddFolder(Dictionary<string,object> request)
349 { 349 {
350 Dictionary<string,object> result = new Dictionary<string,object>();
351 InventoryFolderBase folder = BuildFolder(request); 350 InventoryFolderBase folder = BuildFolder(request);
352 351
353 if (m_InventoryService.AddFolder(folder)) 352 if (m_InventoryService.AddFolder(folder))
@@ -358,7 +357,6 @@ namespace OpenSim.Server.Handlers.Asset
358 357
359 byte[] HandleUpdateFolder(Dictionary<string,object> request) 358 byte[] HandleUpdateFolder(Dictionary<string,object> request)
360 { 359 {
361 Dictionary<string, object> result = new Dictionary<string, object>();
362 InventoryFolderBase folder = BuildFolder(request); 360 InventoryFolderBase folder = BuildFolder(request);
363 361
364 if (m_InventoryService.UpdateFolder(folder)) 362 if (m_InventoryService.UpdateFolder(folder))
@@ -369,7 +367,6 @@ namespace OpenSim.Server.Handlers.Asset
369 367
370 byte[] HandleMoveFolder(Dictionary<string,object> request) 368 byte[] HandleMoveFolder(Dictionary<string,object> request)
371 { 369 {
372 Dictionary<string, object> result = new Dictionary<string, object>();
373 UUID parentID = UUID.Zero; 370 UUID parentID = UUID.Zero;
374 UUID.TryParse(request["ParentID"].ToString(), out parentID); 371 UUID.TryParse(request["ParentID"].ToString(), out parentID);
375 UUID folderID = UUID.Zero; 372 UUID folderID = UUID.Zero;
@@ -387,7 +384,6 @@ namespace OpenSim.Server.Handlers.Asset
387 384
388 byte[] HandleDeleteFolders(Dictionary<string,object> request) 385 byte[] HandleDeleteFolders(Dictionary<string,object> request)
389 { 386 {
390 Dictionary<string,object> result = new Dictionary<string,object>();
391 UUID principal = UUID.Zero; 387 UUID principal = UUID.Zero;
392 UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); 388 UUID.TryParse(request["PRINCIPAL"].ToString(), out principal);
393 List<string> slist = (List<string>)request["FOLDERS"]; 389 List<string> slist = (List<string>)request["FOLDERS"];
@@ -408,7 +404,6 @@ namespace OpenSim.Server.Handlers.Asset
408 404
409 byte[] HandlePurgeFolder(Dictionary<string,object> request) 405 byte[] HandlePurgeFolder(Dictionary<string,object> request)
410 { 406 {
411 Dictionary<string,object> result = new Dictionary<string,object>();
412 UUID folderID = UUID.Zero; 407 UUID folderID = UUID.Zero;
413 UUID.TryParse(request["ID"].ToString(), out folderID); 408 UUID.TryParse(request["ID"].ToString(), out folderID);
414 409
@@ -421,7 +416,6 @@ namespace OpenSim.Server.Handlers.Asset
421 416
422 byte[] HandleAddItem(Dictionary<string,object> request) 417 byte[] HandleAddItem(Dictionary<string,object> request)
423 { 418 {
424 Dictionary<string, object> result = new Dictionary<string, object>();
425 InventoryItemBase item = BuildItem(request); 419 InventoryItemBase item = BuildItem(request);
426 420
427 if (m_InventoryService.AddItem(item)) 421 if (m_InventoryService.AddItem(item))
@@ -432,7 +426,6 @@ namespace OpenSim.Server.Handlers.Asset
432 426
433 byte[] HandleUpdateItem(Dictionary<string,object> request) 427 byte[] HandleUpdateItem(Dictionary<string,object> request)
434 { 428 {
435 Dictionary<string, object> result = new Dictionary<string, object>();
436 InventoryItemBase item = BuildItem(request); 429 InventoryItemBase item = BuildItem(request);
437 430
438 if (m_InventoryService.UpdateItem(item)) 431 if (m_InventoryService.UpdateItem(item))
@@ -443,7 +436,6 @@ namespace OpenSim.Server.Handlers.Asset
443 436
444 byte[] HandleMoveItems(Dictionary<string,object> request) 437 byte[] HandleMoveItems(Dictionary<string,object> request)
445 { 438 {
446 Dictionary<string,object> result = new Dictionary<string,object>();
447 List<string> idlist = (List<string>)request["IDLIST"]; 439 List<string> idlist = (List<string>)request["IDLIST"];
448 List<string> destlist = (List<string>)request["DESTLIST"]; 440 List<string> destlist = (List<string>)request["DESTLIST"];
449 UUID principal = UUID.Zero; 441 UUID principal = UUID.Zero;
@@ -482,7 +474,6 @@ namespace OpenSim.Server.Handlers.Asset
482 474
483 byte[] HandleDeleteItems(Dictionary<string,object> request) 475 byte[] HandleDeleteItems(Dictionary<string,object> request)
484 { 476 {
485 Dictionary<string, object> result = new Dictionary<string, object>();
486 UUID principal = UUID.Zero; 477 UUID principal = UUID.Zero;
487 UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); 478 UUID.TryParse(request["PRINCIPAL"].ToString(), out principal);
488 List<string> slist = (List<string>)request["ITEMS"]; 479 List<string> slist = (List<string>)request["ITEMS"];
diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
index 3104917..85bf96e 100644
--- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
@@ -129,8 +129,6 @@ namespace OpenSim.Server.Handlers.Presence
129 byte[] LogoutAgent(Dictionary<string, object> request) 129 byte[] LogoutAgent(Dictionary<string, object> request)
130 { 130 {
131 UUID session = UUID.Zero; 131 UUID session = UUID.Zero;
132 Vector3 position = Vector3.Zero;
133 Vector3 lookat = Vector3.Zero;
134 132
135 if (!request.ContainsKey("SessionID")) 133 if (!request.ContainsKey("SessionID"))
136 return FailureResult(); 134 return FailureResult();
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 9c41bcb..57672a8 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -200,15 +200,22 @@ namespace OpenSim.Server.Handlers.Simulation
200 200
201 // We're behind a proxy 201 // We're behind a proxy
202 Hashtable headers = (Hashtable)request["headers"]; 202 Hashtable headers = (Hashtable)request["headers"];
203 if (headers.ContainsKey("X-Forwarded-For") && headers["X-Forwarded-For"] != null) 203 string xff = "X-Forwarded-For";
204 { 204 if (headers.ContainsKey(xff.ToLower()))
205 m_log.DebugFormat("[AGENT HANDLER]: XFF is {0}", headers["X-Forwarded-For"]); 205 xff = xff.ToLower();
206 206
207 IPEndPoint ep = Util.GetClientIPFromXFF((string)headers["X-Forwarded-For"]); 207 if (!headers.ContainsKey(xff) || headers[xff] == null)
208 if (ep != null) 208 {
209 return ep.Address.ToString(); 209 m_log.WarnFormat("[AGENT HANDLER]: No XFF header");
210 return Util.GetCallerIP(request);
210 } 211 }
211 212
213 m_log.DebugFormat("[AGENT HANDLER]: XFF is {0}", headers[xff]);
214
215 IPEndPoint ep = Util.GetClientIPFromXFF((string)headers[xff]);
216 if (ep != null)
217 return ep.Address.ToString();
218
212 // Oops 219 // Oops
213 return Util.GetCallerIP(request); 220 return Util.GetCallerIP(request);
214 } 221 }
diff --git a/OpenSim/Server/Handlers/Simulation/SimulationServiceInConnector.cs b/OpenSim/Server/Handlers/Simulation/SimulationServiceInConnector.cs
index 50d6fb2..f33eda7 100644
--- a/OpenSim/Server/Handlers/Simulation/SimulationServiceInConnector.cs
+++ b/OpenSim/Server/Handlers/Simulation/SimulationServiceInConnector.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Server.Handlers.Simulation
38 public class SimulationServiceInConnector : ServiceConnector 38 public class SimulationServiceInConnector : ServiceConnector
39 { 39 {
40 private ISimulationService m_LocalSimulationService; 40 private ISimulationService m_LocalSimulationService;
41 private IAuthenticationService m_AuthenticationService; 41// private IAuthenticationService m_AuthenticationService;
42 42
43 public SimulationServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) : 43 public SimulationServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) :
44 base(config, server, String.Empty) 44 base(config, server, String.Empty)
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
index 18a31670..918544f 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
56 MethodBase.GetCurrentMethod().DeclaringType); 56 MethodBase.GetCurrentMethod().DeclaringType);
57 57
58 private string m_ServerURI = String.Empty; 58 private string m_ServerURI = String.Empty;
59 private bool m_Enabled = false; 59// private bool m_Enabled = false;
60 60
61 public SimianGridServiceConnector() { } 61 public SimianGridServiceConnector() { }
62 public SimianGridServiceConnector(string serverURI) 62 public SimianGridServiceConnector(string serverURI)
@@ -93,7 +93,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
93 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) 93 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
94 serviceUrl = serviceUrl + '/'; 94 serviceUrl = serviceUrl + '/';
95 m_ServerURI = serviceUrl; 95 m_ServerURI = serviceUrl;
96 m_Enabled = true; 96// m_Enabled = true;
97 } 97 }
98 98
99 #region IGridService 99 #region IGridService
@@ -175,7 +175,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
175 } 175 }
176 } 176 }
177 177
178 m_log.Debug("[SIMIAN GRID CONNECTOR]: Found " + regions.Count + " neighbors for region " + regionID); 178// m_log.Debug("[SIMIAN GRID CONNECTOR]: Found " + regions.Count + " neighbors for region " + regionID);
179 return regions; 179 return regions;
180 } 180 }
181 181
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
index 61f3fbe..39df1f5 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
@@ -757,7 +757,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
757 } 757 }
758 } 758 }
759 759
760 m_log.Debug("[SIMIAN INVENTORY CONNECTOR]: Parsed " + invFolders.Count + " folders from SimianGrid response"); 760// m_log.Debug("[SIMIAN INVENTORY CONNECTOR]: Parsed " + invFolders.Count + " folders from SimianGrid response");
761 return invFolders; 761 return invFolders;
762 } 762 }
763 763
@@ -824,7 +824,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
824 } 824 }
825 } 825 }
826 826
827 m_log.Debug("[SIMIAN INVENTORY CONNECTOR]: Parsed " + invItems.Count + " items from SimianGrid response"); 827// m_log.Debug("[SIMIAN INVENTORY CONNECTOR]: Parsed " + invItems.Count + " items from SimianGrid response");
828 return invItems; 828 return invItems;
829 } 829 }
830 830
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
index 8141420..678f738 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
158 158
159 public bool LogoutAgent(UUID sessionID) 159 public bool LogoutAgent(UUID sessionID)
160 { 160 {
161 m_log.InfoFormat("[SIMIAN PRESENCE CONNECTOR]: Logout requested for agent with sessionID " + sessionID); 161// m_log.InfoFormat("[SIMIAN PRESENCE CONNECTOR]: Logout requested for agent with sessionID " + sessionID);
162 162
163 NameValueCollection requestArgs = new NameValueCollection 163 NameValueCollection requestArgs = new NameValueCollection
164 { 164 {
@@ -177,7 +177,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
177 177
178 public bool LogoutRegionAgents(UUID regionID) 178 public bool LogoutRegionAgents(UUID regionID)
179 { 179 {
180 m_log.InfoFormat("[SIMIAN PRESENCE CONNECTOR]: Logout requested for all agents in region " + regionID); 180// m_log.InfoFormat("[SIMIAN PRESENCE CONNECTOR]: Logout requested for all agents in region " + regionID);
181 181
182 NameValueCollection requestArgs = new NameValueCollection 182 NameValueCollection requestArgs = new NameValueCollection
183 { 183 {
@@ -202,7 +202,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
202 202
203 public PresenceInfo GetAgent(UUID sessionID) 203 public PresenceInfo GetAgent(UUID sessionID)
204 { 204 {
205 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for agent with sessionID " + sessionID); 205// m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for agent with sessionID " + sessionID);
206 206
207 NameValueCollection requestArgs = new NameValueCollection 207 NameValueCollection requestArgs = new NameValueCollection
208 { 208 {
@@ -262,7 +262,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
262 262
263 public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) 263 public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt)
264 { 264 {
265 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Logging out user " + userID); 265// m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Logging out user " + userID);
266 266
267 // Remove the session to mark this user offline 267 // Remove the session to mark this user offline
268 if (!LogoutAgent(sessionID)) 268 if (!LogoutAgent(sessionID))
@@ -287,7 +287,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
287 287
288 public bool SetHome(string userID, UUID regionID, Vector3 position, Vector3 lookAt) 288 public bool SetHome(string userID, UUID regionID, Vector3 position, Vector3 lookAt)
289 { 289 {
290 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Setting home location for user " + userID); 290// m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Setting home location for user " + userID);
291 291
292 NameValueCollection requestArgs = new NameValueCollection 292 NameValueCollection requestArgs = new NameValueCollection
293 { 293 {
@@ -312,10 +312,10 @@ namespace OpenSim.Services.Connectors.SimianGrid
312 312
313 public GridUserInfo GetGridUserInfo(string user) 313 public GridUserInfo GetGridUserInfo(string user)
314 { 314 {
315 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for agent " + user); 315// m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for agent " + user);
316 316
317 UUID userID = new UUID(user); 317 UUID userID = new UUID(user);
318 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting user data for " + userID); 318// m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting user data for " + userID);
319 319
320 NameValueCollection requestArgs = new NameValueCollection 320 NameValueCollection requestArgs = new NameValueCollection
321 { 321 {
@@ -338,7 +338,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
338 338
339 private OSDMap GetUserData(UUID userID) 339 private OSDMap GetUserData(UUID userID)
340 { 340 {
341 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting user data for " + userID); 341// m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting user data for " + userID);
342 342
343 NameValueCollection requestArgs = new NameValueCollection 343 NameValueCollection requestArgs = new NameValueCollection
344 { 344 {
@@ -362,7 +362,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
362 OSDMap userResponse = GetUserData(userID); 362 OSDMap userResponse = GetUserData(userID);
363 if (userResponse != null) 363 if (userResponse != null)
364 { 364 {
365 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting sessions for " + userID); 365// m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting sessions for " + userID);
366 366
367 NameValueCollection requestArgs = new NameValueCollection 367 NameValueCollection requestArgs = new NameValueCollection
368 { 368 {
@@ -377,10 +377,10 @@ namespace OpenSim.Services.Connectors.SimianGrid
377 if (presence != null) 377 if (presence != null)
378 presences.Add(presence); 378 presences.Add(presence);
379 } 379 }
380 else 380// else
381 { 381// {
382 m_log.Debug("[SIMIAN PRESENCE CONNECTOR]: No session returned for " + userID + ": " + response["Message"].AsString()); 382// m_log.Debug("[SIMIAN PRESENCE CONNECTOR]: No session returned for " + userID + ": " + response["Message"].AsString());
383 } 383// }
384 } 384 }
385 385
386 return presences; 386 return presences;
@@ -424,7 +424,6 @@ namespace OpenSim.Services.Connectors.SimianGrid
424 { 424 {
425 if (userResponse != null && userResponse["User"] is OSDMap) 425 if (userResponse != null && userResponse["User"] is OSDMap)
426 { 426 {
427
428 GridUserInfo info = new GridUserInfo(); 427 GridUserInfo info = new GridUserInfo();
429 428
430 info.Online = true; 429 info.Online = true;
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
index 9c150ee..91e2976 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
@@ -157,7 +157,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
157 { 157 {
158 List<UserAccount> accounts = new List<UserAccount>(); 158 List<UserAccount> accounts = new List<UserAccount>();
159 159
160 m_log.DebugFormat("[SIMIAN ACCOUNT CONNECTOR]: Searching for user accounts with name query " + query); 160// m_log.DebugFormat("[SIMIAN ACCOUNT CONNECTOR]: Searching for user accounts with name query " + query);
161 161
162 NameValueCollection requestArgs = new NameValueCollection 162 NameValueCollection requestArgs = new NameValueCollection
163 { 163 {
@@ -193,7 +193,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
193 193
194 public bool StoreUserAccount(UserAccount data) 194 public bool StoreUserAccount(UserAccount data)
195 { 195 {
196 m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Storing user account for " + data.Name); 196// m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Storing user account for " + data.Name);
197 197
198 NameValueCollection requestArgs = new NameValueCollection 198 NameValueCollection requestArgs = new NameValueCollection
199 { 199 {
@@ -250,7 +250,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
250 private UserAccount GetUser(NameValueCollection requestArgs) 250 private UserAccount GetUser(NameValueCollection requestArgs)
251 { 251 {
252 string lookupValue = (requestArgs.Count > 1) ? requestArgs[1] : "(Unknown)"; 252 string lookupValue = (requestArgs.Count > 1) ? requestArgs[1] : "(Unknown)";
253 m_log.DebugFormat("[SIMIAN ACCOUNT CONNECTOR]: Looking up user account with query: " + lookupValue); 253// m_log.DebugFormat("[SIMIAN ACCOUNT CONNECTOR]: Looking up user account with query: " + lookupValue);
254 254
255 OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs); 255 OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
256 if (response["Success"].AsBoolean()) 256 if (response["Success"].AsBoolean())
@@ -325,4 +325,4 @@ namespace OpenSim.Services.Connectors.SimianGrid
325 } 325 }
326 } 326 }
327 } 327 }
328} 328} \ No newline at end of file
diff --git a/OpenSim/Services/Connectors/Simulation/EstateDataService.cs b/OpenSim/Services/Connectors/Simulation/EstateDataService.cs
index 8a8b46d..b6df5a2 100644
--- a/OpenSim/Services/Connectors/Simulation/EstateDataService.cs
+++ b/OpenSim/Services/Connectors/Simulation/EstateDataService.cs
@@ -43,9 +43,9 @@ namespace OpenSim.Services.Connectors
43{ 43{
44 public class EstateDataService : ServiceBase, IEstateDataService 44 public class EstateDataService : ServiceBase, IEstateDataService
45 { 45 {
46 private static readonly ILog m_log = 46// private static readonly ILog m_log =
47 LogManager.GetLogger( 47// LogManager.GetLogger(
48 MethodBase.GetCurrentMethod().DeclaringType); 48// MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 protected IEstateDataStore m_database; 50 protected IEstateDataStore m_database;
51 51
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs
index 0df9380..ccef50b 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs
@@ -43,9 +43,9 @@ namespace OpenSim.Services.Connectors
43{ 43{
44 public class SimulationDataService : ServiceBase, ISimulationDataService 44 public class SimulationDataService : ServiceBase, ISimulationDataService
45 { 45 {
46 private static readonly ILog m_log = 46// private static readonly ILog m_log =
47 LogManager.GetLogger( 47// LogManager.GetLogger(
48 MethodBase.GetCurrentMethod().DeclaringType); 48// MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 protected ISimulationDataStore m_database; 50 protected ISimulationDataStore m_database;
51 51
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index f34c2bd..143c296 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -237,7 +237,7 @@ namespace OpenSim.Services.Connectors.Simulation
237 237
238 try 238 try
239 { 239 {
240 OSDMap result = WebUtil.ServiceOSDRequest(uri,null,"DELETE",10000); 240 WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000);
241 } 241 }
242 catch (Exception e) 242 catch (Exception e)
243 { 243 {
@@ -257,7 +257,7 @@ namespace OpenSim.Services.Connectors.Simulation
257 257
258 try 258 try
259 { 259 {
260 OSDMap result = WebUtil.ServiceOSDRequest(uri,null,"DELETE",10000); 260 WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000);
261 } 261 }
262 catch (Exception e) 262 catch (Exception e)
263 { 263 {
@@ -303,7 +303,7 @@ namespace OpenSim.Services.Connectors.Simulation
303 args["destination_name"] = OSD.FromString(destination.RegionName); 303 args["destination_name"] = OSD.FromString(destination.RegionName);
304 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); 304 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
305 305
306 OSDMap result = WebUtil.PostToService(uri,args); 306 WebUtil.PostToService(uri, args);
307 } 307 }
308 catch (Exception e) 308 catch (Exception e)
309 { 309 {
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index bbddd87..b66bfed 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -303,7 +303,7 @@ namespace OpenSim.Services.HypergridService
303 return m_UserAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID); 303 return m_UserAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID);
304 else 304 else
305 { 305 {
306 Object[] args = new Object[] { userURL }; 306// Object[] args = new Object[] { userURL };
307 IUserAgentService userAgentService = new UserAgentServiceConnector(userURL); 307 IUserAgentService userAgentService = new UserAgentServiceConnector(userURL);
308 if (userAgentService != null) 308 if (userAgentService != null)
309 { 309 {
diff --git a/OpenSim/Services/HypergridService/UserAccountCache.cs b/OpenSim/Services/HypergridService/UserAccountCache.cs
index 3e9aea1..65f9dd5 100644
--- a/OpenSim/Services/HypergridService/UserAccountCache.cs
+++ b/OpenSim/Services/HypergridService/UserAccountCache.cs
@@ -13,9 +13,10 @@ namespace OpenSim.Services.HypergridService
13 { 13 {
14 private const double CACHE_EXPIRATION_SECONDS = 120000.0; // 33 hours! 14 private const double CACHE_EXPIRATION_SECONDS = 120000.0; // 33 hours!
15 15
16 private static readonly ILog m_log = 16// private static readonly ILog m_log =
17 LogManager.GetLogger( 17// LogManager.GetLogger(
18 MethodBase.GetCurrentMethod().DeclaringType); 18// MethodBase.GetCurrentMethod().DeclaringType);
19
19 private ExpiringCache<UUID, UserAccount> m_UUIDCache; 20 private ExpiringCache<UUID, UserAccount> m_UUIDCache;
20 21
21 private IUserAccountService m_UserAccountService; 22 private IUserAccountService m_UserAccountService;
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
index f985ab2..ebd6f7c 100644
--- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
@@ -661,7 +661,7 @@ namespace OpenSim.Services.LLLoginService
661 protected virtual ArrayList GetInventoryLibrary(ILibraryService library) 661 protected virtual ArrayList GetInventoryLibrary(ILibraryService library)
662 { 662 {
663 Dictionary<UUID, InventoryFolderImpl> rootFolders = library.GetAllFolders(); 663 Dictionary<UUID, InventoryFolderImpl> rootFolders = library.GetAllFolders();
664 m_log.DebugFormat("[LLOGIN]: Library has {0} folders", rootFolders.Count); 664// m_log.DebugFormat("[LLOGIN]: Library has {0} folders", rootFolders.Count);
665 //Dictionary<UUID, InventoryFolderImpl> rootFolders = new Dictionary<UUID,InventoryFolderImpl>(); 665 //Dictionary<UUID, InventoryFolderImpl> rootFolders = new Dictionary<UUID,InventoryFolderImpl>();
666 ArrayList folderHashes = new ArrayList(); 666 ArrayList folderHashes = new ArrayList();
667 667
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 281b6e3..d364aa4 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -282,7 +282,7 @@ namespace OpenSim.Services.LLLoginService
282 282
283 // Get active gestures 283 // Get active gestures
284 List<InventoryItemBase> gestures = m_InventoryService.GetActiveGestures(account.PrincipalID); 284 List<InventoryItemBase> gestures = m_InventoryService.GetActiveGestures(account.PrincipalID);
285 m_log.DebugFormat("[LLOGIN SERVICE]: {0} active gestures", gestures.Count); 285// m_log.DebugFormat("[LLOGIN SERVICE]: {0} active gestures", gestures.Count);
286 286
287 // 287 //
288 // Login the presence 288 // Login the presence
@@ -320,7 +320,8 @@ namespace OpenSim.Services.LLLoginService
320 Vector3 position = Vector3.Zero; 320 Vector3 position = Vector3.Zero;
321 Vector3 lookAt = Vector3.Zero; 321 Vector3 lookAt = Vector3.Zero;
322 GridRegion gatekeeper = null; 322 GridRegion gatekeeper = null;
323 GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt); 323 TeleportFlags flags;
324 GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt, out flags);
324 if (destination == null) 325 if (destination == null)
325 { 326 {
326 m_PresenceService.LogoutAgent(session); 327 m_PresenceService.LogoutAgent(session);
@@ -328,6 +329,8 @@ namespace OpenSim.Services.LLLoginService
328 return LLFailedLoginResponse.GridProblem; 329 return LLFailedLoginResponse.GridProblem;
329 } 330 }
330 331
332 if (account.UserLevel >= 200)
333 flags |= TeleportFlags.Godlike;
331 // 334 //
332 // Get the avatar 335 // Get the avatar
333 // 336 //
@@ -343,7 +346,7 @@ namespace OpenSim.Services.LLLoginService
343 string reason = string.Empty; 346 string reason = string.Empty;
344 GridRegion dest; 347 GridRegion dest;
345 AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, 348 AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where,
346 clientVersion, channel, mac, id0, clientIP, out where, out reason, out dest); 349 clientVersion, channel, mac, id0, clientIP, flags, out where, out reason, out dest);
347 destination = dest; 350 destination = dest;
348 if (aCircuit == null) 351 if (aCircuit == null)
349 { 352 {
@@ -378,8 +381,10 @@ namespace OpenSim.Services.LLLoginService
378 } 381 }
379 } 382 }
380 383
381 protected GridRegion FindDestination(UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation, GridRegion home, out GridRegion gatekeeper, out string where, out Vector3 position, out Vector3 lookAt) 384 protected GridRegion FindDestination(UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation, GridRegion home, out GridRegion gatekeeper, out string where, out Vector3 position, out Vector3 lookAt, out TeleportFlags flags)
382 { 385 {
386 flags = TeleportFlags.ViaLogin;
387
383 m_log.DebugFormat("[LLOGIN SERVICE]: FindDestination for start location {0}", startLocation); 388 m_log.DebugFormat("[LLOGIN SERVICE]: FindDestination for start location {0}", startLocation);
384 389
385 gatekeeper = null; 390 gatekeeper = null;
@@ -473,6 +478,8 @@ namespace OpenSim.Services.LLLoginService
473 } 478 }
474 else 479 else
475 { 480 {
481 flags |= TeleportFlags.ViaRegionID;
482
476 // free uri form 483 // free uri form
477 // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34 484 // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34
478 where = "url"; 485 where = "url";
@@ -624,7 +631,7 @@ namespace OpenSim.Services.LLLoginService
624 631
625 protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarAppearance avatar, 632 protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarAppearance avatar,
626 UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, string channel, string mac, string id0, 633 UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, string channel, string mac, string id0,
627 IPEndPoint clientIP, out string where, out string reason, out GridRegion dest) 634 IPEndPoint clientIP, TeleportFlags flags, out string where, out string reason, out GridRegion dest)
628 { 635 {
629 where = currentWhere; 636 where = currentWhere;
630 ISimulationService simConnector = null; 637 ISimulationService simConnector = null;
@@ -663,7 +670,7 @@ namespace OpenSim.Services.LLLoginService
663 { 670 {
664 circuitCode = (uint)Util.RandomClass.Next(); ; 671 circuitCode = (uint)Util.RandomClass.Next(); ;
665 aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0); 672 aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0);
666 success = LaunchAgentDirectly(simConnector, destination, aCircuit, out reason); 673 success = LaunchAgentDirectly(simConnector, destination, aCircuit, flags, out reason);
667 if (!success && m_GridService != null) 674 if (!success && m_GridService != null)
668 { 675 {
669 // Try the fallback regions 676 // Try the fallback regions
@@ -672,7 +679,7 @@ namespace OpenSim.Services.LLLoginService
672 { 679 {
673 foreach (GridRegion r in fallbacks) 680 foreach (GridRegion r in fallbacks)
674 { 681 {
675 success = LaunchAgentDirectly(simConnector, r, aCircuit, out reason); 682 success = LaunchAgentDirectly(simConnector, r, aCircuit, flags | TeleportFlags.ViaRegionID, out reason);
676 if (success) 683 if (success)
677 { 684 {
678 where = "safe"; 685 where = "safe";
@@ -795,9 +802,9 @@ namespace OpenSim.Services.LLLoginService
795 802
796 } 803 }
797 804
798 private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, out string reason) 805 private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason)
799 { 806 {
800 return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason); 807 return simConnector.CreateAgent(region, aCircuit, (uint)flags, out reason);
801 } 808 }
802 809
803 private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason) 810 private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason)
diff --git a/prebuild.xml b/prebuild.xml
index 854149b..cbe539e 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -1439,60 +1439,6 @@
1439 </Files> 1439 </Files>
1440 </Project> 1440 </Project>
1441 1441
1442 <Project frameworkVersion="v3_5" name="OpenSim.Region.OptionalModules" path="OpenSim/Region/OptionalModules" type="Library">
1443 <Configuration name="Debug">
1444 <Options>
1445 <OutputPath>../../../bin/</OutputPath>
1446 </Options>
1447 </Configuration>
1448 <Configuration name="Release">
1449 <Options>
1450 <OutputPath>../../../bin/</OutputPath>
1451 </Options>
1452 </Configuration>
1453
1454 <ReferencePath>../../../bin/</ReferencePath>
1455 <Reference name="System"/>
1456 <Reference name="System.Xml"/>
1457 <Reference name="System.Drawing"/>
1458 <Reference name="System.Web"/>
1459 <Reference name="OpenMetaverseTypes" path="../../../bin/"/>
1460 <Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
1461 <Reference name="OpenMetaverse" path="../../../bin/"/>
1462 <Reference name="PumaCode.SvnDotNet" path="../../../bin/"/>
1463 <Reference name="OpenSim.Framework"/>
1464 <Reference name="OpenSim.Framework.Communications"/>
1465 <Reference name="OpenSim.Data"/>
1466 <Reference name="OpenSim.Region.Framework"/>
1467 <Reference name="OpenSim.Region.CoreModules"/>
1468 <Reference name="OpenSim.Framework.Capabilities"/>
1469 <Reference name="OpenSim.Framework.Console"/>
1470 <Reference name="OpenSim.Framework.Servers"/>
1471 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
1472 <Reference name="OpenSim.Framework.Statistics"/>
1473 <Reference name="OpenSim.Region.Physics.Manager"/>
1474 <Reference name="OpenSim.Server.Base"/>
1475 <Reference name="OpenSim.Server.Handlers"/>
1476 <Reference name="OpenSim.Services.Connectors"/>
1477 <Reference name="OpenSim.Services.Base"/>
1478 <Reference name="OpenSim.Services.Interfaces"/>
1479 <Reference name="Mono.Addins" path="../../../bin/"/>
1480
1481 <!-- For scripting in funny languages by default -->
1482 <Reference name="XMLRPC" path="../../../bin/"/>
1483 <Reference name="OpenSim.Framework.Communications"/>
1484 <Reference name="Nini" path="../../../bin/"/>
1485 <Reference name="log4net" path="../../../bin/"/>
1486 <Reference name="DotNetOpenMail" path="../../../bin/"/>
1487
1488 <Files>
1489 <Match pattern="*.cs" recurse="true">
1490 <Exclude name="Tests" pattern="Tests"/>
1491 </Match>
1492 <Match buildAction="EmbeddedResource" path="Resources" pattern="*.addin.xml" recurse="true"/>
1493 </Files>
1494 </Project>
1495
1496 <Project frameworkVersion="v3_5" name="OpenSim.Region.RegionCombinerModule" path="OpenSim/Region/RegionCombinerModule" type="Library"> 1442 <Project frameworkVersion="v3_5" name="OpenSim.Region.RegionCombinerModule" path="OpenSim/Region/RegionCombinerModule" type="Library">
1497 <Configuration name="Debug"> 1443 <Configuration name="Debug">
1498 <Options> 1444 <Options>
@@ -1556,7 +1502,6 @@
1556 <Reference name="OpenSim.Framework.Communications"/> 1502 <Reference name="OpenSim.Framework.Communications"/>
1557 <Reference name="OpenSim.Framework.Statistics"/> 1503 <Reference name="OpenSim.Framework.Statistics"/>
1558 <Reference name="OpenSim.Region.Physics.Manager"/> 1504 <Reference name="OpenSim.Region.Physics.Manager"/>
1559 <Reference name="OpenSim.Region.CoreModules"/>
1560 <Reference name="XMLRPC" path="../../../bin/"/> 1505 <Reference name="XMLRPC" path="../../../bin/"/>
1561 <Reference name="Nini" path="../../../bin/"/> 1506 <Reference name="Nini" path="../../../bin/"/>
1562 <Reference name="log4net" path="../../../bin/"/> 1507 <Reference name="log4net" path="../../../bin/"/>
@@ -1607,6 +1552,61 @@
1607 </Files> 1552 </Files>
1608 </Project> 1553 </Project>
1609 1554
1555 <Project frameworkVersion="v3_5" name="OpenSim.Region.OptionalModules" path="OpenSim/Region/OptionalModules" type="Library">
1556 <Configuration name="Debug">
1557 <Options>
1558 <OutputPath>../../../bin/</OutputPath>
1559 </Options>
1560 </Configuration>
1561 <Configuration name="Release">
1562 <Options>
1563 <OutputPath>../../../bin/</OutputPath>
1564 </Options>
1565 </Configuration>
1566
1567 <ReferencePath>../../../bin/</ReferencePath>
1568 <Reference name="System"/>
1569 <Reference name="System.Xml"/>
1570 <Reference name="System.Drawing"/>
1571 <Reference name="System.Web"/>
1572 <Reference name="OpenMetaverseTypes" path="../../../bin/"/>
1573 <Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
1574 <Reference name="OpenMetaverse" path="../../../bin/"/>
1575 <Reference name="PumaCode.SvnDotNet" path="../../../bin/"/>
1576 <Reference name="OpenSim.Framework"/>
1577 <Reference name="OpenSim.Framework.Communications"/>
1578 <Reference name="OpenSim.Data"/>
1579 <Reference name="OpenSim.Framework.Capabilities"/>
1580 <Reference name="OpenSim.Framework.Console"/>
1581 <Reference name="OpenSim.Framework.Servers"/>
1582 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
1583 <Reference name="OpenSim.Framework.Statistics"/>
1584 <Reference name="OpenSim.Region.ClientStack.LindenUDP"/>
1585 <Reference name="OpenSim.Region.CoreModules"/>
1586 <Reference name="OpenSim.Region.Framework"/>
1587 <Reference name="OpenSim.Region.Physics.Manager"/>
1588 <Reference name="OpenSim.Server.Base"/>
1589 <Reference name="OpenSim.Server.Handlers"/>
1590 <Reference name="OpenSim.Services.Connectors"/>
1591 <Reference name="OpenSim.Services.Base"/>
1592 <Reference name="OpenSim.Services.Interfaces"/>
1593 <Reference name="Mono.Addins" path="../../../bin/"/>
1594
1595 <!-- For scripting in funny languages by default -->
1596 <Reference name="XMLRPC" path="../../../bin/"/>
1597 <Reference name="OpenSim.Framework.Communications"/>
1598 <Reference name="Nini" path="../../../bin/"/>
1599 <Reference name="log4net" path="../../../bin/"/>
1600 <Reference name="DotNetOpenMail" path="../../../bin/"/>
1601
1602 <Files>
1603 <Match pattern="*.cs" recurse="true">
1604 <Exclude name="Tests" pattern="Tests"/>
1605 </Match>
1606 <Match buildAction="EmbeddedResource" path="Resources" pattern="*.addin.xml" recurse="true"/>
1607 </Files>
1608 </Project>
1609
1610 <!-- Datastore Plugins --> 1610 <!-- Datastore Plugins -->
1611 <Project frameworkVersion="v3_5" name="OpenSim.Data.Null" path="OpenSim/Data/Null" type="Library"> 1611 <Project frameworkVersion="v3_5" name="OpenSim.Data.Null" path="OpenSim/Data/Null" type="Library">
1612 <Configuration name="Debug"> 1612 <Configuration name="Debug">
@@ -1991,7 +1991,6 @@
1991 </Files> 1991 </Files>
1992 </Project> 1992 </Project>
1993 1993
1994
1995 <Project frameworkVersion="v3_5" name="OpenSim.Client.VWoHTTP" path="OpenSim/Client/VWoHTTP" type="Library"> 1994 <Project frameworkVersion="v3_5" name="OpenSim.Client.VWoHTTP" path="OpenSim/Client/VWoHTTP" type="Library">
1996 <Configuration name="Debug"> 1995 <Configuration name="Debug">
1997 <Options> 1996 <Options>
@@ -2023,45 +2022,6 @@
2023 </Files> 2022 </Files>
2024 </Project> 2023 </Project>
2025 2024
2026 <Project frameworkVersion="v3_5" name="OpenSim.Client.Linden" path="OpenSim/Client/Linden" type="Library">
2027 <Configuration name="Debug">
2028 <Options>
2029 <OutputPath>../../../bin/</OutputPath>
2030 </Options>
2031 </Configuration>
2032 <Configuration name="Release">
2033 <Options>
2034 <OutputPath>../../../bin/</OutputPath>
2035 </Options>
2036 </Configuration>
2037
2038 <ReferencePath>../../../bin/</ReferencePath>
2039
2040 <Reference name="OpenMetaverseTypes" path="../../../bin/"/>
2041 <Reference name="OpenMetaverse" path="../../../bin/"/>
2042 <Reference name="System"/>
2043 <Reference name="OpenSim.Framework"/>
2044 <Reference name="OpenSim.Region.Framework"/>
2045 <Reference name="OpenSim.Framework.Communications"/>
2046 <Reference name="Nini" path="../../../bin/"/>
2047 <Reference name="log4net" path="../../../bin/"/>
2048 <Reference name="OpenSim.Framework.Capabilities"/>
2049 <Reference name="OpenSim.Framework.Servers"/>
2050 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
2051 <Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
2052 <Reference name="OpenSim.Region.ClientStack"/>
2053 <Reference name="OpenSim.Region.ClientStack.LindenUDP"/>
2054 <Reference name="OpenSim.Services.Interfaces"/>
2055 <Reference name="XMLRPC" path="../../../bin/"/>
2056 <Reference name="OpenSim.Region.Framework"/>
2057 <Files>
2058 <Match pattern="*.cs" recurse="true"/>
2059 <Match buildAction="EmbeddedResource" path="Resources" pattern="*.addin.xml" recurse="true"/>
2060 </Files>
2061 </Project>
2062
2063
2064
2065 <!-- Data Base Modules --> 2025 <!-- Data Base Modules -->
2066 <Project frameworkVersion="v3_5" name="OpenSim.Data.MySQL" path="OpenSim/Data/MySQL" type="Library"> 2026 <Project frameworkVersion="v3_5" name="OpenSim.Data.MySQL" path="OpenSim/Data/MySQL" type="Library">
2067 <Configuration name="Debug"> 2027 <Configuration name="Debug">