Converting WorldCommModule to INonSharedRegionModule
Signed-off-by: Diva Canto <diva@metaverseink.com>integration
parent
fe2fa70c74
commit
a87c4c7d89
|
@ -30,6 +30,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using Nini.Config;
|
||||
using Mono.Addins;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
|
@ -86,7 +87,8 @@ using OpenSim.Region.Framework.Scenes;
|
|||
|
||||
namespace OpenSim.Region.CoreModules.Scripting.WorldComm
|
||||
{
|
||||
public class WorldCommModule : IRegionModule, IWorldComm
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class WorldCommModule : IWorldComm, INonSharedRegionModule
|
||||
{
|
||||
// private static readonly ILog m_log =
|
||||
// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
@ -99,9 +101,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
|
|||
private int m_saydistance = 20;
|
||||
private int m_shoutdistance = 100;
|
||||
|
||||
#region IRegionModule Members
|
||||
#region INonSharedRegionModule Members
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
// wrap this in a try block so that defaults will work if
|
||||
// the config file doesn't specify otherwise.
|
||||
|
@ -120,12 +122,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
|
|||
}
|
||||
if (maxlisteners < 1) maxlisteners = int.MaxValue;
|
||||
if (maxhandles < 1) maxhandles = int.MaxValue;
|
||||
|
||||
m_scene = scene;
|
||||
m_scene.RegisterModuleInterface<IWorldComm>(this);
|
||||
m_listenerManager = new ListenerManager(maxlisteners, maxhandles);
|
||||
m_scene.EventManager.OnChatFromClient += DeliverClientMessage;
|
||||
m_scene.EventManager.OnChatBroadcast += DeliverClientMessage;
|
||||
m_pendingQ = new Queue();
|
||||
m_pending = Queue.Synchronized(m_pendingQ);
|
||||
}
|
||||
|
@ -134,6 +131,26 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
|
|||
{
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_scene.RegisterModuleInterface<IWorldComm>(this);
|
||||
m_scene.EventManager.OnChatFromClient += DeliverClientMessage;
|
||||
m_scene.EventManager.OnChatBroadcast += DeliverClientMessage;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene) { }
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (scene != m_scene)
|
||||
return;
|
||||
|
||||
m_scene.UnregisterModuleInterface<IWorldComm>(this);
|
||||
m_scene.EventManager.OnChatBroadcast -= DeliverClientMessage;
|
||||
m_scene.EventManager.OnChatBroadcast -= DeliverClientMessage;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
|
@ -143,10 +160,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
|
|||
get { return "WorldCommModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
public Type ReplaceableInterface { get { return null; } }
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
Loading…
Reference in New Issue