From 8db5d79f4bc3590edfb8bee7918d3bbb1e286dcb Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Mon, 10 Sep 2012 12:18:40 +0100 Subject: passing in the function name to MOD_Api.ConvertFromLSL for more user-friendly error messages --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs index cde2d9f..6809c09 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs @@ -254,7 +254,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api object[] convertedParms = new object[parms.Length]; for (int i = 0; i < parms.Length; i++) - convertedParms[i] = ConvertFromLSL(parms[i],signature[i]); + convertedParms[i] = ConvertFromLSL(parms[i],signature[i], fname); // now call the function, the contract with the function is that it will always return // non-null but don't trust it completely @@ -294,7 +294,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// - protected object ConvertFromLSL(object lslparm, Type type) + protected object ConvertFromLSL(object lslparm, Type type, string fname) { // ---------- String ---------- if (lslparm is LSL_String) @@ -374,14 +374,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api (LSL_Vector)plist[i]); } else - MODError("unknown LSL list element type"); + MODError(String.Format("{0}: unknown LSL list element type", fname)); } return result; } } - MODError(String.Format("parameter type mismatch; expecting {0}",type.Name)); + MODError(String.Format("{1}: parameter type mismatch; expecting {0}",type.Name, fname)); return null; } -- cgit v1.1 From e3993eefa5f9e2d968bb3ff627b5102224b62c3d Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Tue, 11 Sep 2012 19:59:44 +0100 Subject: Documenting some of the events on OpenSim.Region.Framework.Scenes.EventManager (OnFrame) --- OpenSim/Region/Framework/Scenes/EventManager.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 4d65be9..6769fc9 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -47,6 +47,14 @@ namespace OpenSim.Region.Framework.Scenes public delegate void OnFrameDelegate(); + /// + /// Triggered on each sim frame. + /// + /// + /// This gets triggered in + /// Core uses it for things like Sun, Wind & Clouds + /// The MRM module also uses it. + /// public event OnFrameDelegate OnFrame; public delegate void ClientMovement(ScenePresence client); -- cgit v1.1 From 44349f742e309df65a4a100b004053b4262e9ade Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Tue, 11 Sep 2012 20:00:14 +0100 Subject: documentation (OnClientMovement) --- OpenSim/Region/Framework/Scenes/EventManager.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 6769fc9..c9be46d 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -59,6 +59,13 @@ namespace OpenSim.Region.Framework.Scenes public delegate void ClientMovement(ScenePresence client); + /// + /// Trigerred when an agent moves. + /// + /// + /// This gets triggered in + /// prior to + /// public event ClientMovement OnClientMovement; public delegate void OnTerrainTaintedDelegate(); -- cgit v1.1 From ed5f574356ed5fa290599fa7c852c06370c16747 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Tue, 11 Sep 2012 20:00:30 +0100 Subject: documentation (OnTerrainTainted) --- OpenSim/Region/Framework/Scenes/EventManager.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index c9be46d..b2960e7 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -70,6 +70,13 @@ namespace OpenSim.Region.Framework.Scenes public delegate void OnTerrainTaintedDelegate(); + /// + /// Triggered if the terrain has been edited + /// + /// + /// This gets triggered in + /// after it determines that an update has been made. + /// public event OnTerrainTaintedDelegate OnTerrainTainted; public delegate void OnTerrainTickDelegate(); -- cgit v1.1 From fd8a7e64b90aa02897ff145d527e96e98936d3ca Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Tue, 11 Sep 2012 20:01:00 +0100 Subject: documentation (OnTerrainTick) --- OpenSim/Region/Framework/Scenes/EventManager.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index b2960e7..6dc8865 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -81,6 +81,13 @@ namespace OpenSim.Region.Framework.Scenes public delegate void OnTerrainTickDelegate(); + /// + /// Triggered if the terrain has been edited + /// + /// + /// This gets triggered in + /// but is used by core solely to update the physics engine. + /// public event OnTerrainTickDelegate OnTerrainTick; public delegate void OnBackupDelegate(ISimulationDataService datastore, bool forceBackup); -- cgit v1.1 From 5e51f16cebb0df15d79f69eda52ebe0916c20c2d Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Tue, 11 Sep 2012 20:01:31 +0100 Subject: documentation (OnBackup) --- OpenSim/Region/Framework/Scenes/EventManager.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 6dc8865..8b5936f 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -92,6 +92,13 @@ namespace OpenSim.Region.Framework.Scenes public delegate void OnBackupDelegate(ISimulationDataService datastore, bool forceBackup); + /// + /// Triggered when a region is backed up/persisted to storage + /// + /// + /// This gets triggered in + /// and is fired before the persistence occurs. + /// public event OnBackupDelegate OnBackup; public delegate void OnClientConnectCoreDelegate(IClientCore client); -- cgit v1.1 From 0a22e78f591b905a92e9c5e2cf57d50d281e11f6 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Tue, 11 Sep 2012 20:02:00 +0100 Subject: documentation (OnClientConnect) --- OpenSim/Region/Framework/Scenes/EventManager.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 8b5936f..0daecaf 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -103,6 +103,15 @@ namespace OpenSim.Region.Framework.Scenes public delegate void OnClientConnectCoreDelegate(IClientCore client); + /// + /// Triggered when a new client connects to the scene. + /// + /// + /// This gets triggered in , + /// which checks if an instance of + /// also implements and as such, + /// is not triggered by NPCs. + /// public event OnClientConnectCoreDelegate OnClientConnect; public delegate void OnNewClientDelegate(IClientAPI client); -- cgit v1.1 From 0760121eb989734e86d216e7a02123895f016795 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Tue, 11 Sep 2012 20:02:19 +0100 Subject: documentation (OnNewPresence) --- OpenSim/Region/Framework/Scenes/EventManager.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 0daecaf..744c4a1 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -132,6 +132,13 @@ namespace OpenSim.Region.Framework.Scenes public delegate void OnNewPresenceDelegate(ScenePresence presence); + /// + /// Triggered when a new presence is added to the scene + /// + /// + /// Triggered in which is used by both + /// users and NPCs + /// public event OnNewPresenceDelegate OnNewPresence; public delegate void OnRemovePresenceDelegate(UUID agentId); -- cgit v1.1 From 97b8739c1d1aefb99526ae5baa0abb628e477061 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Tue, 11 Sep 2012 20:02:32 +0100 Subject: documentation (OnRemovePresence) --- OpenSim/Region/Framework/Scenes/EventManager.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 744c4a1..c66ef42 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -143,6 +143,13 @@ namespace OpenSim.Region.Framework.Scenes public delegate void OnRemovePresenceDelegate(UUID agentId); + /// + /// Triggered when a presence is removed from the scene + /// + /// + /// Triggered in which is used by both + /// users and NPCs + /// public event OnRemovePresenceDelegate OnRemovePresence; public delegate void OnParcelPrimCountUpdateDelegate(); -- cgit v1.1 From ad1b9bbba6bc4831ccb63d3d5fc1c7c10515fcc4 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Tue, 11 Sep 2012 20:02:48 +0100 Subject: documentation (OnSceneObjectPartCopy) --- OpenSim/Region/Framework/Scenes/EventManager.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index c66ef42..9bdaecf 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -540,6 +540,9 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// True if the duplicate will immediately be in the scene, false otherwise + /// + /// Triggered in + /// public event SceneObjectPartCopyDelegate OnSceneObjectPartCopy; public delegate void SceneObjectPartCopyDelegate(SceneObjectPart copy, SceneObjectPart original, bool userExposed); -- cgit v1.1 From 25111e703f54d84c7c51e32db1f94332ea3ffd00 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 11 Sep 2012 21:48:02 +0100 Subject: Add levels 4 and 5 to "debug http" console command that will log a sample of incoming request data and the entire incoming data respectively. See "help debug http" for more details. --- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 68 ++++++++++++++++++---- OpenSim/Framework/Servers/MainServer.cs | 2 + OpenSim/Framework/Util.cs | 32 ++++++++++ 3 files changed, 90 insertions(+), 12 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index f57ea76..c81e283 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -449,9 +449,7 @@ namespace OpenSim.Framework.Servers.HttpServer if (TryGetStreamHandler(handlerKey, out requestHandler)) { if (DebugLevel >= 3) - m_log.DebugFormat( - "[BASE HTTP SERVER]: Found stream handler for {0} {1} {2} {3}", - request.HttpMethod, request.Url.PathAndQuery, requestHandler.Name, requestHandler.Description); + LogIncomingToStreamHandler(request, requestHandler); response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type. @@ -563,9 +561,7 @@ namespace OpenSim.Framework.Servers.HttpServer if (DoWeHaveALLSDHandler(request.RawUrl)) { if (DebugLevel >= 3) - m_log.DebugFormat( - "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}", - request.ContentType, request.HttpMethod, request.Url.PathAndQuery); + LogIncomingToContentTypeHandler(request); buffer = HandleLLSDRequests(request, response); } @@ -573,18 +569,14 @@ namespace OpenSim.Framework.Servers.HttpServer else if (DoWeHaveAHTTPHandler(request.RawUrl)) { if (DebugLevel >= 3) - m_log.DebugFormat( - "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}", - request.ContentType, request.HttpMethod, request.Url.PathAndQuery); + LogIncomingToContentTypeHandler(request); buffer = HandleHTTPRequest(request, response); } else { if (DebugLevel >= 3) - m_log.DebugFormat( - "[BASE HTTP SERVER]: Assuming a generic XMLRPC request for {0} {1}", - request.HttpMethod, request.Url.PathAndQuery); + LogIncomingToXmlRpcHandler(request); // generic login request. buffer = HandleXmlRpcRequests(request, response); @@ -654,6 +646,58 @@ namespace OpenSim.Framework.Servers.HttpServer } } + private void LogIncomingToStreamHandler(OSHttpRequest request, IRequestHandler requestHandler) + { + m_log.DebugFormat( + "[BASE HTTP SERVER]: Found stream handler for {0} {1} {2} {3}", + request.HttpMethod, request.Url.PathAndQuery, requestHandler.Name, requestHandler.Description); + + if (DebugLevel >= 4) + LogIncomingInDetail(request); + } + + private void LogIncomingToContentTypeHandler(OSHttpRequest request) + { + m_log.DebugFormat( + "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}", + request.ContentType, request.HttpMethod, request.Url.PathAndQuery); + + if (DebugLevel >= 4) + LogIncomingInDetail(request); + } + + private void LogIncomingToXmlRpcHandler(OSHttpRequest request) + { + m_log.DebugFormat( + "[BASE HTTP SERVER]: Assuming a generic XMLRPC request for {0} {1}", + request.HttpMethod, request.Url.PathAndQuery); + + if (DebugLevel >= 4) + LogIncomingInDetail(request); + } + + private void LogIncomingInDetail(OSHttpRequest request) + { + using (StreamReader reader = new StreamReader(Util.Copy(request.InputStream), Encoding.UTF8)) + { + string output; + + if (DebugLevel == 4) + { + const int sampleLength = 80; + char[] sampleChars = new char[sampleLength]; + reader.Read(sampleChars, 0, sampleLength); + output = string.Format("[BASE HTTP SERVER]: {0}...", sampleChars); + } + else + { + output = string.Format("[BASE HTTP SERVER]: {0}", reader.ReadToEnd()); + } + + m_log.Debug(output); + } + } + private bool TryGetStreamHandler(string handlerKey, out IRequestHandler streamHandler) { string bestMatch = null; diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs index 8dc0e3a..1ac0953 100644 --- a/OpenSim/Framework/Servers/MainServer.cs +++ b/OpenSim/Framework/Servers/MainServer.cs @@ -111,6 +111,8 @@ namespace OpenSim.Framework.Servers + "If level >= 1, then short warnings are logged when receiving bad input data.\n" + "If level >= 2, then long warnings are logged when receiving bad input data.\n" + "If level >= 3, then short notices about all incoming non-poll HTTP requests are logged.\n" + + "If level >= 4, then a sample from the beginning of the incoming data is logged.\n" + + "If level >= 5, then the entire incoming data is logged.\n" + "If no level is specified then the current level is returned.", HandleDebugHttpCommand); } diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 38cb3a6..1b9777f 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1007,6 +1007,38 @@ namespace OpenSim.Framework } } + /// + /// Copy data from one stream to another, leaving the read position of both streams at the beginning. + /// + /// + /// Input stream. Must be seekable. + /// + /// + /// Thrown if the input stream is not seekable. + /// + public static Stream Copy(Stream inputStream) + { + if (!inputStream.CanSeek) + throw new ArgumentException("Util.Copy(Stream inputStream) must receive an inputStream that can seek"); + + const int readSize = 256; + byte[] buffer = new byte[readSize]; + MemoryStream ms = new MemoryStream(); + + int count = inputStream.Read(buffer, 0, readSize); + + while (count > 0) + { + ms.Write(buffer, 0, count); + count = inputStream.Read(buffer, 0, readSize); + } + + ms.Position = 0; + inputStream.Position = 0; + + return ms; + } + public static XmlRpcResponse XmlRpcCommand(string url, string methodName, params object[] args) { return SendXmlRpcCommand(url, methodName, args); -- cgit v1.1 From d53a53d4c599e77f039149128526ac67570b30fb Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 12 Sep 2012 00:10:48 +0100 Subject: Make "show http-handlers" command available for ROBUST instances as well as the simulator executable. --- OpenSim/Framework/Servers/MainServer.cs | 51 +++++++++++++++++++++++++++++++++ OpenSim/Region/Application/OpenSim.cs | 31 -------------------- 2 files changed, 51 insertions(+), 31 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs index 1ac0953..b367b12 100644 --- a/OpenSim/Framework/Servers/MainServer.cs +++ b/OpenSim/Framework/Servers/MainServer.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Reflection; using System.Net; +using System.Text; using log4net; using OpenSim.Framework; using OpenSim.Framework.Console; @@ -105,6 +106,11 @@ namespace OpenSim.Framework.Servers public static void RegisterHttpConsoleCommands(ICommandConsole console) { console.Commands.AddCommand( + "Comms", false, "show http-handlers", + "show http-handlers", + "Show all registered http handlers", HandleShowHttpHandlersCommand); + + console.Commands.AddCommand( "Debug", false, "debug http", "debug http []", "Turn on inbound non-poll http request debugging.", "If level <= 0, then no extra logging is done.\n" @@ -142,6 +148,51 @@ namespace OpenSim.Framework.Servers } } + private static void HandleShowHttpHandlersCommand(string module, string[] args) + { + if (args.Length != 2) + { + MainConsole.Instance.Output("Usage: show http-handlers"); + return; + } + + StringBuilder handlers = new StringBuilder(); + + lock (m_Servers) + { + foreach (BaseHttpServer httpServer in m_Servers.Values) + { + handlers.AppendFormat( + "Registered HTTP Handlers for server at {0}:{1}\n", httpServer.ListenIPAddress, httpServer.Port); + + handlers.AppendFormat("* XMLRPC:\n"); + foreach (String s in httpServer.GetXmlRpcHandlerKeys()) + handlers.AppendFormat("\t{0}\n", s); + + handlers.AppendFormat("* HTTP:\n"); + List poll = httpServer.GetPollServiceHandlerKeys(); + foreach (String s in httpServer.GetHTTPHandlerKeys()) + handlers.AppendFormat("\t{0} {1}\n", s, (poll.Contains(s) ? "(poll service)" : string.Empty)); + + handlers.AppendFormat("* Agent:\n"); + foreach (String s in httpServer.GetAgentHandlerKeys()) + handlers.AppendFormat("\t{0}\n", s); + + handlers.AppendFormat("* LLSD:\n"); + foreach (String s in httpServer.GetLLSDHandlerKeys()) + handlers.AppendFormat("\t{0}\n", s); + + handlers.AppendFormat("* StreamHandlers ({0}):\n", httpServer.GetStreamHandlerKeys().Count); + foreach (String s in httpServer.GetStreamHandlerKeys()) + handlers.AppendFormat("\t{0}\n", s); + + handlers.Append("\n"); + } + } + + MainConsole.Instance.Output(handlers.ToString()); + } + /// /// Register an already started HTTP server to the collection of known servers. /// diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 769eea8..ed339fd 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -332,10 +332,6 @@ namespace OpenSim "show circuits", "Show agent circuit data", HandleShow); - m_console.Commands.AddCommand("Comms", false, "show http-handlers", - "show http-handlers", - "Show all registered http handlers", HandleShow); - m_console.Commands.AddCommand("Comms", false, "show pending-objects", "show pending-objects", "Show # of objects on the pending queues of all scene viewers", HandleShow); @@ -1013,33 +1009,6 @@ namespace OpenSim HandleShowCircuits(); break; - case "http-handlers": - System.Text.StringBuilder handlers = new System.Text.StringBuilder("Registered HTTP Handlers:\n"); - - handlers.AppendFormat("* XMLRPC:\n"); - foreach (String s in HttpServer.GetXmlRpcHandlerKeys()) - handlers.AppendFormat("\t{0}\n", s); - - handlers.AppendFormat("* HTTP:\n"); - List poll = HttpServer.GetPollServiceHandlerKeys(); - foreach (String s in HttpServer.GetHTTPHandlerKeys()) - handlers.AppendFormat("\t{0} {1}\n", s, (poll.Contains(s) ? "(poll service)" : string.Empty)); - - handlers.AppendFormat("* Agent:\n"); - foreach (String s in HttpServer.GetAgentHandlerKeys()) - handlers.AppendFormat("\t{0}\n", s); - - handlers.AppendFormat("* LLSD:\n"); - foreach (String s in HttpServer.GetLLSDHandlerKeys()) - handlers.AppendFormat("\t{0}\n", s); - - handlers.AppendFormat("* StreamHandlers ({0}):\n", HttpServer.GetStreamHandlerKeys().Count); - foreach (String s in HttpServer.GetStreamHandlerKeys()) - handlers.AppendFormat("\t{0}\n", s); - - MainConsole.Instance.Output(handlers.ToString()); - break; - case "modules": MainConsole.Instance.Output("The currently loaded shared modules are:"); foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules) -- cgit v1.1 From f06394f19509516005aa7003a6e5e599ad8b7df0 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Tue, 11 Sep 2012 16:42:07 -0700 Subject: Allow an incoming identifier to be specified for a JsonStore. --- OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs | 2 +- .../OptionalModules/Scripting/JsonStore/JsonStoreModule.cs | 14 +++++++------- .../Scripting/JsonStore/JsonStoreScriptModule.cs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs index baac6e8..da39e95 100644 --- a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs @@ -35,7 +35,7 @@ namespace OpenSim.Region.Framework.Interfaces public interface IJsonStoreModule { - bool CreateStore(string value, out UUID result); + bool CreateStore(string value, ref UUID result); bool DestroyStore(UUID storeID); bool TestPath(UUID storeID, string path, bool useJson); bool SetValue(UUID storeID, string path, string value, bool useJson); diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs index 311531c..732c28f 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs @@ -175,14 +175,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore /// /// // ----------------------------------------------------------------- - public bool CreateStore(string value, out UUID result) + public bool CreateStore(string value, ref UUID result) { - result = UUID.Zero; + if (result == UUID.Zero) + result = UUID.Random(); + + JsonStore map = null; if (! m_enabled) return false; - UUID uuid = UUID.Random(); - JsonStore map = null; try { @@ -195,9 +196,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore } lock (m_JsonValueStore) - m_JsonValueStore.Add(uuid,map); + m_JsonValueStore.Add(result,map); - result = uuid; return true; } @@ -231,7 +231,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore if (! m_JsonValueStore.TryGetValue(storeID,out map)) { m_log.InfoFormat("[JsonStore] Missing store {0}",storeID); - return true; + return false; } } diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs index eaba816..6910d14 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs @@ -227,7 +227,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore protected UUID JsonCreateStore(UUID hostID, UUID scriptID, string value) { UUID uuid = UUID.Zero; - if (! m_store.CreateStore(value, out uuid)) + if (! m_store.CreateStore(value, ref uuid)) GenerateRuntimeError("Failed to create Json store"); return uuid; -- cgit v1.1 From 41f3f2400e40345b66fd7cad76675d25f9e7beb1 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Tue, 11 Sep 2012 23:34:24 +0100 Subject: Documentation of economy-related EventManager events --- OpenSim/Region/Framework/Scenes/EventManager.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 9bdaecf..02c032e 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -651,8 +651,29 @@ namespace OpenSim.Region.Framework.Scenes public delegate void LandBuy(Object sender, LandBuyArgs e); + /// + /// Triggered when an attempt to transfer grid currency occurs + /// + /// + /// Triggered in + /// via + /// via + /// via + /// public event MoneyTransferEvent OnMoneyTransfer; + + /// + /// Triggered after after + /// public event LandBuy OnLandBuy; + + /// + /// Triggered to allow or prevent a real estate transaction + /// + /// + /// Triggered in + /// + /// public event LandBuy OnValidateLandBuy; public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID) -- cgit v1.1 From c17965eec41e0c37f43cc3d4a7c12e52280db59d Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sat, 8 Sep 2012 12:53:30 +0100 Subject: mathematically & hypothetically speaking we want to avoid negative values being written --- OpenSim/Framework/RegionInfo.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index ded2df2..928e798 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -701,27 +701,27 @@ namespace OpenSim.Framework config.Set("ExternalHostName", m_externalHostName); - if (m_nonphysPrimMin != 0) + if (m_nonphysPrimMin > 0) config.Set("NonphysicalPrimMax", m_nonphysPrimMin); - if (m_nonphysPrimMax != 0) + if (m_nonphysPrimMax > 0) config.Set("NonphysicalPrimMax", m_nonphysPrimMax); - if (m_physPrimMin != 0) + if (m_physPrimMin > 0) config.Set("PhysicalPrimMax", m_physPrimMin); - if (m_physPrimMax != 0) + if (m_physPrimMax > 0) config.Set("PhysicalPrimMax", m_physPrimMax); config.Set("ClampPrimSize", m_clampPrimSize.ToString()); - if (m_objectCapacity != 0) + if (m_objectCapacity > 0) config.Set("MaxPrims", m_objectCapacity); - if (m_linksetCapacity != 0) + if (m_linksetCapacity > 0) config.Set("LinksetPrims", m_linksetCapacity); - if (m_agentCapacity != 0) + if (m_agentCapacity > 0) config.Set("MaxAgents", m_agentCapacity); if (ScopeID != UUID.Zero) -- cgit v1.1 From ebb394bbdac0d7d26d4e51d5e7fbc05010ada870 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 12 Sep 2012 01:45:34 +0100 Subject: Fix indentation and issues where tabs were used instead of spaces in commit 783ee949 --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index e528288..ac26be7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2022,13 +2022,14 @@ namespace OpenSim.Region.Framework.Scenes m_scene.m_linksetCapacity) { m_log.DebugFormat( - "[SCENE OBJECT GROUP]: Cannot link group with root" + - " part {0}, {1} ({2} prims) to group with root part" + - " {3}, {4} ({5} prims) because the new linkset" + - " would exceed the configured maximum of {6}", - objectGroup.RootPart.Name, objectGroup.RootPart.UUID, - objectGroup.PrimCount, RootPart.Name, RootPart.UUID, - PrimCount, m_scene.m_linksetCapacity); + "[SCENE OBJECT GROUP]: Cannot link group with root" + + " part {0}, {1} ({2} prims) to group with root part" + + " {3}, {4} ({5} prims) because the new linkset" + + " would exceed the configured maximum of {6}", + objectGroup.RootPart.Name, objectGroup.RootPart.UUID, + objectGroup.PrimCount, RootPart.Name, RootPart.UUID, + PrimCount, m_scene.m_linksetCapacity); + return; } -- cgit v1.1 From 224efe7b763640fd62ed177968efe61f175e5b8f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 12 Sep 2012 01:57:48 +0100 Subject: minor: Comment out friends notification log spam for now. --- OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 24ec435..11db18a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -482,9 +482,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends Util.FireAndForget( delegate { - m_log.DebugFormat( - "[FRIENDS MODULE]: Notifying {0} friends of {1} of online status {2}", - friendList.Count, agentID, online); +// m_log.DebugFormat( +// "[FRIENDS MODULE]: Notifying {0} friends of {1} of online status {2}", +// friendList.Count, agentID, online); // Notify about this user status StatusNotify(friendList, agentID, online); -- cgit v1.1