From 5e35651efc98fd140a454c2dd6c5e826573f9dd6 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 17 Jan 2011 11:45:13 -0800 Subject: Protect World Map module, RequestMapItemsAsync, from badly formed URLs. --- OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') 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 lock (m_openRequests) m_openRequests.Add(requestID, mrs); - WebRequest mapitemsrequest = WebRequest.Create(httpserver); + WebRequest mapitemsrequest = null; + try + { + mapitemsrequest = WebRequest.Create(httpserver); + } + catch (Exception e) + { + m_log.DebugFormat("[WORLD MAP]: Access to {0} failed with {1}", httpserver, e); + return new OSDMap(); + } + mapitemsrequest.Method = "POST"; mapitemsrequest.ContentType = "application/xml+llsd"; OSDMap RAMap = new OSDMap(); -- cgit v1.1 From c544f0d0c5fcea625107c0eff25be8aa0586564a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 18 Jan 2011 00:25:24 +0000 Subject: Prune some of the excess logging for client logins. Didn't touch the appearance related stuff. --- OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs | 2 +- OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | 4 ++-- OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs index 36aaab3..8347e35 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs @@ -102,7 +102,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets { UUID capID = UUID.Random(); - m_log.Info("[GETMESH]: /CAPS/" + capID); +// m_log.Info("[GETMESH]: /CAPS/" + capID); caps.RegisterHandler("GetMesh", new RestHTTPHandler("GET", "/CAPS/" + capID, 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 { UUID capID = UUID.Random(); - m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); +// m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture)); } @@ -171,7 +171,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps /// False for "caller try another codec"; true otherwise private bool FetchTexture(OSHttpRequest httpRequest, OSHttpResponse httpResponse, UUID textureID, string format) { - m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format); +// m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format); AssetBase texture; string fullID = textureID.ToString(); diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs index c011776..008233b 100644 --- a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs +++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs @@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps { UUID capuuid = UUID.Random(); - m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/"); +// m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/"); caps.RegisterHandler("ObjectAdd", new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/", -- cgit v1.1 From 31144a62b34cf84cbc2c5508924294334fb76979 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 17 Jan 2011 21:22:32 +0100 Subject: Change gesture activation to not quash any other flags --- OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index 7303fe7..914990c 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 item = invService.GetItem(item); if (item != null) { - item.Flags = 1; + item.Flags |= 1; invService.UpdateItem(item); } else @@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures item = invService.GetItem(item); if (item != null) { - item.Flags = 0; + item.Flags &= ~1; invService.UpdateItem(item); } else @@ -93,4 +93,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name); } } -} \ No newline at end of file +} -- cgit v1.1 From 9f7b37b37cb746c603642df3c99e90f6ed0059ce Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 18 Jan 2011 01:48:28 +0000 Subject: Fix build break --- OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index 914990c..7df2beb 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs @@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures item = invService.GetItem(item); if (item != null) { - item.Flags &= ~1; + item.Flags &= ~(uint)1; invService.UpdateItem(item); } else -- cgit v1.1 From 97c0430093a7d66551b3502c5f4a81bae54d7250 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 19 Jan 2011 01:10:09 +0000 Subject: Downgrade and comment out some other caps messages for now --- .../CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs index 09b9719..e11e252 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 { UUID capID = UUID.Random(); - m_log.Info("[UploadObjectAssetModule]: /CAPS/" + capID); +// m_log.Debug("[UPLOAD OBJECT ASSET MODULE]: /CAPS/" + capID); caps.RegisterHandler("UploadObjectAsset", new RestHTTPHandler("POST", "/CAPS/OA/" + capID + "/", delegate(Hashtable m_dhttpMethod) @@ -156,7 +156,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps } catch (Exception ex) { - m_log.Error("[UploadObjectAssetModule]: Error deserializing message " + ex.ToString()); + m_log.Error("[UPLOAD OBJECT ASSET MODULE]: Error deserializing message " + ex.ToString()); message = null; } @@ -363,9 +363,8 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps responsedata["str_response_string"] = String.Format("local_id{0}", ConvertUintToBytes(allparts[0].LocalId)); return responsedata; - - } + private string ConvertUintToBytes(uint val) { byte[] resultbytes = Utils.UIntToBytes(val); @@ -374,4 +373,4 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps return String.Format("{0}", Convert.ToBase64String(resultbytes)); } } -} +} \ No newline at end of file -- cgit v1.1 From a42faca5b92f5c17c16b79fcf0df446d1aa08ae1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 19 Jan 2011 01:13:10 +0000 Subject: With mic's permission, adjust long call time info messages to 500ms from 200ms --- .../Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs index af26b2b..63fad88 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs @@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets { UUID capID = UUID.Random(); - m_log.Info("[GETMESH]: /CAPS/" + capID); +// m_log.Debug("[NEW FILE AGENT INVENTORY VARIABLE PRICE]: /CAPS/" + capID); caps.RegisterHandler("NewFileAgentInventoryVariablePrice", new LLSDStreamhandler("POST", -- cgit v1.1 From 28fda1cab60d3a403537a0606416a7c008fe6183 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 19 Jan 2011 01:41:32 +0000 Subject: with mic's permission, reduce appearance, baked texture logging verbosity for now --- .../Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 7d6d191..ed0a290 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory } } - m_log.InfoFormat("[AVFACTORY]: complete texture check for {0}",client.AgentId); + m_log.InfoFormat("[AVFACTORY]: complete texture check for {0}", client.AgentId); // If we only found default textures, then the appearance is not cached return (defonly ? false : true); @@ -187,7 +187,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory return; } - m_log.InfoFormat("[AVFACTORY]: start SetAppearance for {0}",client.AgentId); +// m_log.InfoFormat("[AVFACTORY]: start SetAppearance for {0}", client.AgentId); // TODO: This is probably not necessary any longer, just assume the // textureEntry set implies that the appearance transaction is complete @@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; - m_log.InfoFormat("[AVFACTORY]: received texture update for {0}",client.AgentId); + m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", client.AgentId); Util.FireAndForget(delegate(object o) { ValidateBakedTextureCache(client,false); }); // This appears to be set only in the final stage of the appearance -- cgit v1.1 From d3dca7d25a405ec9f1f5a3272ea50e4cbdce551c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 19 Jan 2011 01:50:02 +0000 Subject: For now, comment out logging messages about IM sending, since these cause high spam for large group messaging --- .../CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/CoreModules') 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 if (!user.IsChildAgent) { // Local message - m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID); +// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID); user.ControllingClient.SendInstantMessage(im); // Message sent @@ -168,7 +168,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage // Local message ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; - m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID); +// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID); user.ControllingClient.SendInstantMessage(im); // Message sent @@ -177,7 +177,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage } } - m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID); +// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID); SendGridInstantMessageViaXMLRPC(im, result); return; -- cgit v1.1 From 1baf63dbae8208172aa457963636116d42dbe9b3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 20 Jan 2011 22:57:12 +0000 Subject: Move "show queues" command out of OpenSim.cs and into a separate module. --- .../Agent/UDP/Linden/LindenUDPModule.cs | 200 +++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs b/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs new file mode 100644 index 0000000..3240434 --- /dev/null +++ b/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs @@ -0,0 +1,200 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; +using log4net; +using Mono.Addins; +using Nini.Config; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Console; +using OpenSim.Framework.Statistics; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Region.CoreModules.UDP.Linden +{ + /// + /// A module that just holds commands for inspecting/changing the Linden UDP client stack + /// + /// + /// All actual client stack functionality remains in OpenSim.Region.ClientStack.LindenUDP + /// + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LindenUDPModule")] + public class LindenUDPModule : ISharedRegionModule + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + protected Dictionary m_scenes = new Dictionary(); + + public string Name { get { return "Linden UDP Module"; } } + + public Type ReplaceableInterface { get { return null; } } + + public void Initialise(IConfigSource source) + { +// m_log.DebugFormat("[LINDEN UDP MODULE]: INITIALIZED MODULE"); + } + + public void PostInitialise() + { +// m_log.DebugFormat("[LINDEN UDP MODULE]: POST INITIALIZED MODULE"); + } + + public void Close() + { +// m_log.DebugFormat("[LINDEN UDP MODULE]: CLOSED MODULE"); + } + + public void AddRegion(Scene scene) + { +// m_log.DebugFormat("[LINDEN UDP MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); + + lock (m_scenes) + m_scenes[scene.RegionInfo.RegionID] = scene; + + scene.AddCommand( + this, "show queues", + "show queues [full]", + "Show queue data for each client", + "Without the 'full' option, only users actually on the region are shown." + + " With the 'full' option child agents of users in neighbouring regions are also shown.", + ShowQueuesReport); + } + + public void RemoveRegion(Scene scene) + { +// m_log.DebugFormat("[LINDEN UDP MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName); + + lock (m_scenes) + m_scenes.Remove(scene.RegionInfo.RegionID); + } + + public void RegionLoaded(Scene scene) + { +// m_log.DebugFormat("[LINDEN UDP MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); + } + + protected void ShowQueuesReport(string module, string[] cmd) + { + MainConsole.Instance.Output(GetQueuesReport(cmd)); + } + + /// + /// Generate UDP Queue data report for each client + /// + /// + /// + protected string GetQueuesReport(string[] showParams) + { + bool showChildren = false; + + if (showParams.Length > 2 && showParams[2] == "full") + showChildren = true; + + StringBuilder report = new StringBuilder(); + + int columnPadding = 2; + int maxNameLength = 18; + int maxRegionNameLength = 14; + int maxTypeLength = 4; + int totalInfoFieldsLength = maxNameLength + columnPadding + maxRegionNameLength + columnPadding + maxTypeLength + columnPadding; + + report.AppendFormat("{0,-" + maxNameLength + "}{1,-" + columnPadding + "}", "User", ""); + report.AppendFormat("{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}", "Region", ""); + report.AppendFormat("{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}", "Type", ""); + + report.AppendFormat( + "{0,7} {1,7} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}\n", + "Pkts", + "Pkts", + "Bytes", + "Pkts", + "Pkts", + "Pkts", + "Pkts", + "Pkts", + "Pkts", + "Pkts", + "Pkts"); + + report.AppendFormat("{0,-" + totalInfoFieldsLength + "}", ""); + report.AppendFormat( + "{0,7} {1,7} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}\n", + "Out", + "In", + "Unacked", + "Resend", + "Land", + "Wind", + "Cloud", + "Task", + "Texture", + "Asset", + "State"); + + lock (m_scenes) + { + foreach (Scene scene in m_scenes.Values) + { + scene.ForEachClient( + delegate(IClientAPI client) + { + if (client is IStatsCollector) + { + bool isChild = scene.PresenceChildStatus(client.AgentId); + if (isChild && !showChildren) + return; + + string name = client.Name; + string regionName = scene.RegionInfo.RegionName; + + report.AppendFormat( + "{0,-" + maxNameLength + "}{1,-" + columnPadding + "}", + name.Length > maxNameLength ? name.Substring(0, maxNameLength) : name, ""); + report.AppendFormat( + "{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}", + regionName.Length > maxRegionNameLength ? regionName.Substring(0, maxRegionNameLength) : regionName, ""); + report.AppendFormat( + "{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}", + isChild ? "Cd" : "Rt", ""); + + IStatsCollector stats = (IStatsCollector)client; + + report.AppendLine(stats.Report()); + } + }); + } + } + + return report.ToString(); + } + } +} \ No newline at end of file -- cgit v1.1 From df740d8e5c2ce5f43eac11917390b783b4d91230 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 20 Jan 2011 23:21:25 +0000 Subject: remove reference to CoreModules from ClientStack.LindenUDP client stack uses modules in the same way that scene does - through their interfaces --- OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs b/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs index 3240434..11e3f4a 100644 --- a/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs +++ b/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs @@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden "Show queue data for each client", "Without the 'full' option, only users actually on the region are shown." + " With the 'full' option child agents of users in neighbouring regions are also shown.", - ShowQueuesReport); + ShowQueuesReport); } public void RemoveRegion(Scene scene) @@ -195,6 +195,6 @@ namespace OpenSim.Region.CoreModules.UDP.Linden } return report.ToString(); - } + } } } \ No newline at end of file -- cgit v1.1 From 58eb6b5fa3f95c2bd649329de5b1c9789e9861be Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 20 Jan 2011 23:22:45 +0000 Subject: minor: help text adjustment for "show queues" --- OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs b/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs index 11e3f4a..29583dc 100644 --- a/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs +++ b/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs @@ -84,8 +84,8 @@ namespace OpenSim.Region.CoreModules.UDP.Linden this, "show queues", "show queues [full]", "Show queue data for each client", - "Without the 'full' option, only users actually on the region are shown." - + " With the 'full' option child agents of users in neighbouring regions are also shown.", + "Without the 'full' option, only root agents are shown." + + " With the 'full' option child agents are also shown.", ShowQueuesReport); } -- cgit v1.1 From c383dbd06dd98ca96543c9bfdf9a7376a7e55cc2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 21 Jan 2011 00:38:16 +0000 Subject: implement "show throttles" command for showing current agent throttles and the server settings. This is in a very crude state, currently. The LindenUDPModule was renamed LindenUDPInfoModule and moved to OptionalModules OptionalModules was given a direct reference to OpenSim.Region.ClientStack.LindenUDP so that it can inspect specific LindenUDP settings without having to generalize those to all client views (some of which may have no concept of the settings involved). This might be ess messy if OpenSim.Region.ClientStack.LindenUDP were a region module instead, like MXP, IRC and NPC --- .../Agent/UDP/Linden/LindenUDPModule.cs | 200 --------------------- 1 file changed, 200 deletions(-) delete mode 100644 OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs b/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs deleted file mode 100644 index 29583dc..0000000 --- a/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Text; -using log4net; -using Mono.Addins; -using Nini.Config; -using OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Framework.Console; -using OpenSim.Framework.Statistics; -using OpenSim.Region.Framework.Interfaces; -using OpenSim.Region.Framework.Scenes; - -namespace OpenSim.Region.CoreModules.UDP.Linden -{ - /// - /// A module that just holds commands for inspecting/changing the Linden UDP client stack - /// - /// - /// All actual client stack functionality remains in OpenSim.Region.ClientStack.LindenUDP - /// - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LindenUDPModule")] - public class LindenUDPModule : ISharedRegionModule - { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - protected Dictionary m_scenes = new Dictionary(); - - public string Name { get { return "Linden UDP Module"; } } - - public Type ReplaceableInterface { get { return null; } } - - public void Initialise(IConfigSource source) - { -// m_log.DebugFormat("[LINDEN UDP MODULE]: INITIALIZED MODULE"); - } - - public void PostInitialise() - { -// m_log.DebugFormat("[LINDEN UDP MODULE]: POST INITIALIZED MODULE"); - } - - public void Close() - { -// m_log.DebugFormat("[LINDEN UDP MODULE]: CLOSED MODULE"); - } - - public void AddRegion(Scene scene) - { -// m_log.DebugFormat("[LINDEN UDP MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); - - lock (m_scenes) - m_scenes[scene.RegionInfo.RegionID] = scene; - - scene.AddCommand( - this, "show queues", - "show queues [full]", - "Show queue data for each client", - "Without the 'full' option, only root agents are shown." - + " With the 'full' option child agents are also shown.", - ShowQueuesReport); - } - - public void RemoveRegion(Scene scene) - { -// m_log.DebugFormat("[LINDEN UDP MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName); - - lock (m_scenes) - m_scenes.Remove(scene.RegionInfo.RegionID); - } - - public void RegionLoaded(Scene scene) - { -// m_log.DebugFormat("[LINDEN UDP MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); - } - - protected void ShowQueuesReport(string module, string[] cmd) - { - MainConsole.Instance.Output(GetQueuesReport(cmd)); - } - - /// - /// Generate UDP Queue data report for each client - /// - /// - /// - protected string GetQueuesReport(string[] showParams) - { - bool showChildren = false; - - if (showParams.Length > 2 && showParams[2] == "full") - showChildren = true; - - StringBuilder report = new StringBuilder(); - - int columnPadding = 2; - int maxNameLength = 18; - int maxRegionNameLength = 14; - int maxTypeLength = 4; - int totalInfoFieldsLength = maxNameLength + columnPadding + maxRegionNameLength + columnPadding + maxTypeLength + columnPadding; - - report.AppendFormat("{0,-" + maxNameLength + "}{1,-" + columnPadding + "}", "User", ""); - report.AppendFormat("{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}", "Region", ""); - report.AppendFormat("{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}", "Type", ""); - - report.AppendFormat( - "{0,7} {1,7} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}\n", - "Pkts", - "Pkts", - "Bytes", - "Pkts", - "Pkts", - "Pkts", - "Pkts", - "Pkts", - "Pkts", - "Pkts", - "Pkts"); - - report.AppendFormat("{0,-" + totalInfoFieldsLength + "}", ""); - report.AppendFormat( - "{0,7} {1,7} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}\n", - "Out", - "In", - "Unacked", - "Resend", - "Land", - "Wind", - "Cloud", - "Task", - "Texture", - "Asset", - "State"); - - lock (m_scenes) - { - foreach (Scene scene in m_scenes.Values) - { - scene.ForEachClient( - delegate(IClientAPI client) - { - if (client is IStatsCollector) - { - bool isChild = scene.PresenceChildStatus(client.AgentId); - if (isChild && !showChildren) - return; - - string name = client.Name; - string regionName = scene.RegionInfo.RegionName; - - report.AppendFormat( - "{0,-" + maxNameLength + "}{1,-" + columnPadding + "}", - name.Length > maxNameLength ? name.Substring(0, maxNameLength) : name, ""); - report.AppendFormat( - "{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}", - regionName.Length > maxRegionNameLength ? regionName.Substring(0, maxRegionNameLength) : regionName, ""); - report.AppendFormat( - "{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}", - isChild ? "Cd" : "Rt", ""); - - IStatsCollector stats = (IStatsCollector)client; - - report.AppendLine(stats.Report()); - } - }); - } - } - - return report.ToString(); - } - } -} \ No newline at end of file -- cgit v1.1 From 41105948bdb21d8f53ad3aeeb8cfdddb8aa7367c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 21 Jan 2011 23:19:44 +0000 Subject: remove some mono compiler warnings --- .../CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs | 4 ++-- OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs | 5 +++-- .../Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs | 5 +++-- OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs | 5 +++-- .../Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs | 6 ++---- OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 6 ++++-- OpenSim/Region/CoreModules/World/Sound/SoundModule.cs | 2 +- OpenSim/Region/CoreModules/World/Warp3DMap/Perlin.cs | 4 +--- 8 files changed, 19 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/CoreModules') 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 /// public class AgentAssetTransactions { - private static readonly ILog m_log = LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger( +// MethodBase.GetCurrentMethod().DeclaringType); // Fields private bool m_dumpAssetsToFile; diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs index 8347e35..878242a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs @@ -49,8 +49,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class GetMeshModule : INonSharedRegionModule { - private static readonly ILog m_log = - LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = +// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private Scene m_scene; private IAssetService m_assetService; diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs index 63fad88..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 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class NewFileAgentInventoryVariablePriceModule : INonSharedRegionModule { - private static readonly ILog m_log = - LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = +// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private Scene m_scene; private IAssetService m_assetService; private bool m_dumpAssetsToFile = false; diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs index 008233b..a0d72ed 100644 --- a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs +++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs @@ -43,8 +43,9 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps { public class ObjectAdd : IRegionModule { - private static readonly ILog m_log = - LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = +// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private Scene m_scene; #region IRegionModule Members diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs index e11e252..3114d7f 100644 --- a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs @@ -174,7 +174,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps Vector3 pos = avatar.AbsolutePosition + (Vector3.UnitX * avatar.Rotation); Quaternion rot = Quaternion.Identity; Vector3 rootpos = Vector3.Zero; - Quaternion rootrot = Quaternion.Identity; +// Quaternion rootrot = Quaternion.Identity; SceneObjectGroup rootGroup = null; SceneObjectGroup[] allparts = new SceneObjectGroup[message.Objects.Length]; @@ -186,11 +186,9 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps if (i == 0) { rootpos = obj.Position; - rootrot = obj.Rotation; - +// rootrot = obj.Rotation; } - // Combine the extraparams data into it's ugly blob again.... //int bytelength = 0; //for (int extparams = 0; extparams < obj.ExtraParams.Length; extparams++) 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 LookupUUIDS icon = (LookupUUIDS)iar.AsyncState; icon.EndInvoke(iar); } + private void LookupUUID(List uuidLst) { LookupUUIDS d = LookupUUIDsAsync; @@ -775,6 +776,7 @@ namespace OpenSim.Region.CoreModules.World.Estate LookupUUIDSCompleted, d); } + private void LookupUUIDsAsync(List uuidLst) { UUID[] uuidarr; @@ -789,12 +791,12 @@ namespace OpenSim.Region.CoreModules.World.Estate // string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]); IUserManagement userManager = m_scene.RequestModuleInterface(); - string userName = "Unkown User"; if (userManager != null) - userName = userManager.GetUserName(uuidarr[i]); + userManager.GetUserName(uuidarr[i]); // we drop it. It gets cached though... so we're ready for the next request. // diva commnent 11/21/2010: uh?!? wft? + // justincc comment 21/01/2011: A side effect of userManager.GetUserName() I presume. } } #endregion 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 { public class SoundModule : IRegionModule, ISoundModule { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene; 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 public static float noise1(float arg) { int bx0, bx1; - float rx0, rx1, sx, t, u, v, a; - - a = arg; + float rx0, rx1, sx, t, u, v; t = arg + N; bx0 = ((int)t) & BM; -- cgit v1.1 From a32381cb9b913808100714249d6e1115f4cbe030 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 22 Jan 2011 00:27:34 +0000 Subject: stop extremely old region serialization commands from appearing in the console as far as I know these are unused and unsupported. Please re-enable if this is not the case. This does not effect save-xml[2]/load-xml[2] --- .../World/Serialiser/SerialiserModule.cs | 53 +++++++++++----------- 1 file changed, 26 insertions(+), 27 deletions(-) (limited to 'OpenSim/Region/CoreModules') 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 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private Commander m_commander = new Commander("export"); +// private Commander m_commander = new Commander("export"); private List m_regions = new List(); private string m_savedir = "exports"; private List m_serialisers = new List(); @@ -77,14 +77,13 @@ namespace OpenSim.Region.CoreModules.World.Serialiser m_serialisers.Add(new SerialiseObjects()); } - LoadCommanderCommands(); +// LoadCommanderCommands(); } - public void AddRegion(Scene scene) { - scene.RegisterModuleCommander(m_commander); - scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; +// scene.RegisterModuleCommander(m_commander); +// scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; scene.RegisterModuleInterface(this); lock (m_regions) @@ -211,18 +210,18 @@ namespace OpenSim.Region.CoreModules.World.Serialiser #endregion - private void EventManager_OnPluginConsole(string[] args) - { - if (args[0] == "export") - { - string[] tmpArgs = new string[args.Length - 2]; - int i = 0; - for (i = 2; i < args.Length; i++) - tmpArgs[i - 2] = args[i]; - - m_commander.ProcessConsoleCommand(args[1], tmpArgs); - } - } +// private void EventManager_OnPluginConsole(string[] args) +// { +// if (args[0] == "export") +// { +// string[] tmpArgs = new string[args.Length - 2]; +// int i = 0; +// for (i = 2; i < args.Length; i++) +// tmpArgs[i - 2] = args[i]; +// +// m_commander.ProcessConsoleCommand(args[1], tmpArgs); +// } +// } private void InterfaceSaveRegion(Object[] args) { @@ -245,15 +244,15 @@ namespace OpenSim.Region.CoreModules.World.Serialiser } } - private void LoadCommanderCommands() - { - Command serialiseSceneCommand = new Command("save", CommandIntentions.COMMAND_NON_HAZARDOUS, InterfaceSaveRegion, "Saves the named region into the exports directory."); - serialiseSceneCommand.AddArgument("region-name", "The name of the region you wish to export", "String"); - - Command serialiseAllScenesCommand = new Command("save-all",CommandIntentions.COMMAND_NON_HAZARDOUS, InterfaceSaveAllRegions, "Saves all regions into the exports directory."); - - m_commander.RegisterCommand("save", serialiseSceneCommand); - m_commander.RegisterCommand("save-all", serialiseAllScenesCommand); - } +// private void LoadCommanderCommands() +// { +// Command serialiseSceneCommand = new Command("save", CommandIntentions.COMMAND_NON_HAZARDOUS, InterfaceSaveRegion, "Saves the named region into the exports directory."); +// serialiseSceneCommand.AddArgument("region-name", "The name of the region you wish to export", "String"); +// +// Command serialiseAllScenesCommand = new Command("save-all",CommandIntentions.COMMAND_NON_HAZARDOUS, InterfaceSaveAllRegions, "Saves all regions into the exports directory."); +// +// m_commander.RegisterCommand("save", serialiseSceneCommand); +// m_commander.RegisterCommand("save-all", serialiseAllScenesCommand); +// } } } -- cgit v1.1 From cc39d0bf4e3fd10435215b4de63e1dcf768df2f6 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 23 Jan 2011 14:45:11 -0800 Subject: Fixes mantis #5343 --- OpenSim/Region/CoreModules/World/Land/LandObject.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 3e41c55..4e1f9c5 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -217,6 +217,7 @@ namespace OpenSim.Region.CoreModules.World.Land ParcelFlags.AllowDamage | ParcelFlags.CreateObjects | ParcelFlags.RestrictPushObject | + ParcelFlags.AllowOtherScripts | ParcelFlags.AllowGroupScripts | ParcelFlags.CreateGroupObjects | ParcelFlags.AllowAPrimitiveEntry | -- cgit v1.1 From c4727645b864a92fc489427c516ccab3a21c2d91 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Tue, 25 Jan 2011 14:23:58 -0800 Subject: Removed a few more spurious appearance saves. When an avatar enters a region the attachments module tries to update the appearance with attachments that are already part of the appearance. Just added a check to only save if the attachments weren't there before. --- .../Avatar/Attachments/AttachmentsModule.cs | 22 ++++++++++------------ .../Avatar/AvatarFactory/AvatarFactoryModule.cs | 4 +++- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/CoreModules') 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 "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId + ", AttachmentPoint: " + AttachmentPt); - if (m_scene.AvatarFactory != null) - m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); } } catch (Exception e) @@ -336,7 +334,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); item = m_scene.InventoryService.GetItem(item); - presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); + bool changed = presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID); + if (changed && m_scene.AvatarFactory != null) + m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); } return att.UUID; @@ -380,9 +380,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // XXYY!! InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); item = m_scene.InventoryService.GetItem(item); - presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); - - if (m_scene.AvatarFactory != null) + bool changed = presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID); + if (changed && m_scene.AvatarFactory != null) m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); } } @@ -402,11 +401,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments ScenePresence presence; if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) { - presence.Appearance.DetachAttachment(itemID); - // Save avatar attachment information m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID); - if (m_scene.AvatarFactory != null) + + bool changed = presence.Appearance.DetachAttachment(itemID); + if (changed && m_scene.AvatarFactory != null) m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); } @@ -431,9 +430,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments part.ParentGroup.PrimCount, remoteClient.AgentId, presence.AbsolutePosition)) return; - presence.Appearance.DetachAttachment(itemID); - - if (m_scene.AvatarFactory != null) + bool changed = presence.Appearance.DetachAttachment(itemID); + if (changed && m_scene.AvatarFactory != null) m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); part.ParentGroup.DetachToGround(); diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index ed0a290..f8ce444 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -217,7 +217,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // update transaction. In theory, we should be able to do an immediate // appearance send and save here. - QueueAppearanceSave(client.AgentId); + // save only if there were changes, send no matter what (doesn't hurt to send twice) + if (changed) + QueueAppearanceSave(client.AgentId); QueueAppearanceSend(client.AgentId); } -- cgit v1.1 From a0469daf759d09de040aa8b5287fab9a83555cc1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 26 Jan 2011 21:12:41 +0000 Subject: Implement command "land show". This shows all the parcels on the currently selected region/s This is useful for diagnostics. The command is "land show" rather than "show land" because it's implemented as a module specific subcommand. --- .../Region/CoreModules/World/Land/LandChannel.cs | 2 +- .../CoreModules/World/Land/LandManagementModule.cs | 97 ++++++++++++++++++---- .../Region/CoreModules/World/Land/LandObject.cs | 40 ++++++++- 3 files changed, 121 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/CoreModules') 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 #endregion private readonly Scene m_scene; - private readonly LandManagementModule m_landManagementModule; + private readonly LandManagementModule m_landManagementModule; public LandChannel(Scene scene, LandManagementModule landManagementMod) { 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; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; +using System.Text; using log4net; using Nini.Config; using OpenMetaverse; @@ -37,19 +38,22 @@ using OpenMetaverse.StructuredData; using OpenMetaverse.Messages.Linden; using OpenSim.Framework; using OpenSim.Framework.Capabilities; +using OpenSim.Framework.Console; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; -using OpenSim.Services.Interfaces; +using OpenSim.Region.CoreModules.Framework.InterfaceCommander; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Physics.Manager; -using Caps=OpenSim.Framework.Capabilities.Caps; +using OpenSim.Services.Interfaces; +using Caps = OpenSim.Framework.Capabilities.Caps; using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.World.Land { // used for caching - internal class ExtendedLandData { + internal class ExtendedLandData + { public LandData LandData; public ulong RegionHandle; public uint X, Y; @@ -65,6 +69,9 @@ namespace OpenSim.Region.CoreModules.World.Land private LandChannel landChannel; private Scene m_scene; + protected Commander m_commander = new Commander("land"); + + protected IUserManagement m_userManager; // Minimum for parcels to work is 64m even if we don't actually use them. #pragma warning disable 0429 @@ -127,19 +134,27 @@ namespace OpenSim.Region.CoreModules.World.Land m_scene.EventManager.OnRequestParcelPrimCountUpdate += EventManagerOnRequestParcelPrimCountUpdate; m_scene.EventManager.OnParcelPrimCountTainted += EventManagerOnParcelPrimCountTainted; m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; + m_scene.EventManager.OnPluginConsole += EventManagerOnPluginConsole; lock (m_scene) { m_scene.LandChannel = (ILandChannel)landChannel; } + + InstallInterfaces(); } public void RegionLoaded(Scene scene) { + m_userManager = m_scene.RequestModuleInterface(); } public void RemoveRegion(Scene scene) - { + { + // TODO: Also release other event manager listeners here + + m_scene.EventManager.OnPluginConsole -= EventManagerOnPluginConsole; + m_scene.UnregisterModuleCommander(m_commander.Name); } // private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason) @@ -148,6 +163,29 @@ namespace OpenSim.Region.CoreModules.World.Land // reason = "You are not allowed to enter this sim."; // return nearestParcel != null; // } + + /// + /// Processes commandline input. Do not call directly. + /// + /// Commandline arguments + protected void EventManagerOnPluginConsole(string[] args) + { + if (args[0] == "land") + { + if (args.Length == 1) + { + m_commander.ProcessConsoleCommand("help", new string[0]); + return; + } + + string[] tmpArgs = new string[args.Length - 2]; + int i; + for (i = 2; i < args.Length; i++) + tmpArgs[i - 2] = args[i]; + + m_commander.ProcessConsoleCommand(args[1], tmpArgs); + } + } void EventManagerOnNewClient(IClientAPI client) { @@ -209,11 +247,6 @@ namespace OpenSim.Region.CoreModules.World.Land } } - - public void PostInitialise() - { - } - public void Close() { } @@ -223,11 +256,6 @@ namespace OpenSim.Region.CoreModules.World.Land get { return "LandManagementModule"; } } - public bool IsSharedModule - { - get { return false; } - } - #endregion #region Parcel Add/Remove/Get/Create @@ -1591,5 +1619,44 @@ namespace OpenSim.Region.CoreModules.World.Land UpdateLandObject(localID, land.LandData); } + + protected void InstallInterfaces() + { + Command showCommand = + new Command("show", CommandIntentions.COMMAND_STATISTICAL, ShowParcelsCommand, "Shows all parcels on the current region."); + + m_commander.RegisterCommand("show", showCommand); + + // Add this to our scene so scripts can call these functions + m_scene.RegisterModuleCommander(m_commander); + } + + protected void ShowParcelsCommand(Object[] args) + { + StringBuilder report = new StringBuilder(); + + report.AppendFormat("Land information for {0}\n", m_scene.RegionInfo.RegionName); + report.AppendFormat( + "{0,-20} {1,-9} {2,-18} {3,-18} {4,-20}\n", + "Parcel Name", + "Area", + "Starts", + "Ends", + "Owner"); + + lock (m_landList) + { + foreach (ILandObject lo in m_landList.Values) + { + LandData ld = lo.LandData; + + report.AppendFormat( + "{0,-20} {1,-9} {2,-18} {3,-18} {4,-20}\n", + ld.Name, ld.Area, lo.StartPoint, lo.EndPoint, m_userManager.GetUserName(ld.OwnerID)); + } + } + + MainConsole.Instance.Output(report.ToString()); + } } -} +} \ 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 4e1f9c5..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 { get { return m_scene.RegionInfo.RegionID; } } - + + public Vector3 StartPoint + { + get + { + for (int y = 0; y < landArrayMax; y++) + { + for (int x = 0; x < landArrayMax; x++) + { + if (LandBitmap[x, y]) + return new Vector3(x * 4, y * 4, 0); + } + } + + return new Vector3(-1, -1, -1); + } + } + + public Vector3 EndPoint + { + get + { + for (int y = landArrayMax - 1; y >= 0; y--) + { + for (int x = landArrayMax - 1; x >= 0; x--) + { + if (LandBitmap[x, y]) + { + return new Vector3(x * 4, y * 4, 0); + } + } + } + + return new Vector3(-1, -1, -1); + } + } + #region Constructors public LandObject(UUID owner_id, bool is_group_owned, Scene scene) @@ -96,7 +132,7 @@ namespace OpenSim.Region.CoreModules.World.Land #region Member Functions #region General Functions - + /// /// Checks to see if this land object contains a point /// -- cgit v1.1