mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Merge branch 'master' into careminster
This commit is contained in:
@@ -25,9 +25,11 @@
|
||||
* 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;
|
||||
@@ -35,24 +37,23 @@ using OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView
|
||||
{
|
||||
public class IRCStackModule : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class IRCStackModule : INonSharedRegionModule
|
||||
{
|
||||
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 IRegionModule
|
||||
#region Implementation of ISharedRegionModule
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
if (null != source.Configs["IRCd"] &&
|
||||
source.Configs["IRCd"].GetBoolean("Enabled",false))
|
||||
{
|
||||
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;
|
||||
portNo = source.Configs["IRCd"].GetInt("Port",6666);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,9 +69,20 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView
|
||||
m_log.Info("[IRCd] Added user to Scene");
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
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()
|
||||
@@ -83,9 +95,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView
|
||||
get { return "IRCClientStackModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return false; }
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -38,6 +38,7 @@ using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using OpenMetaverse;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using Nwc.XmlRpc;
|
||||
using OpenSim.Framework;
|
||||
@@ -53,7 +54,8 @@ using System.Text.RegularExpressions;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
{
|
||||
public class FreeSwitchVoiceModule : IRegionModule, IVoiceModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class FreeSwitchVoiceModule : ISharedRegionModule, IVoiceModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -108,9 +110,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
|
||||
private IConfig m_config;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_config = config.Configs["FreeSwitchVoice"];
|
||||
|
||||
if (null == m_config)
|
||||
@@ -224,17 +225,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pluginEnabled)
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
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
|
||||
{
|
||||
@@ -254,21 +259,53 @@ 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()
|
||||
{
|
||||
}
|
||||
@@ -277,11 +314,6 @@ 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,6 +38,7 @@ using System.Threading;
|
||||
|
||||
using OpenMetaverse;
|
||||
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
|
||||
using OpenSim;
|
||||
@@ -50,7 +51,8 @@ using log4net;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
{
|
||||
public class ContentManagementModule : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class ContentManagementModule : ISharedRegionModule
|
||||
{
|
||||
#region Static Fields
|
||||
|
||||
@@ -60,22 +62,20 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
|
||||
#region Fields
|
||||
|
||||
bool initialised = false;
|
||||
CMController m_control = null;
|
||||
bool m_enabled = false;
|
||||
CMModel m_model = null;
|
||||
bool m_posted = false;
|
||||
CMView m_view = null;
|
||||
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;
|
||||
|
||||
#endregion Fields
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "ContentManagementModule"; }
|
||||
@@ -89,11 +89,8 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
{
|
||||
}
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
string databaseDir = "./";
|
||||
string database = "FileSystemDatabase";
|
||||
int channel = 345;
|
||||
try
|
||||
{
|
||||
if (source.Configs["CMS"] == null)
|
||||
@@ -115,13 +112,15 @@ 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
|
||||
@@ -142,6 +141,18 @@ 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,6 +38,7 @@ using System.Security.Policy;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
using Microsoft.CSharp;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -46,7 +47,8 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
{
|
||||
public class MRMModule : IRegionModule, IMRMModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class MRMModule : INonSharedRegionModule, IMRMModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private Scene m_scene;
|
||||
@@ -62,12 +64,14 @@ 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(Scene scene, IConfigSource source)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
if (source.Configs["MRM"] != null)
|
||||
{
|
||||
@@ -76,19 +80,10 @@ 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
|
||||
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);
|
||||
m_hidden = source.Configs["MRM"].GetBoolean("Hidden", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -101,6 +96,39 @@ 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))
|
||||
@@ -302,11 +330,6 @@ 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)
|
||||
@@ -320,11 +343,6 @@ 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;
|
||||
|
||||
m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
|
||||
m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded;
|
||||
scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
|
||||
scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded;
|
||||
|
||||
m_scene = null;
|
||||
scene = null;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
scene.UnregisterModuleInterface<IScriptModuleComms>(this);
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
|
||||
@@ -30,6 +30,7 @@ using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
|
||||
@@ -49,7 +50,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
|
||||
public string uri;
|
||||
}
|
||||
|
||||
public class XmlRpcGridRouter : IRegionModule, IXmlRpcRouter
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class XmlRpcGridRouter : INonSharedRegionModule, IXmlRpcRouter
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -59,7 +61,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
|
||||
private bool m_Enabled = false;
|
||||
private string m_ServerURI = String.Empty;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
IConfig startupConfig = config.Configs["Startup"];
|
||||
if (startupConfig == null)
|
||||
@@ -75,13 +77,26 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
|
||||
return;
|
||||
}
|
||||
|
||||
scene.RegisterModuleInterface<IXmlRpcRouter>(this);
|
||||
m_Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
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()
|
||||
@@ -93,11 +108,6 @@ 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,6 +29,7 @@ using System;
|
||||
using System.Reflection;
|
||||
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
|
||||
@@ -39,11 +40,12 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule
|
||||
{
|
||||
public class XmlRpcRouter : IRegionModule, IXmlRpcRouter
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class XmlRpcRouter : INonSharedRegionModule, IXmlRpcRouter
|
||||
{
|
||||
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
private bool m_enabled = false;
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
IConfig startupConfig = config.Configs["Startup"];
|
||||
if (startupConfig == null)
|
||||
@@ -52,12 +54,25 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule
|
||||
if (startupConfig.GetString("XmlRpcRouterModule",
|
||||
"XmlRpcRouterModule") == "XmlRpcRouterModule")
|
||||
{
|
||||
scene.RegisterModuleInterface<IXmlRpcRouter>(this);
|
||||
m_enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
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()
|
||||
@@ -69,11 +84,6 @@ 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 IRegionModule interface
|
||||
#region ISharedRegionModule interface
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@ 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;
|
||||
@@ -42,7 +43,8 @@ using Slash = System.IO.Path;
|
||||
|
||||
namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
{
|
||||
public class SvnBackupModule : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class SvnBackupModule : ISharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -200,9 +202,9 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
|
||||
#endregion
|
||||
|
||||
#region IRegionModule Members
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
m_scenes = new List<Scene>();
|
||||
m_timer = new Timer();
|
||||
@@ -225,7 +227,10 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
lock (m_scenes)
|
||||
{
|
||||
m_scenes.Add(scene);
|
||||
@@ -236,6 +241,18 @@ 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()
|
||||
{
|
||||
@@ -277,11 +294,6 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
||||
get { return "SvnBackupModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void EventManager_OnPluginConsole(string[] args)
|
||||
|
||||
@@ -25,9 +25,11 @@
|
||||
* 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;
|
||||
@@ -37,7 +39,8 @@ using Timer=System.Timers.Timer;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
{
|
||||
public class NPCModule : IRegionModule, INPCModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class NPCModule : ISharedRegionModule, INPCModule
|
||||
{
|
||||
// private const bool m_enabled = false;
|
||||
|
||||
@@ -134,15 +137,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
}
|
||||
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
public void Initialise(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)
|
||||
@@ -173,6 +174,19 @@ 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()
|
||||
{
|
||||
}
|
||||
@@ -186,9 +200,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
get { return "NPCModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
get { return null; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ 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;
|
||||
@@ -46,7 +47,8 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
/// <summary>
|
||||
/// Version 2.02 - Still hacky
|
||||
/// </summary>
|
||||
public class TreePopulatorModule : IRegionModule, ICommandableModule, IVegetationModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class TreePopulatorModule : INonSharedRegionModule, ICommandableModule, IVegetationModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private readonly Commander m_commander = new Commander("tree");
|
||||
@@ -168,15 +170,10 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
|
||||
#endregion
|
||||
|
||||
#region IRegionModule Members
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
|
||||
m_scene = scene;
|
||||
m_scene.RegisterModuleInterface<IRegionModule>(this);
|
||||
m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
|
||||
|
||||
// ini file settings
|
||||
try
|
||||
{
|
||||
@@ -196,12 +193,18 @@ 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 PostInitialise()
|
||||
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)
|
||||
{
|
||||
ReloadCopse();
|
||||
if (m_copse.Count > 0)
|
||||
@@ -211,6 +214,17 @@ 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()
|
||||
{
|
||||
}
|
||||
@@ -220,11 +234,6 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
get { return "TreePopulatorModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user