One more module converted: ObjectAdd.

integration
Diva Canto 2012-11-10 10:35:27 -08:00
parent 26a94610fc
commit 3a5e317f65
1 changed files with 66 additions and 51 deletions

View File

@ -32,6 +32,7 @@ using log4net;
using Nini.Config; using Nini.Config;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using Mono.Addins;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers; using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer; using OpenSim.Framework.Servers.HttpServer;
@ -41,24 +42,54 @@ using Caps=OpenSim.Framework.Capabilities.Caps;
namespace OpenSim.Region.ClientStack.Linden namespace OpenSim.Region.ClientStack.Linden
{ {
public class ObjectAdd : IRegionModule [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class ObjectAdd : INonSharedRegionModule
{ {
// private static readonly ILog m_log = // private static readonly ILog m_log =
// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene; private Scene m_scene;
#region IRegionModule Members
public void Initialise(Scene pScene, IConfigSource pSource) #region INonSharedRegionModule Members
public void Initialise(IConfigSource pSource)
{ {
m_scene = pScene; }
public void AddRegion(Scene scene)
{
m_scene = scene;
m_scene.EventManager.OnRegisterCaps += RegisterCaps; m_scene.EventManager.OnRegisterCaps += RegisterCaps;
} }
public void PostInitialise() public void RemoveRegion(Scene scene)
{ {
if (m_scene == scene)
{
m_scene.EventManager.OnRegisterCaps -= RegisterCaps;
m_scene = null;
} }
}
public void RegionLoaded(Scene scene)
{
}
public void Close()
{
}
public string Name
{
get { return "ObjectAddModule"; }
}
public Type ReplaceableInterface
{
get { return null; }
}
#endregion
public void RegisterCaps(UUID agentID, Caps caps) public void RegisterCaps(UUID agentID, Caps caps)
{ {
@ -350,21 +381,5 @@ namespace OpenSim.Region.ClientStack.Linden
return String.Format("<binary encoding=\"base64\">{0}</binary>", Convert.ToBase64String(resultbytes)); return String.Format("<binary encoding=\"base64\">{0}</binary>", Convert.ToBase64String(resultbytes));
} }
public void Close()
{
}
public string Name
{
get { return "ObjectAddModule"; }
}
public bool IsSharedModule
{
get { return false; }
}
#endregion
} }
} }