From 2486d96d062067f77151d516abe99f87b378ddad Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 4 Dec 2010 00:56:53 +0000 Subject: minor: correction to logging category --- OpenSim/Region/Application/OpenSimBase.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 36d5e51..eee2300 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -352,13 +352,13 @@ namespace OpenSim m_moduleLoader.InitialiseSharedModules(scene); // Use this in the future, the line above will be deprecated soon - m_log.Info("[REGIONMODULE]: Loading Region's modules (new style)"); + m_log.Info("[REGIONMODULES]: Loading Region's modules (new style)"); IRegionModulesController controller; if (ApplicationRegistry.TryGet(out controller)) { controller.AddRegionToModules(scene); } - else m_log.Error("[REGIONMODULE]: The new RegionModulesController is missing..."); + else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); scene.SetModuleInterfaces(); -- cgit v1.1 From 0ab774d484a58a73b2aa26b9f10d9df9aea1777a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 4 Dec 2010 01:06:29 +0000 Subject: add warning decals and information to RegionModule.cs in probably non-functional OpenSim.Region.Examples.SimpleModule project --- OpenSim/Region/Examples/SimpleModule/RegionModule.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs index 6da41db..9bcda74 100644 --- a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs +++ b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs @@ -34,6 +34,15 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.Examples.SimpleModule { + /// + /// Example region module. + /// + /// + /// This is an old and unmaintained region module which uses the old style module interface. It is not loaded into + /// OpenSim by default. If you want to try enabling it, look in the bin folder of this project. + /// Please see the README.txt in this project on the filesystem for some more information. + /// Nonetheless, it may contain some useful example code so has been left here for now. + /// public class RegionModule : IRegionModule { #region IRegionModule Members -- cgit v1.1 From a06032d96eec260f3cda48131e99c5dfb485aa28 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 4 Dec 2010 01:36:35 +0000 Subject: Add the most bare bones non-shared region module example. Not active unless the correct line is uncommented. --- .../BareBonesNonShared/BareBonesNonSharedModule.cs | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs diff --git a/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs b/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs new file mode 100644 index 0000000..a2a6b50 --- /dev/null +++ b/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs @@ -0,0 +1,83 @@ +/* + * 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.Reflection; +using log4net; +using Mono.Addins; +using Nini.Config; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Region.OptionalModules.Example.BareBonesNonShared +{ + /// + /// Simplest possible example of a non-shared region module. + /// + /// + /// This module is the simplest possible example of a non-shared region module (a module where each scene/region + /// in the simulator has its own copy). If anybody wants to create a more complex example in the future then + /// please create a separate example. + /// + /// This module is not active by default. If you want to see it in action, + /// then just uncomment the line below starting with [Extension(Path... + /// + //[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AttachmentsModule")] + public class BareBonesNonSharedModule : INonSharedRegionModule + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + public string Name { get { return "Bare Bones Non Shared Module"; } } + + public Type ReplaceableInterface { get { return null; } } + + public void Initialise(IConfigSource source) + { + m_log.DebugFormat("[BARE BONES]: INITIALIZED MODULE"); + } + + public void Close() + { + m_log.DebugFormat("[BARE BONES]: CLOSED MODULE"); + } + + public void AddRegion(Scene scene) + { + m_log.DebugFormat("[BARE BONES]: REGION {0} ADDED", scene.RegionInfo.RegionName); + } + + public void RemoveRegion(Scene scene) + { + m_log.DebugFormat("[BARE BONES]: REGION {0} REMOVED", scene.RegionInfo.RegionName); + } + + public void RegionLoaded(Scene scene) + { + m_log.DebugFormat("[BARE BONES]: REGION {0} LOADED", scene.RegionInfo.RegionName); + } + } +} \ No newline at end of file -- cgit v1.1 From c010491d340ed66fd5b6044f708669e3aac609b4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 4 Dec 2010 01:38:32 +0000 Subject: correct the id of the example module --- .../Example/BareBonesNonShared/BareBonesNonSharedModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs b/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs index a2a6b50..5ece77d 100644 --- a/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs +++ b/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs @@ -46,7 +46,7 @@ namespace OpenSim.Region.OptionalModules.Example.BareBonesNonShared /// This module is not active by default. If you want to see it in action, /// then just uncomment the line below starting with [Extension(Path... /// - //[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AttachmentsModule")] + //[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BareBonesNonSharedModule")] public class BareBonesNonSharedModule : INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); -- cgit v1.1 From 510b55c7f08e01b1d7ff14cbfdea367b9744dc23 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 4 Dec 2010 02:38:26 +0000 Subject: refactor some common code in RegionModulesControllerPlugin also some minor doc changes in BareBonesNonSharedModule --- .../RegionModulesControllerPlugin.cs | 100 ++++++++++----------- .../BareBonesNonShared/BareBonesNonSharedModule.cs | 15 ++-- 2 files changed, 54 insertions(+), 61 deletions(-) diff --git a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs index 9d79b3a..49bd911 100644 --- a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs +++ b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs @@ -62,7 +62,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController new List(); #region IApplicationPlugin implementation - + public void Initialise (OpenSimBase openSim) { m_openSim = openSim; @@ -91,66 +91,24 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController { if (node.Type.GetInterface(typeof(ISharedRegionModule).ToString()) != null) { - // Get the config string - string moduleString = - modulesConfig.GetString("Setup_" + node.Id, String.Empty); - - // We have a selector - if (moduleString != String.Empty) + if (CheckModuleEnabled(node, modulesConfig)) { - // Allow disabling modules even if they don't have - // support for it - if (moduleString == "disabled") - continue; - - // Split off port, if present - string[] moduleParts = moduleString.Split(new char[] { '/' }, 2); - // Format is [port/][class] - string className = moduleParts[0]; - if (moduleParts.Length > 1) - className = moduleParts[1]; - - // Match the class name if given - if (className != String.Empty && - node.Type.ToString() != className) - continue; + m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}, class {1}", node.Id, node.Type); + m_sharedModules.Add(node); } - - m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}, class {1}", node.Id, node.Type); - m_sharedModules.Add(node); } else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null) { - // Get the config string - string moduleString = - modulesConfig.GetString("Setup_" + node.Id, String.Empty); - - // We have a selector - if (moduleString != String.Empty) + if (CheckModuleEnabled(node, modulesConfig)) { - // Allow disabling modules even if they don't have - // support for it - if (moduleString == "disabled") - continue; - - // Split off port, if present - string[] moduleParts = moduleString.Split(new char[] { '/' }, 2); - // Format is [port/][class] - string className = moduleParts[0]; - if (moduleParts.Length > 1) - className = moduleParts[1]; - - // Match the class name if given - if (className != String.Empty && - node.Type.ToString() != className) - continue; + m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type); + m_nonSharedModules.Add(node); } - - m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type); - m_nonSharedModules.Add(node); } else + { m_log.DebugFormat("[REGIONMODULES]: Found unknown type of module {0}, class {1}", node.Id, node.Type); + } } // Load and init the module. We try a constructor with a port @@ -197,8 +155,6 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController m_sharedInstances.Add(module); module.Initialise(m_openSim.ConfigSource.Source); } - - } public void PostInitialise () @@ -210,7 +166,6 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController { module.PostInitialise(); } - } #endregion @@ -244,7 +199,6 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController #endregion - public string Version { get @@ -262,6 +216,42 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController } #region IRegionModulesController implementation + + /// + /// Check that the given module is no disabled in the [Modules] section of the config files. + /// + /// + /// The config section + /// true if the module is enabled, false if it is disabled + protected bool CheckModuleEnabled(TypeExtensionNode node, IConfig modulesConfig) + { + // Get the config string + string moduleString = + modulesConfig.GetString("Setup_" + node.Id, String.Empty); + + // We have a selector + if (moduleString != String.Empty) + { + // Allow disabling modules even if they don't have + // support for it + if (moduleString == "disabled") + return false; + + // Split off port, if present + string[] moduleParts = moduleString.Split(new char[] { '/' }, 2); + // Format is [port/][class] + string className = moduleParts[0]; + if (moduleParts.Length > 1) + className = moduleParts[1]; + + // Match the class name if given + if (className != String.Empty && + node.Type.ToString() != className) + return false; + } + + return true; + } // The root of all evil. // This is where we handle adding the modules to scenes when they diff --git a/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs b/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs index 5ece77d..7d37135 100644 --- a/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs +++ b/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs @@ -41,10 +41,13 @@ namespace OpenSim.Region.OptionalModules.Example.BareBonesNonShared /// /// This module is the simplest possible example of a non-shared region module (a module where each scene/region /// in the simulator has its own copy). If anybody wants to create a more complex example in the future then - /// please create a separate example. + /// please create a separate class. /// /// This module is not active by default. If you want to see it in action, /// then just uncomment the line below starting with [Extension(Path... + /// + /// When the module is enabled it will print messages when it receives certain events to the screen and the log + /// file. /// //[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BareBonesNonSharedModule")] public class BareBonesNonSharedModule : INonSharedRegionModule @@ -57,27 +60,27 @@ namespace OpenSim.Region.OptionalModules.Example.BareBonesNonShared public void Initialise(IConfigSource source) { - m_log.DebugFormat("[BARE BONES]: INITIALIZED MODULE"); + m_log.DebugFormat("[BARE BONES NON SHARED]: INITIALIZED MODULE"); } public void Close() { - m_log.DebugFormat("[BARE BONES]: CLOSED MODULE"); + m_log.DebugFormat("[BARE BONES NON SHARED]: CLOSED MODULE"); } public void AddRegion(Scene scene) { - m_log.DebugFormat("[BARE BONES]: REGION {0} ADDED", scene.RegionInfo.RegionName); + m_log.DebugFormat("[BARE BONES NON SHARED]: REGION {0} ADDED", scene.RegionInfo.RegionName); } public void RemoveRegion(Scene scene) { - m_log.DebugFormat("[BARE BONES]: REGION {0} REMOVED", scene.RegionInfo.RegionName); + m_log.DebugFormat("[BARE BONES NON SHARED]: REGION {0} REMOVED", scene.RegionInfo.RegionName); } public void RegionLoaded(Scene scene) { - m_log.DebugFormat("[BARE BONES]: REGION {0} LOADED", scene.RegionInfo.RegionName); + m_log.DebugFormat("[BARE BONES NON SHARED]: REGION {0} LOADED", scene.RegionInfo.RegionName); } } } \ No newline at end of file -- cgit v1.1 From 57b5263ecf9b78534d71e147a7dc152d19cbc4a4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 4 Dec 2010 02:46:59 +0000 Subject: add bare bones shared example module --- .../BareBonesShared/BareBonesSharedModule.cs | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs diff --git a/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs b/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs new file mode 100644 index 0000000..aa40c25 --- /dev/null +++ b/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs @@ -0,0 +1,91 @@ +/* + * 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.Reflection; +using log4net; +using Mono.Addins; +using Nini.Config; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Region.OptionalModules.Example.BareBonesShared +{ + /// + /// Simplest possible example of a shared region module. + /// + /// + /// This module is the simplest possible example of a shared region module (a module which is shared by every + /// scene/region running on the simulator). If anybody wants to create a more complex example in the future then + /// please create a separate class. + /// + /// This module is not active by default. If you want to see it in action, + /// then just uncomment the line below starting with [Extension(Path... + /// + /// When the module is enabled it will print messages when it receives certain events to the screen and the log + /// file. + /// + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BareBonesSharedModule")] + public class BareBonesSharedModule : ISharedRegionModule + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + public string Name { get { return "Bare Bones Shared Module"; } } + + public Type ReplaceableInterface { get { return null; } } + + public void Initialise(IConfigSource source) + { + m_log.DebugFormat("[BARE BONES SHARED]: INITIALIZED MODULE"); + } + + public void PostInitialise() + { + m_log.DebugFormat("[BARE BONES SHARED]: POST INITIALIZED MODULE"); + } + + public void Close() + { + m_log.DebugFormat("[BARE BONES SHARED]: CLOSED MODULE"); + } + + public void AddRegion(Scene scene) + { + m_log.DebugFormat("[BARE BONES SHARED]: REGION {0} ADDED", scene.RegionInfo.RegionName); + } + + public void RemoveRegion(Scene scene) + { + m_log.DebugFormat("[BARE BONES SHARED]: REGION {0} REMOVED", scene.RegionInfo.RegionName); + } + + public void RegionLoaded(Scene scene) + { + m_log.DebugFormat("[BARE BONES SHARED]: REGION {0} LOADED", scene.RegionInfo.RegionName); + } + } +} \ No newline at end of file -- cgit v1.1 From f268cd7c53591a320c7b02d56af1566e7571c2aa Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 4 Dec 2010 02:47:29 +0000 Subject: comment out the extension attribute --- .../OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs b/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs index aa40c25..781fe95 100644 --- a/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs +++ b/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs @@ -49,7 +49,7 @@ namespace OpenSim.Region.OptionalModules.Example.BareBonesShared /// When the module is enabled it will print messages when it receives certain events to the screen and the log /// file. /// - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BareBonesSharedModule")] + //[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BareBonesSharedModule")] public class BareBonesSharedModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); -- cgit v1.1 From 7b6b4501b7177d43e1ec11b29ba9ba6c55af9c64 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 4 Dec 2010 02:49:41 +0000 Subject: minor: add class doc line to older region module example code pointing towards newer --- OpenSim/Region/Examples/SimpleModule/RegionModule.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs index 9bcda74..088b818 100644 --- a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs +++ b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs @@ -42,6 +42,8 @@ namespace OpenSim.Region.Examples.SimpleModule /// OpenSim by default. If you want to try enabling it, look in the bin folder of this project. /// Please see the README.txt in this project on the filesystem for some more information. /// Nonetheless, it may contain some useful example code so has been left here for now. + /// + /// You can see bare bones examples of the more modern region module system in OpenSim/Region/OptionalModules/Example /// public class RegionModule : IRegionModule { -- cgit v1.1 From ea17b262a35df16ebdd79891520907b05d3b78a6 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 4 Dec 2010 04:33:14 +0100 Subject: Convert the agent asset transactions module to a new style module. Refactor to remove the property "MyScene" and the pointless circular refs to the managing classes. Converted the module to a non-shared module. Reformatted source for 80 columns. Removed the special role the module had in the old loader. --- .../LoadRegions/LoadRegionsPlugin.cs | 4 +- .../AssetTransaction/AgentAssetsTransactions.cs | 115 ++++++-------- .../AssetTransaction/AssetTransactionModule.cs | 166 +++++++++++---------- .../Agent/AssetTransaction/AssetXferUploader.cs | 43 +++--- 4 files changed, 158 insertions(+), 170 deletions(-) diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index b16f46c..7ef0f5f 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs @@ -106,8 +106,8 @@ namespace OpenSim.ApplicationPlugins.LoadRegions m_openSim.ModuleLoader.LoadDefaultSharedModule(new LoadImageURLModule()); m_log.Info("[LOADREGIONSPLUGIN]: XMLRPCModule..."); m_openSim.ModuleLoader.LoadDefaultSharedModule(new XMLRPCModule()); - m_log.Info("[LOADREGIONSPLUGIN]: AssetTransactionModule..."); - m_openSim.ModuleLoader.LoadDefaultSharedModule(new AssetTransactionModule()); +// m_log.Info("[LOADREGIONSPLUGIN]: AssetTransactionModule..."); +// m_openSim.ModuleLoader.LoadDefaultSharedModule(new AssetTransactionModule()); m_log.Info("[LOADREGIONSPLUGIN]: Done."); if (!CheckRegionsForSanity(regionsToLoad)) diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs index 3d6e7f3..0af113a 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs @@ -41,19 +41,22 @@ 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; - public AssetTransactionModule Manager; + private Scene m_Scene; public UUID UserID; - public Dictionary XferUploaders = new Dictionary(); + public Dictionary XferUploaders = + new Dictionary(); // Methods - public AgentAssetTransactions(UUID agentID, AssetTransactionModule manager, bool dumpAssetsToFile) + public AgentAssetTransactions(UUID agentID, Scene scene, + bool dumpAssetsToFile) { + m_Scene = scene; UserID = agentID; - Manager = manager; m_dumpAssetsToFile = dumpAssetsToFile; } @@ -61,7 +64,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction { if (!XferUploaders.ContainsKey(transactionID)) { - AssetXferUploader uploader = new AssetXferUploader(this, m_dumpAssetsToFile); + AssetXferUploader uploader = new AssetXferUploader(m_Scene, + m_dumpAssetsToFile); lock (XferUploaders) { @@ -88,22 +92,25 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction } } - public void RequestCreateInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID, - uint callbackID, string description, string name, sbyte invType, - sbyte type, byte wearableType, uint nextOwnerMask) + public void RequestCreateInventoryItem(IClientAPI remoteClient, + UUID transactionID, UUID folderID, uint callbackID, + string description, string name, sbyte invType, + sbyte type, byte wearableType, uint nextOwnerMask) { if (XferUploaders.ContainsKey(transactionID)) { - XferUploaders[transactionID].RequestCreateInventoryItem(remoteClient, transactionID, folderID, - callbackID, description, name, invType, type, - wearableType, nextOwnerMask); + XferUploaders[transactionID].RequestCreateInventoryItem( + remoteClient, transactionID, folderID, + callbackID, description, name, invType, type, + wearableType, nextOwnerMask); } } /// - /// Get an uploaded asset. If the data is successfully retrieved, the transaction will be removed. + /// Get an uploaded asset. If the data is successfully retrieved, + /// the transaction will be removed. /// /// /// The asset if the upload has completed, null if it has not. @@ -125,48 +132,21 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction return null; } - //private void CreateItemFromUpload(AssetBase asset, IClientAPI ourClient, UUID inventoryFolderID, uint nextPerms, uint wearableType) - //{ - // Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); - // CachedUserInfo userInfo = Manager.MyScene.CommsManager.UserProfileCacheService.GetUserDetails( - // ourClient.AgentId); - - // if (userInfo != null) - // { - // InventoryItemBase item = new InventoryItemBase(); - // item.Owner = ourClient.AgentId; - // item.Creator = ourClient.AgentId; - // item.ID = UUID.Random(); - // item.AssetID = asset.FullID; - // item.Description = asset.Description; - // item.Name = asset.Name; - // item.AssetType = asset.Type; - // item.InvType = asset.Type; - // item.Folder = inventoryFolderID; - // item.BasePermissions = 0x7fffffff; - // item.CurrentPermissions = 0x7fffffff; - // item.EveryOnePermissions = 0; - // item.NextPermissions = nextPerms; - // item.Flags = wearableType; - // item.CreationDate = Util.UnixTimeSinceEpoch(); - - // userInfo.AddItem(item); - // ourClient.SendInventoryItemCreateUpdate(item); - // } - // else - // { - // m_log.ErrorFormat( - // "[ASSET TRANSACTIONS]: Could not find user {0} for inventory item creation", - // ourClient.AgentId); - // } - //} - - public void RequestUpdateTaskInventoryItem( - IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item) + public void RequestUpdateTaskInventoryItem(IClientAPI remoteClient, + SceneObjectPart part, UUID transactionID, + TaskInventoryItem item) { if (XferUploaders.ContainsKey(transactionID)) { - AssetBase asset = XferUploaders[transactionID].GetAssetData(); + AssetBase asset = GetTransactionAsset(transactionID); + + // Only legacy viewers use this, and they prefer CAPS, which + // we have, so this really never runs. + // Allow it, but only for "safe" types. + if ((InventoryType)item.InvType != InventoryType.Notecard && + (InventoryType)item.InvType != InventoryType.LSL) + return; + if (asset != null) { m_log.DebugFormat( @@ -178,32 +158,23 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction asset.Type = (sbyte)item.Type; item.AssetID = asset.FullID; - Manager.MyScene.AssetService.Store(asset); + m_Scene.AssetService.Store(asset); - if (part.Inventory.UpdateInventoryItem(item)) - { - if ((InventoryType)item.InvType == InventoryType.Notecard) - remoteClient.SendAgentAlertMessage("Notecard saved", false); - else if ((InventoryType)item.InvType == InventoryType.LSL) - remoteClient.SendAgentAlertMessage("Script saved", false); - else - remoteClient.SendAgentAlertMessage("Item saved", false); - - part.GetProperties(remoteClient); - } + part.Inventory.UpdateInventoryItem(item); } } } - - public void RequestUpdateInventoryItem(IClientAPI remoteClient, UUID transactionID, - InventoryItemBase item) + public void RequestUpdateInventoryItem(IClientAPI remoteClient, + UUID transactionID, InventoryItemBase item) { - if (XferUploaders.ContainsKey(transactionID)) + if (XferUploaders.ContainsKey(transactionID)) { - UUID assetID = UUID.Combine(transactionID, remoteClient.SecureSessionId); + UUID assetID = UUID.Combine(transactionID, + remoteClient.SecureSessionId); - AssetBase asset = Manager.MyScene.AssetService.Get(assetID.ToString()); + AssetBase asset = m_Scene.AssetService.Get( + assetID.ToString()); if (asset == null) { @@ -219,10 +190,10 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction asset.Type = (sbyte)item.AssetType; item.AssetID = asset.FullID; - Manager.MyScene.AssetService.Store(asset); + m_Scene.AssetService.Store(asset); } - IInventoryService invService = Manager.MyScene.InventoryService; + IInventoryService invService = m_Scene.InventoryService; invService.UpdateItem(item); } } diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index ae31050..82558de 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs @@ -34,22 +34,19 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using Mono.Addins; namespace OpenSim.Region.CoreModules.Agent.AssetTransaction { - public class AssetTransactionModule : IRegionModule, IAgentAssetTransactions + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AssetTransactionModule")] + public class AssetTransactionModule : INonSharedRegionModule, + IAgentAssetTransactions { -// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger( +// MethodBase.GetCurrentMethod().DeclaringType); - private readonly Dictionary RegisteredScenes = new Dictionary(); + protected Scene m_Scene; private bool m_dumpAssetsToFile = false; - private Scene m_scene = null; - - [Obsolete] - public Scene MyScene - { - get{ return m_scene;} - } /// /// Each agent has its own singleton collection of transactions @@ -57,33 +54,24 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction private Dictionary AgentTransactions = new Dictionary(); + #region IRegionModule Members - public AssetTransactionModule() + public void Initialise(IConfigSource config) { - //m_log.Debug("creating AgentAssetTransactionModule"); } - #region IRegionModule Members - - public void Initialise(Scene scene, IConfigSource config) + public void AddRegion(Scene scene) { - if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) - { - // m_log.Debug("initialising AgentAssetTransactionModule"); - RegisteredScenes.Add(scene.RegionInfo.RegionID, scene); - scene.RegisterModuleInterface(this); - - scene.EventManager.OnNewClient += NewClient; - } + m_Scene = scene; + scene.RegisterModuleInterface(this); + scene.EventManager.OnNewClient += NewClient; + } - // EVIL HACK! - // This needs killing! - // - if (m_scene == null) - m_scene = scene; + public void RegionLoaded(Scene scene) + { } - public void PostInitialise() + public void RemoveRegion(Scene scene) { } @@ -96,9 +84,9 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction get { return "AgentTransactionModule"; } } - public bool IsSharedModule + public Type ReplaceableInterface { - get { return true; } + get { return typeof(IAgentAssetTransactions); } } #endregion @@ -111,8 +99,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction #region AgentAssetTransactions /// - /// Get the collection of asset transactions for the given user. If one does not already exist, it - /// is created. + /// Get the collection of asset transactions for the given user. + /// If one does not already exist, it is created. /// /// /// @@ -122,7 +110,10 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction { if (!AgentTransactions.ContainsKey(userID)) { - AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this, m_dumpAssetsToFile); + AgentAssetTransactions transactions = + new AgentAssetTransactions(userID, m_Scene, + m_dumpAssetsToFile); + AgentTransactions.Add(userID, transactions); } @@ -131,8 +122,9 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction } /// - /// Remove the given agent asset transactions. This should be called when a client is departing - /// from a scene (and hence won't be making any more transactions here). + /// Remove the given agent asset transactions. This should be called + /// when a client is departing from a scene (and hence won't be making + /// any more transactions here). /// /// public void RemoveAgentAssetTransactions(UUID userID) @@ -146,10 +138,10 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction } /// - /// Create an inventory item from data that has been received through a transaction. - /// - /// This is called when new clothing or body parts are created. It may also be called in other - /// situations. + /// Create an inventory item from data that has been received through + /// a transaction. + /// This is called when new clothing or body parts are created. + /// It may also be called in other situations. /// /// /// @@ -161,61 +153,72 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction /// /// /// - public void HandleItemCreationFromTransaction(IClientAPI remoteClient, UUID transactionID, UUID folderID, - uint callbackID, string description, string name, sbyte invType, - sbyte type, byte wearableType, uint nextOwnerMask) + public void HandleItemCreationFromTransaction(IClientAPI remoteClient, + UUID transactionID, UUID folderID, uint callbackID, + string description, string name, sbyte invType, + sbyte type, byte wearableType, uint nextOwnerMask) { - // m_log.DebugFormat( - // "[TRANSACTIONS MANAGER] Called HandleItemCreationFromTransaction with item {0}", name); +// m_log.DebugFormat( +// "[TRANSACTIONS MANAGER] Called HandleItemCreationFromTransaction with item {0}", name); - AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); + AgentAssetTransactions transactions = + GetUserTransactions(remoteClient.AgentId); - transactions.RequestCreateInventoryItem( - remoteClient, transactionID, folderID, callbackID, description, - name, invType, type, wearableType, nextOwnerMask); + transactions.RequestCreateInventoryItem(remoteClient, transactionID, + folderID, callbackID, description, name, invType, type, + wearableType, nextOwnerMask); } /// - /// Update an inventory item with data that has been received through a transaction. + /// Update an inventory item with data that has been received through a + /// transaction. /// - /// This is called when clothing or body parts are updated (for instance, with new textures or - /// colours). It may also be called in other situations. + /// This is called when clothing or body parts are updated (for + /// instance, with new textures or colours). It may also be called in + /// other situations. /// /// /// /// - public void HandleItemUpdateFromTransaction(IClientAPI remoteClient, UUID transactionID, - InventoryItemBase item) + public void HandleItemUpdateFromTransaction(IClientAPI remoteClient, + UUID transactionID, InventoryItemBase item) { - // m_log.DebugFormat( - // "[TRANSACTIONS MANAGER] Called HandleItemUpdateFromTransaction with item {0}", - // item.Name); +// m_log.DebugFormat( +// "[TRANSACTIONS MANAGER] Called HandleItemUpdateFromTransaction with item {0}", +// item.Name); - AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); + AgentAssetTransactions transactions = + GetUserTransactions(remoteClient.AgentId); - transactions.RequestUpdateInventoryItem(remoteClient, transactionID, item); + transactions.RequestUpdateInventoryItem(remoteClient, + transactionID, item); } /// - /// Update a task inventory item with data that has been received through a transaction. + /// Update a task inventory item with data that has been received + /// through a transaction. /// - /// This is currently called when, for instance, a notecard in a prim is saved. The data is sent - /// up through a single AssetUploadRequest. A subsequent UpdateTaskInventory then references the transaction + /// This is currently called when, for instance, a notecard in a prim + /// is saved. The data is sent up through a single AssetUploadRequest. + /// A subsequent UpdateTaskInventory then references the transaction /// and comes through this method. /// /// /// /// - public void HandleTaskItemUpdateFromTransaction( - IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item) + public void HandleTaskItemUpdateFromTransaction(IClientAPI remoteClient, + SceneObjectPart part, UUID transactionID, + TaskInventoryItem item) { - // m_log.DebugFormat( - // "[TRANSACTIONS MANAGER] Called HandleTaskItemUpdateFromTransaction with item {0}", - // item.Name); +// m_log.DebugFormat( +// "[TRANSACTIONS MANAGER] Called HandleTaskItemUpdateFromTransaction with item {0}", +// item.Name); - AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); + AgentAssetTransactions transactions = + GetUserTransactions(remoteClient.AgentId); - transactions.RequestUpdateTaskInventoryItem(remoteClient, part, transactionID, item); + transactions.RequestUpdateTaskInventoryItem(remoteClient, part, + transactionID, item); } /// @@ -227,8 +230,9 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction /// /// /// - public void HandleUDPUploadRequest(IClientAPI remoteClient, UUID assetID, UUID transaction, sbyte type, - byte[] data, bool storeLocal, bool tempFile) + public void HandleUDPUploadRequest(IClientAPI remoteClient, + UUID assetID, UUID transaction, sbyte type, byte[] data, + bool storeLocal, bool tempFile) { // m_log.Debug("HandleUDPUploadRequest - assetID: " + assetID.ToString() + " transaction: " + transaction.ToString() + " type: " + type.ToString() + " storelocal: " + storeLocal + " tempFile: " + tempFile); @@ -251,27 +255,33 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction } } - AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); + AgentAssetTransactions transactions = + GetUserTransactions(remoteClient.AgentId); + + AssetXferUploader uploader = + transactions.RequestXferUploader(transaction); - AssetXferUploader uploader = transactions.RequestXferUploader(transaction); if (uploader != null) { - uploader.Initialise(remoteClient, assetID, transaction, type, data, storeLocal, tempFile); + uploader.Initialise(remoteClient, assetID, transaction, type, + data, storeLocal, tempFile); } } /// - /// Handle asset transfer data packets received in response to the asset upload request in - /// HandleUDPUploadRequest() + /// Handle asset transfer data packets received in response to the + /// asset upload request in HandleUDPUploadRequest() /// /// /// /// /// - public void HandleXfer(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data) + public void HandleXfer(IClientAPI remoteClient, ulong xferID, + uint packetID, byte[] data) { //m_log.Debug("xferID: " + xferID + " packetID: " + packetID + " data!"); - AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); + AgentAssetTransactions transactions = + GetUserTransactions(remoteClient.AgentId); transactions.HandleXfer(xferID, packetID, data); } diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index 4609738..a7929ba 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs @@ -31,7 +31,7 @@ using System.Reflection; using log4net; using OpenMetaverse; using OpenSim.Framework; - +using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Agent.AssetTransaction @@ -50,17 +50,17 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction private bool m_finished = false; private string m_name = String.Empty; private bool m_storeLocal; - private AgentAssetTransactions m_userTransactions; private uint nextPerm = 0; private IClientAPI ourClient; private UUID TransactionID = UUID.Zero; private sbyte type = 0; private byte wearableType = 0; public ulong XferID; + private Scene m_Scene; - public AssetXferUploader(AgentAssetTransactions transactions, bool dumpAssetToFile) + public AssetXferUploader(Scene scene, bool dumpAssetToFile) { - m_userTransactions = transactions; + m_Scene = scene; m_dumpAssetToFile = dumpAssetToFile; } @@ -108,11 +108,13 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction /// /// /// True if the transfer is complete, false otherwise - public bool Initialise(IClientAPI remoteClient, UUID assetID, UUID transaction, sbyte type, byte[] data, - bool storeLocal, bool tempFile) + public bool Initialise(IClientAPI remoteClient, UUID assetID, + UUID transaction, sbyte type, byte[] data, bool storeLocal, + bool tempFile) { ourClient = remoteClient; - m_asset = new AssetBase(assetID, "blank", type, remoteClient.AgentId.ToString()); + m_asset = new AssetBase(assetID, "blank", type, + remoteClient.AgentId.ToString()); m_asset.Data = data; m_asset.Description = "empty"; m_asset.Local = storeLocal; @@ -137,12 +139,14 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction protected void RequestStartXfer() { XferID = Util.GetNextXferID(); - ourClient.SendXferRequest(XferID, m_asset.Type, m_asset.FullID, 0, new byte[0]); + ourClient.SendXferRequest(XferID, m_asset.Type, m_asset.FullID, + 0, new byte[0]); } protected void SendCompleteMessage() { - ourClient.SendAssetUploadCompleteMessage(m_asset.Type, true, m_asset.FullID); + ourClient.SendAssetUploadCompleteMessage(m_asset.Type, true, + m_asset.FullID); m_finished = true; if (m_createItem) @@ -151,18 +155,20 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction } else if (m_storeLocal) { - m_userTransactions.Manager.MyScene.AssetService.Store(m_asset); + m_Scene.AssetService.Store(m_asset); } m_log.DebugFormat( - "[ASSET TRANSACTIONS]: Uploaded asset {0} for transaction {1}", m_asset.FullID, TransactionID); + "[ASSET TRANSACTIONS]: Uploaded asset {0} for transaction {1}", + m_asset.FullID, TransactionID); if (m_dumpAssetToFile) { DateTime now = DateTime.Now; string filename = - String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day, - now.Hour, now.Minute, now.Second, m_asset.Name, m_asset.Type); + String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", + now.Year, now.Month, now.Day, now.Hour, now.Minute, + now.Second, m_asset.Name, m_asset.Type); SaveAssetToFile(filename, m_asset.Data); } } @@ -181,9 +187,10 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction fs.Close(); } - public void RequestCreateInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID, - uint callbackID, string description, string name, sbyte invType, - sbyte type, byte wearableType, uint nextOwnerMask) + public void RequestCreateInventoryItem(IClientAPI remoteClient, + UUID transactionID, UUID folderID, uint callbackID, + string description, string name, sbyte invType, + sbyte type, byte wearableType, uint nextOwnerMask) { if (TransactionID == transactionID) { @@ -212,7 +219,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction private void DoCreateItem(uint callbackID) { - m_userTransactions.Manager.MyScene.AssetService.Store(m_asset); + m_Scene.AssetService.Store(m_asset); InventoryItemBase item = new InventoryItemBase(); item.Owner = ourClient.AgentId; @@ -232,7 +239,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction item.Flags = (uint) wearableType; item.CreationDate = Util.UnixTimeSinceEpoch(); - if (m_userTransactions.Manager.MyScene.AddInventoryItem(item)) + if (m_Scene.AddInventoryItem(item)) ourClient.SendInventoryItemCreateUpdate(item, callbackID); else ourClient.SendAlertMessage("Unable to create inventory item"); -- cgit v1.1