Merge branch 'master' into careminster-presence-refactor

This commit is contained in:
Melanie
2010-07-31 00:57:50 +01:00
28 changed files with 190 additions and 2322 deletions

View File

@@ -30,6 +30,7 @@ using System.Collections.Generic;
using System.Reflection;
using System.Xml;
using log4net;
using Mono.Addins;
using Nini.Config;
using OpenMetaverse;
using OpenMetaverse.Packets;
@@ -41,38 +42,64 @@ using OpenSim.Region.Framework.Scenes.Serialization;
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);
protected Scene m_scene = null;
public string Name { get { return "Attachments Module"; } }
public Type ReplaceableInterface { get { return null; } }
public void Initialise(Scene scene, IConfigSource source)
public void Initialise(IConfigSource source) {}
public void AddRegion(Scene scene)
{
scene.RegisterModuleInterface<IAttachmentsModule>(this);
m_scene = scene;
m_scene.RegisterModuleInterface<IAttachmentsModule>(this);
m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
// TODO: Should probably be subscribing to CloseClient too, but this doesn't yet give us IClientAPI
}
public void PostInitialise()
public void RemoveRegion(Scene scene)
{
m_scene.UnregisterModuleInterface<IAttachmentsModule>(this);
m_scene.EventManager.OnNewClient -= SubscribeToClientEvents;
}
public void Close()
public void RegionLoaded(Scene scene) {}
public void Close()
{
RemoveRegion(m_scene);
}
public string Name
public void SubscribeToClientEvents(IClientAPI client)
{
get { return "Attachments Module"; }
client.OnRezSingleAttachmentFromInv += RezSingleAttachmentFromInventory;
client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachmentsFromInventory;
client.OnObjectAttach += AttachObject;
client.OnObjectDetach += DetachObject;
client.OnDetachAttachmentIntoInv += ShowDetachInUserInventory;
}
public bool IsSharedModule
public void UnsubscribeFromClientEvents(IClientAPI client)
{
get { return false; }
client.OnRezSingleAttachmentFromInv -= RezSingleAttachmentFromInventory;
client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachmentsFromInventory;
client.OnObjectAttach -= AttachObject;
client.OnObjectDetach -= DetachObject;
client.OnDetachAttachmentIntoInv -= ShowDetachInUserInventory;
}
// Called by client
//
/// <summary>
/// Called by client
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="objectLocalID"></param>
/// <param name="AttachmentPt"></param>
/// <param name="silent"></param>
public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent)
{
m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject");

View File

@@ -47,6 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
m_scene = scene;
m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
m_scene.RegisterModuleInterface<IGodsModule>(this);
m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
}
public void PostInitialise() {}
@@ -54,6 +55,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
public string Name { get { return "Gods Module"; } }
public bool IsSharedModule { get { return false; } }
public void SubscribeToClientEvents(IClientAPI client)
{
client.OnGodKickUser += KickUser;
client.OnRequestGodlikePowers += RequestGodlikePowers;
}
public void UnsubscribeFromClientEvents(IClientAPI client)
{
client.OnGodKickUser -= KickUser;
client.OnRequestGodlikePowers -= RequestGodlikePowers;
}
public void RequestGodlikePowers(
UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient)
{

View File

@@ -30,7 +30,7 @@ using OpenSim.Region.CoreModules.World.Terrain;
using OpenSim.Region.CoreModules.World.Terrain.FloodBrushes;
using OpenSim.Region.Framework.Interfaces;
namespace OpenSim.Region.Modules.Terrain.Extensions.DefaultEffects.Effects
namespace OpenSim.Region.CoreModules.World.Terrain.Effects
{
public class ChannelDigger : ITerrainEffect
{

View File

@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
#endregion
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private readonly Commander m_commander = new Commander("terrain");
private readonly Dictionary<StandardTerrainEffects, ITerrainFloodEffect> m_floodeffects =
@@ -381,8 +381,13 @@ namespace OpenSim.Region.CoreModules.World.Terrain
private void LoadPlugins()
{
m_plugineffects = new Dictionary<string, ITerrainEffect>();
string plugineffectsPath = "Terrain";
// Load the files in the Terrain/ dir
string[] files = Directory.GetFiles("Terrain");
if (!Directory.Exists(plugineffectsPath))
return;
string[] files = Directory.GetFiles(plugineffectsPath);
foreach (string file in files)
{
m_log.Info("Loading effects in " + file);