mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
Revert "Updates all IRegionModules to the new style region modules."
This reverts commit ec3c31e61e.
This commit is contained in:
@@ -25,11 +25,9 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
@@ -37,23 +35,24 @@ using OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class IRCStackModule : INonSharedRegionModule
|
||||
public class IRCStackModule : IRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private IRCServer m_server;
|
||||
// private Scene m_scene;
|
||||
private int portNo;
|
||||
|
||||
#region Implementation of ISharedRegionModule
|
||||
#region Implementation of IRegionModule
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
{
|
||||
if (null != source.Configs["IRCd"] &&
|
||||
source.Configs["IRCd"].GetBoolean("Enabled",false))
|
||||
{
|
||||
portNo = source.Configs["IRCd"].GetInt("Port",6666);
|
||||
int portNo = source.Configs["IRCd"].GetInt("Port",6666);
|
||||
// m_scene = scene;
|
||||
m_server = new IRCServer(IPAddress.Parse("0.0.0.0"), portNo, scene);
|
||||
m_server.OnNewIRCClient += m_server_OnNewIRCClient;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,20 +68,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView
|
||||
m_log.Info("[IRCd] Added user to Scene");
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
public void PostInitialise()
|
||||
{
|
||||
if (portNo != null)
|
||||
{
|
||||
m_server = new IRCServer(IPAddress.Parse("0.0.0.0"), portNo, scene);
|
||||
m_server.OnNewIRCClient += m_server_OnNewIRCClient;
|
||||
}
|
||||
}
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
@@ -95,9 +83,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView
|
||||
get { return "IRCClientStackModule"; }
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return null; }
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -38,7 +38,6 @@ using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using OpenMetaverse;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using Nwc.XmlRpc;
|
||||
using OpenSim.Framework;
|
||||
@@ -54,8 +53,7 @@ using System.Text.RegularExpressions;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class FreeSwitchVoiceModule : ISharedRegionModule, IVoiceModule
|
||||
public class FreeSwitchVoiceModule : IRegionModule, IVoiceModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -110,8 +108,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
|
||||
private IConfig m_config;
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_config = config.Configs["FreeSwitchVoice"];
|
||||
|
||||
if (null == m_config)
|
||||
@@ -225,21 +224,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
if (m_pluginEnabled)
|
||||
if (m_pluginEnabled)
|
||||
{
|
||||
// we need to capture scene in an anonymous method
|
||||
// here as we need it later in the callbacks
|
||||
scene.EventManager.OnRegisterCaps += delegate(UUID agentID, Caps caps)
|
||||
{
|
||||
OnRegisterCaps(scene, agentID, caps);
|
||||
};
|
||||
|
||||
|
||||
{
|
||||
OnRegisterCaps(scene, agentID, caps);
|
||||
};
|
||||
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
@@ -259,53 +254,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
m_log.Error("[FreeSwitchVoice]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
if (m_pluginEnabled)
|
||||
{
|
||||
m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene");
|
||||
|
||||
|
||||
// register the voice interface for this module, so the script engine can call us
|
||||
m_scene.RegisterModuleInterface<IVoiceModule>(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (UseProxy)
|
||||
{
|
||||
MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/", m_freeSwitchAPIPrefix));
|
||||
}
|
||||
else
|
||||
{
|
||||
MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix));
|
||||
|
||||
MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/viv_signin.php", m_freeSwitchAPIPrefix));
|
||||
|
||||
MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/freeswitch-config", m_freeSwitchAPIPrefix));
|
||||
|
||||
MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix));
|
||||
}
|
||||
scene.EventManager.OnRegisterCaps -= delegate(UUID agentID, Caps caps)
|
||||
{
|
||||
OnRegisterCaps(scene, agentID, caps);
|
||||
};
|
||||
scene.UnregisterModuleInterface<IVoiceModule>(this);
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
@@ -314,6 +277,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
{
|
||||
get { return "FreeSwitchVoiceModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
// <summary>
|
||||
// implementation of IVoiceModule, called by osSetParcelSIPAddress script function
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
@@ -38,7 +38,6 @@ using System.Threading;
|
||||
|
||||
using OpenMetaverse;
|
||||
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
|
||||
using OpenSim;
|
||||
@@ -51,8 +50,7 @@ using log4net;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class ContentManagementModule : ISharedRegionModule
|
||||
public class ContentManagementModule : IRegionModule
|
||||
{
|
||||
#region Static Fields
|
||||
|
||||
@@ -62,20 +60,22 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
|
||||
#region Fields
|
||||
|
||||
private bool initialised = false;
|
||||
private CMController m_control = null;
|
||||
private bool m_enabled = false;
|
||||
private CMModel m_model = null;
|
||||
private bool m_posted = false;
|
||||
private CMView m_view = null;
|
||||
private string databaseDir = "./";
|
||||
private string database = "FileSystemDatabase";
|
||||
private int channel = 345;
|
||||
bool initialised = false;
|
||||
CMController m_control = null;
|
||||
bool m_enabled = false;
|
||||
CMModel m_model = null;
|
||||
bool m_posted = false;
|
||||
CMView m_view = null;
|
||||
|
||||
#endregion Fields
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "ContentManagementModule"; }
|
||||
@@ -89,8 +89,11 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
{
|
||||
}
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
{
|
||||
string databaseDir = "./";
|
||||
string database = "FileSystemDatabase";
|
||||
int channel = 345;
|
||||
try
|
||||
{
|
||||
if (source.Configs["CMS"] == null)
|
||||
@@ -112,15 +115,13 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
m_log.ErrorFormat("[Content Management]: Exception thrown while reading parameters from configuration file. Message: " + e);
|
||||
m_enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (!m_enabled)
|
||||
{
|
||||
m_log.Info("[Content Management]: Content Management System is not Enabled.");
|
||||
return;
|
||||
}
|
||||
|
||||
lock (this)
|
||||
{
|
||||
if (!initialised) //only init once
|
||||
@@ -141,18 +142,6 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
}
|
||||
}
|
||||
}
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
|
||||
@@ -38,7 +38,6 @@ using System.Security.Policy;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
using Microsoft.CSharp;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -47,8 +46,7 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class MRMModule : INonSharedRegionModule, IMRMModule
|
||||
public class MRMModule : IRegionModule, IMRMModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private Scene m_scene;
|
||||
@@ -64,14 +62,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
|
||||
private IConfig m_config;
|
||||
|
||||
private bool m_hidden = true;
|
||||
|
||||
public void RegisterExtension<T>(T instance)
|
||||
{
|
||||
m_extensions[typeof (T)] = instance;
|
||||
}
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
{
|
||||
if (source.Configs["MRM"] != null)
|
||||
{
|
||||
@@ -80,10 +76,19 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
if (source.Configs["MRM"].GetBoolean("Enabled", false))
|
||||
{
|
||||
m_log.Info("[MRM] Enabling MRM Module");
|
||||
|
||||
m_scene = scene;
|
||||
|
||||
// when hidden, we don't listen for client initiated script events
|
||||
// only making the MRM engine available for region modules
|
||||
m_hidden = source.Configs["MRM"].GetBoolean("Hidden", false);
|
||||
if (!source.Configs["MRM"].GetBoolean("Hidden", false))
|
||||
{
|
||||
scene.EventManager.OnRezScript += EventManager_OnRezScript;
|
||||
scene.EventManager.OnStopScript += EventManager_OnStopScript;
|
||||
}
|
||||
|
||||
scene.EventManager.OnFrame += EventManager_OnFrame;
|
||||
|
||||
scene.RegisterModuleInterface<IMRMModule>(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -96,39 +101,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
}
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
if (!m_hidden)
|
||||
{
|
||||
scene.EventManager.OnRezScript += EventManager_OnRezScript;
|
||||
scene.EventManager.OnStopScript += EventManager_OnStopScript;
|
||||
}
|
||||
scene.EventManager.OnFrame += EventManager_OnFrame;
|
||||
|
||||
scene.RegisterModuleInterface<IMRMModule>(this);
|
||||
}
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (!m_hidden)
|
||||
{
|
||||
scene.EventManager.OnRezScript -= EventManager_OnRezScript;
|
||||
scene.EventManager.OnStopScript -= EventManager_OnStopScript;
|
||||
}
|
||||
scene.EventManager.OnFrame -= EventManager_OnFrame;
|
||||
|
||||
scene.UnregisterModuleInterface<IMRMModule>(this);
|
||||
}
|
||||
|
||||
void EventManager_OnStopScript(uint localID, UUID itemID)
|
||||
{
|
||||
if (m_scripts.ContainsKey(itemID))
|
||||
@@ -330,6 +302,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
mmb.InitMiniModule(world, host, itemID);
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
foreach (KeyValuePair<UUID, MRMBase> pair in m_scripts)
|
||||
@@ -343,6 +320,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
get { return "MiniRegionModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stolen from ScriptEngine Common
|
||||
/// </summary>
|
||||
|
||||
@@ -100,10 +100,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||
if (!m_enabled)
|
||||
return;
|
||||
|
||||
scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
|
||||
scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded;
|
||||
m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
|
||||
m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded;
|
||||
|
||||
scene = null;
|
||||
m_scene = null;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
|
||||
@@ -58,7 +58,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
scene.UnregisterModuleInterface<IScriptModuleComms>(this);
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
|
||||
@@ -30,7 +30,6 @@ using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
|
||||
@@ -50,8 +49,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
|
||||
public string uri;
|
||||
}
|
||||
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class XmlRpcGridRouter : INonSharedRegionModule, IXmlRpcRouter
|
||||
public class XmlRpcGridRouter : IRegionModule, IXmlRpcRouter
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -61,7 +59,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
|
||||
private bool m_Enabled = false;
|
||||
private string m_ServerURI = String.Empty;
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
{
|
||||
IConfig startupConfig = config.Configs["Startup"];
|
||||
if (startupConfig == null)
|
||||
@@ -77,26 +75,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
|
||||
return;
|
||||
}
|
||||
|
||||
scene.RegisterModuleInterface<IXmlRpcRouter>(this);
|
||||
m_Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
public void PostInitialise()
|
||||
{
|
||||
scene.RegisterModuleInterface<IXmlRpcRouter>(this);
|
||||
}
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
scene.UnregisterModuleInterface<IXmlRpcRouter>(this);
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void Close()
|
||||
@@ -108,6 +93,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
|
||||
get { return "XmlRpcGridRouterModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri)
|
||||
{
|
||||
if (!m_Channels.ContainsKey(itemID))
|
||||
|
||||
@@ -29,7 +29,6 @@ using System;
|
||||
using System.Reflection;
|
||||
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
|
||||
@@ -40,12 +39,11 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class XmlRpcRouter : INonSharedRegionModule, IXmlRpcRouter
|
||||
public class XmlRpcRouter : IRegionModule, IXmlRpcRouter
|
||||
{
|
||||
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private bool m_enabled = false;
|
||||
public void Initialise(IConfigSource config)
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
{
|
||||
IConfig startupConfig = config.Configs["Startup"];
|
||||
if (startupConfig == null)
|
||||
@@ -54,25 +52,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule
|
||||
if (startupConfig.GetString("XmlRpcRouterModule",
|
||||
"XmlRpcRouterModule") == "XmlRpcRouterModule")
|
||||
{
|
||||
m_enabled = true;
|
||||
scene.RegisterModuleInterface<IXmlRpcRouter>(this);
|
||||
}
|
||||
}
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
scene.RegisterModuleInterface<IXmlRpcRouter>(this);
|
||||
}
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
public void PostInitialise()
|
||||
{
|
||||
scene.UnregisterModuleInterface<IXmlRpcRouter>(this);
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void Close()
|
||||
@@ -84,6 +69,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule
|
||||
get { return "XmlRpcRouterModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri)
|
||||
{
|
||||
scriptEngine.PostScriptEvent(itemID, "xmlrpc_uri", new Object[] {uri});
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Freeswitch
|
||||
private IConfigSource m_Config;
|
||||
bool m_Registered = false;
|
||||
|
||||
#region ISharedRegionModule interface
|
||||
#region IRegionModule interface
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,6 @@ using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Timers;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.CoreModules.World.Serialiser;
|
||||
@@ -43,8 +42,7 @@ using Slash = System.IO.Path;
|
||||
|
||||
namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class SvnBackupModule : ISharedRegionModule
|
||||
public class SvnBackupModule : IRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -202,9 +200,9 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
|
||||
#endregion
|
||||
|
||||
#region ISharedRegionModule Members
|
||||
#region IRegionModule Members
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
{
|
||||
m_scenes = new List<Scene>();
|
||||
m_timer = new Timer();
|
||||
@@ -227,10 +225,7 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
lock (m_scenes)
|
||||
{
|
||||
m_scenes.Add(scene);
|
||||
@@ -241,18 +236,6 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
|
||||
}
|
||||
}
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
@@ -294,6 +277,11 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
get { return "SvnBackupModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void EventManager_OnPluginConsole(string[] args)
|
||||
|
||||
@@ -25,11 +25,9 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using OpenMetaverse;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
@@ -39,8 +37,7 @@ using Timer=System.Timers.Timer;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class NPCModule : ISharedRegionModule, INPCModule
|
||||
public class NPCModule : IRegionModule, INPCModule
|
||||
{
|
||||
// private const bool m_enabled = false;
|
||||
|
||||
@@ -137,13 +134,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
}
|
||||
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
{
|
||||
m_createMutex = new Mutex(false);
|
||||
|
||||
m_timer = new Timer(500);
|
||||
m_timer.Elapsed += m_timer_Elapsed;
|
||||
m_timer.Start();
|
||||
|
||||
scene.RegisterModuleInterface<INPCModule>(this);
|
||||
}
|
||||
|
||||
void m_timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||
@@ -174,19 +173,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
scene.RegisterModuleInterface<INPCModule>(this);
|
||||
}
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
scene.UnregisterModuleInterface<INPCModule>(this);
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
@@ -200,9 +186,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
get { return "NPCModule"; }
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
get { return true; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ using System.Reflection;
|
||||
using System.Timers;
|
||||
using OpenMetaverse;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.CoreModules.Framework.InterfaceCommander;
|
||||
@@ -47,8 +46,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
/// <summary>
|
||||
/// Version 2.02 - Still hacky
|
||||
/// </summary>
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class TreePopulatorModule : INonSharedRegionModule, ICommandableModule, IVegetationModule
|
||||
public class TreePopulatorModule : IRegionModule, ICommandableModule, IVegetationModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private readonly Commander m_commander = new Commander("tree");
|
||||
@@ -170,10 +168,15 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
|
||||
#endregion
|
||||
|
||||
#region ISharedRegionModule Members
|
||||
#region IRegionModule Members
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
{
|
||||
|
||||
m_scene = scene;
|
||||
m_scene.RegisterModuleInterface<IRegionModule>(this);
|
||||
m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
|
||||
|
||||
// ini file settings
|
||||
try
|
||||
{
|
||||
@@ -193,18 +196,12 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
m_log.Debug("[TREES]: ini failure for update_rate - using default");
|
||||
}
|
||||
|
||||
InstallCommands();
|
||||
|
||||
m_log.Debug("[TREES]: Initialised tree module");
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_scene.RegisterModuleInterface<INonSharedRegionModule>(this);
|
||||
m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
|
||||
InstallCommands();
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
public void PostInitialise()
|
||||
{
|
||||
ReloadCopse();
|
||||
if (m_copse.Count > 0)
|
||||
@@ -214,17 +211,6 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
activeizeTreeze(true);
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
scene.UnregisterModuleInterface<INonSharedRegionModule>(this);
|
||||
scene.EventManager.OnPluginConsole -= EventManager_OnPluginConsole;
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
@@ -234,6 +220,11 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
get { return "TreePopulatorModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user