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

@@ -24,11 +24,14 @@
* (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.Collections;
using System.Collections.Generic;
using System.Net;
using System.Reflection;
using log4net;
using Mono.Addins;
using Nini.Config;
using Nwc.XmlRpc;
using OpenMetaverse;
@@ -39,7 +42,8 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
{
public class PresenceModule : IRegionModule, IPresenceModule
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class PresenceModule : ISharedRegionModule, IPresenceModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -59,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
public event PresenceChange OnPresenceChange;
public event BulkPresenceData OnBulkPresenceData;
public void Initialise(Scene scene, IConfigSource config)
public void Initialise(IConfigSource config)
{
lock (m_Scenes)
{
@@ -78,28 +82,38 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
m_Gridmode = cnf.GetBoolean("gridmode", false);
m_Enabled = true;
m_initialScene = scene;
}
}
}
public Type ReplaceableInterface
{
get { return null; }
}
public void AddRegion(Scene scene)
{
if (m_Enabled)
{
m_initialScene = scene;
if (m_Gridmode)
NotifyMessageServerOfStartup(scene);
m_Scenes.Add(scene);
scene.RegisterModuleInterface<IPresenceModule>(this);
scene.EventManager.OnNewClient += OnNewClient;
scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene;
scene.EventManager.OnMakeChildAgent += OnMakeChildAgent;
}
scene.RegisterModuleInterface<IPresenceModule>(this);
scene.EventManager.OnNewClient += OnNewClient;
scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene;
scene.EventManager.OnMakeChildAgent += OnMakeChildAgent;
}
public void PostInitialise()
public void RegionLoaded(Scene scene)
{
}
public void Close()
public void RemoveRegion(Scene scene)
{
if (!m_Gridmode || !m_Enabled)
return;
@@ -116,11 +130,23 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
}
}
lock (m_Scenes)
{
foreach (Scene scene in m_Scenes)
NotifyMessageServerOfShutdown(scene);
}
NotifyMessageServerOfShutdown(scene);
if(m_Scenes.Contains(scene))
m_Scenes.Remove(scene);
scene.UnregisterModuleInterface<IPresenceModule>(this);
scene.EventManager.OnNewClient -= OnNewClient;
scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene;
scene.EventManager.OnMakeChildAgent -= OnMakeChildAgent;
}
public void PostInitialise()
{
}
public void Close()
{
}
public string Name
@@ -128,11 +154,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
get { return "PresenceModule"; }
}
public bool IsSharedModule
{
get { return true; }
}
public void RequestBulkPresenceData(UUID[] users)
{
if (OnBulkPresenceData != null)