Updates all IRegionModules to the new style region modules.

Signed-off-by: Melanie <melanie@t-data.com>
This commit is contained in:
Revolution
2010-01-22 18:09:33 -06:00
committed by Melanie
parent e61f42ad3a
commit ec3c31e61e
76 changed files with 1899 additions and 954 deletions

View File

@@ -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