convert attachments module from old region module style to new

prebuild-update
Justin Clark-Casey (justincc) 2010-07-30 19:26:54 +01:00
parent b83910f12a
commit 5b80e3fc18
1 changed files with 25 additions and 19 deletions

View File

@ -29,6 +29,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using log4net; using log4net;
using Mono.Addins;
using Nini.Config; using Nini.Config;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.Packets; using OpenMetaverse.Packets;
@ -39,38 +40,43 @@ using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.CoreModules.Avatar.Attachments namespace OpenSim.Region.CoreModules.Avatar.Attachments
{ {
public class AttachmentsModule : IAttachmentsModule, IRegionModule [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AttachmentsModule")]
public class AttachmentsModule : IAttachmentsModule, INonSharedRegionModule
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Scene m_scene = null; protected Scene m_scene = null;
public void Initialise(Scene scene, IConfigSource source) public string Name { get { return "Attachments Module"; } }
public Type ReplaceableInterface { get { return null; } }
public void Initialise(IConfigSource source) {}
public void AddRegion(Scene scene)
{ {
scene.RegisterModuleInterface<IAttachmentsModule>(this);
m_scene = scene; m_scene = scene;
m_scene.RegisterModuleInterface<IAttachmentsModule>(this);
} }
public void PostInitialise() public void RemoveRegion(Scene scene)
{ {
m_scene.UnregisterModuleInterface<IAttachmentsModule>(this);
} }
public void RegionLoaded(Scene scene) {}
public void Close() public void Close()
{ {
RemoveRegion(m_scene);
} }
public string Name /// <summary>
{ /// Called by client
get { return "Attachments Module"; } /// </summary>
} /// <param name="remoteClient"></param>
/// <param name="objectLocalID"></param>
public bool IsSharedModule /// <param name="AttachmentPt"></param>
{ /// <param name="silent"></param>
get { return false; }
}
// Called by client
//
public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent)
{ {
m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject");