mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +08:00
Merge branch 'master' into careminster
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -38,7 +39,8 @@ using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
{
|
||||
public class AvatarFactoryModule : IAvatarFactory, IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class AvatarFactoryModule : IAvatarFactory, ISharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private Scene m_scene = null;
|
||||
@@ -75,7 +77,16 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
return appearance;
|
||||
}
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
scene.RegisterModuleInterface<IAvatarFactory>(this);
|
||||
scene.EventManager.OnNewClient += NewClient;
|
||||
@@ -84,9 +95,18 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
{
|
||||
m_scene = scene;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
scene.UnregisterModuleInterface<IAvatarFactory>(this);
|
||||
scene.EventManager.OnNewClient -= NewClient;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
@@ -100,11 +120,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
get { return "Default Avatar Factory"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public void NewClient(IClientAPI client)
|
||||
{
|
||||
client.OnAvatarNowWearing += AvatarIsWearing;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
@@ -34,7 +35,8 @@ using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||
{
|
||||
public class CombatModule : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class CombatModule : ISharedRegionModule
|
||||
{
|
||||
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -53,7 +55,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||
/// </summary>
|
||||
/// <param name="scene"></param>
|
||||
/// <param name="config"></param>
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
lock (m_scenel)
|
||||
{
|
||||
@@ -71,6 +83,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||
scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
scene.EventManager.OnAvatarKilled -= KillAvatar;
|
||||
scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel;
|
||||
m_scenel.Remove(scene.RegionInfo.RegionHandle);
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
@@ -84,11 +107,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||
get { return "CombatModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
private void KillAvatar(uint killerObjectLocalID, ScenePresence DeadAvatar)
|
||||
{
|
||||
if (killerObjectLocalID == 0)
|
||||
|
||||
@@ -25,9 +25,11 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -37,28 +39,46 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
{
|
||||
public class DialogModule : IRegionModule, IDialogModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class DialogModule : ISharedRegionModule, IDialogModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected Scene m_scene;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_scene.RegisterModuleInterface<IDialogModule>(this);
|
||||
|
||||
|
||||
m_scene.AddCommand(
|
||||
this, "alert", "alert <first> <last> <message>", "Send an alert to a user", HandleAlertConsoleCommand);
|
||||
|
||||
m_scene.AddCommand(
|
||||
this, "alert general", "alert general <message>", "Send an alert to everyone", HandleAlertConsoleCommand);
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
scene.UnregisterModuleInterface<IDialogModule>(this);
|
||||
}
|
||||
|
||||
public void PostInitialise() { }
|
||||
public void Close() {}
|
||||
public string Name { get { return "Dialog Module"; } }
|
||||
public bool IsSharedModule { get { return false; } }
|
||||
|
||||
public void SendAlertToUser(IClientAPI client, string message)
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@ using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using Nwc.XmlRpc;
|
||||
using OpenMetaverse;
|
||||
@@ -81,7 +82,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
- Terminate Friendship messages (single)
|
||||
*/
|
||||
|
||||
public class FriendsModule : IRegionModule, IFriendsModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class FriendsModule : ISharedRegionModule, IFriendsModule
|
||||
{
|
||||
private class Transaction
|
||||
{
|
||||
@@ -111,9 +113,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
|
||||
private IGridService m_gridServices = null;
|
||||
|
||||
#region IRegionModule Members
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
lock (m_scenes)
|
||||
{
|
||||
@@ -128,9 +144,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
if (!m_scenes.ContainsKey(scene.RegionInfo.RegionHandle))
|
||||
m_scenes[scene.RegionInfo.RegionHandle] = scene;
|
||||
}
|
||||
|
||||
|
||||
scene.RegisterModuleInterface<IFriendsModule>(this);
|
||||
|
||||
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
|
||||
scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel;
|
||||
@@ -138,17 +154,34 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
scene.EventManager.OnClientClosed += ClientClosed;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (m_scenes.Count > 0)
|
||||
{
|
||||
m_TransferModule = m_initialScene.RequestModuleInterface<IMessageTransferModule>();
|
||||
m_gridServices = m_initialScene.GridService;
|
||||
m_TransferModule = scene.RequestModuleInterface<IMessageTransferModule>();
|
||||
m_gridServices = scene.GridService;
|
||||
}
|
||||
if (m_TransferModule == null)
|
||||
m_log.Error("[FRIENDS]: Unable to find a message transfer module, friendship offers will not work");
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
MainServer.Instance.RemoveXmlRPCHandler("presence_update_bulk");
|
||||
MainServer.Instance.RemoveXmlRPCHandler("terminate_friend");
|
||||
|
||||
if (m_scenes.ContainsKey(scene.RegionInfo.RegionHandle))
|
||||
m_scenes.Remove(scene.RegionInfo.RegionHandle);
|
||||
|
||||
scene.UnregisterModuleInterface<IFriendsModule>(this);
|
||||
|
||||
scene.EventManager.OnNewClient -= OnNewClient;
|
||||
scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage;
|
||||
scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel;
|
||||
scene.EventManager.OnMakeChildAgent -= MakeChildAgent;
|
||||
scene.EventManager.OnClientClosed -= ClientClosed;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
@@ -158,11 +191,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
get { return "FriendsModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IInterregionFriendsComms
|
||||
|
||||
@@ -25,8 +25,10 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -37,23 +39,41 @@ using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Gestures
|
||||
{
|
||||
public class GesturesModule : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class GesturesModule : INonSharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected Scene m_scene;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
|
||||
m_scene.EventManager.OnNewClient += OnNewClient;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if(m_scene == scene)
|
||||
m_scene = null;
|
||||
scene.EventManager.OnNewClient -= OnNewClient;
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
public void Close() {}
|
||||
public string Name { get { return "Gestures Module"; } }
|
||||
public bool IsSharedModule { get { return false; } }
|
||||
|
||||
private void OnNewClient(IClientAPI client)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,9 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -34,7 +36,8 @@ using OpenSim.Region.Framework.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
{
|
||||
public class GodsModule : IRegionModule, IGodsModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class GodsModule : INonSharedRegionModule, IGodsModule
|
||||
{
|
||||
/// <summary>Special UUID for actions that apply to all agents</summary>
|
||||
private static readonly UUID ALL_AGENTS = new UUID("44e87126-e794-4ded-05b3-7c42da3d5cdb");
|
||||
@@ -42,17 +45,34 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
protected Scene m_scene;
|
||||
protected IDialogModule m_dialogModule;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
|
||||
m_scene.RegisterModuleInterface<IGodsModule>(this);
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
scene.UnregisterModuleInterface<IGodsModule>(this);
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
public void Close() {}
|
||||
public string Name { get { return "Gods Module"; } }
|
||||
public bool IsSharedModule { get { return false; } }
|
||||
|
||||
public void RequestGodlikePowers(
|
||||
UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient)
|
||||
|
||||
@@ -25,9 +25,11 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -36,7 +38,8 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
{
|
||||
public class GroupsModule : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class GroupsModule : ISharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
@@ -55,9 +58,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
private static GroupMembershipData osGroup =
|
||||
new GroupMembershipData();
|
||||
|
||||
#region IRegionModule Members
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
IConfig groupsConfig = config.Configs["Groups"];
|
||||
|
||||
@@ -76,7 +79,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
if (groupsConfig.GetString("Module", "Default") != "Default")
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
lock (m_SceneList)
|
||||
{
|
||||
if (!m_SceneList.Contains(scene))
|
||||
@@ -99,6 +110,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (m_SceneList.Contains(scene))
|
||||
m_SceneList.Remove(scene);
|
||||
scene.EventManager.OnNewClient -= OnNewClient;
|
||||
scene.EventManager.OnClientClosed -= OnClientClosed;
|
||||
scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
@@ -123,11 +147,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
get { return "GroupsModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void OnNewClient(IClientAPI client)
|
||||
|
||||
@@ -24,9 +24,12 @@
|
||||
* (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.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -36,7 +39,8 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
{
|
||||
public class InstantMessageModule : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class InstantMessageModule : ISharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -47,11 +51,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
|
||||
private readonly List<Scene> m_scenes = new List<Scene>();
|
||||
|
||||
#region IRegionModule Members
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
private IMessageTransferModule m_TransferModule = null;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
if (config.Configs["Messaging"] != null)
|
||||
{
|
||||
@@ -62,7 +66,15 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
}
|
||||
|
||||
m_enabled = true;
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
lock (m_scenes)
|
||||
{
|
||||
if (!m_scenes.Contains(scene))
|
||||
@@ -74,6 +86,27 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
}
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (!m_enabled)
|
||||
return;
|
||||
|
||||
m_TransferModule =
|
||||
m_scenes[0].RequestModuleInterface<IMessageTransferModule>();
|
||||
|
||||
if (m_TransferModule == null)
|
||||
m_log.Error("[INSTANT MESSAGE]: No message transfer module, " +
|
||||
"IM will not work!");
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (m_scenes.Contains(scene))
|
||||
m_scenes.Remove(scene);
|
||||
scene.EventManager.OnClientConnect -= OnClientConnect;
|
||||
scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage;
|
||||
}
|
||||
|
||||
void OnClientConnect(IClientCore client)
|
||||
{
|
||||
IClientIM clientIM;
|
||||
@@ -85,15 +118,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
if (!m_enabled)
|
||||
return;
|
||||
|
||||
m_TransferModule =
|
||||
m_scenes[0].RequestModuleInterface<IMessageTransferModule>();
|
||||
|
||||
if (m_TransferModule == null)
|
||||
m_log.Error("[INSTANT MESSAGE]: No message transfer module, "+
|
||||
"IM will not work!");
|
||||
}
|
||||
|
||||
public void Close()
|
||||
@@ -105,11 +129,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
get { return "InstantMessageModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void OnInstantMessage(IClientAPI client, GridInstantMessage im)
|
||||
|
||||
@@ -30,6 +30,7 @@ using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using Nwc.XmlRpc;
|
||||
using OpenMetaverse;
|
||||
@@ -40,7 +41,8 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
{
|
||||
public class MessageTransferModule : IRegionModule, IMessageTransferModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class MessageTransferModule : ISharedRegionModule, IMessageTransferModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -50,8 +52,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
protected Dictionary<UUID, ulong> m_UserRegionMap = new Dictionary<UUID, ulong>();
|
||||
|
||||
public event UndeliveredMessage OnUndeliveredMessage;
|
||||
private bool m_enabled = true;
|
||||
|
||||
public virtual void Initialise(Scene scene, IConfigSource config)
|
||||
public virtual void Initialise(IConfigSource config)
|
||||
{
|
||||
IConfig cnf = config.Configs["Messaging"];
|
||||
if (cnf != null && cnf.GetString(
|
||||
@@ -59,29 +62,51 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
"MessageTransferModule")
|
||||
{
|
||||
m_log.Debug("[MESSAGE TRANSFER]: Disabled by configuration");
|
||||
return;
|
||||
m_enabled = false;
|
||||
}
|
||||
|
||||
cnf = config.Configs["Startup"];
|
||||
if (cnf != null)
|
||||
m_Gridmode = cnf.GetBoolean("gridmode", false);
|
||||
}
|
||||
|
||||
// m_Enabled = true;
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
lock (m_Scenes)
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (m_enabled)
|
||||
{
|
||||
if (m_Scenes.Count == 0)
|
||||
lock (m_Scenes)
|
||||
{
|
||||
MainServer.Instance.AddXmlRPCHandler(
|
||||
"grid_instant_message", processXMLRPCGridInstantMessage);
|
||||
}
|
||||
if (m_Scenes.Count == 0)
|
||||
{
|
||||
MainServer.Instance.AddXmlRPCHandler(
|
||||
"grid_instant_message", processXMLRPCGridInstantMessage);
|
||||
}
|
||||
|
||||
m_log.Debug("[MESSAGE TRANSFER]: Message transfer module active");
|
||||
scene.RegisterModuleInterface<IMessageTransferModule>(this);
|
||||
m_Scenes.Add(scene);
|
||||
m_log.Debug("[MESSAGE TRANSFER]: Message transfer module active");
|
||||
scene.RegisterModuleInterface<IMessageTransferModule>(this);
|
||||
m_Scenes.Add(scene);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (m_Scenes.Contains(scene))
|
||||
m_Scenes.Remove(scene);
|
||||
MainServer.Instance.RemoveXmlRPCHandler(
|
||||
"grid_instant_message");
|
||||
scene.UnregisterModuleInterface<IMessageTransferModule>(this);
|
||||
}
|
||||
|
||||
public virtual void PostInitialise()
|
||||
{
|
||||
}
|
||||
@@ -95,11 +120,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
get { return "MessageTransferModule"; }
|
||||
}
|
||||
|
||||
public virtual bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public virtual void SendInstantMessage(GridInstantMessage im, MessageResultNotification result)
|
||||
{
|
||||
UUID toAgentID = new UUID(im.toAgentID);
|
||||
|
||||
@@ -28,6 +28,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -39,7 +40,8 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.MuteList
|
||||
{
|
||||
public class MuteListModule : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class MuteListModule : ISharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -47,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList
|
||||
private List<Scene> m_SceneList = new List<Scene>();
|
||||
private string m_RestURL = String.Empty;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
if (!enabled)
|
||||
return;
|
||||
@@ -66,19 +68,24 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList
|
||||
enabled = false;
|
||||
return;
|
||||
}
|
||||
m_RestURL = cnf.GetString("MuteListURL", "");
|
||||
if (m_RestURL == "")
|
||||
{
|
||||
m_log.Error("[MUTE LIST] Module was enabled, but no URL is given, disabling");
|
||||
enabled = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
lock (m_SceneList)
|
||||
{
|
||||
if (m_SceneList.Count == 0)
|
||||
{
|
||||
m_RestURL = cnf.GetString("MuteListURL", "");
|
||||
if (m_RestURL == "")
|
||||
{
|
||||
m_log.Error("[MUTE LIST] Module was enabled, but no URL is given, disabling");
|
||||
enabled = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!m_SceneList.Contains(scene))
|
||||
m_SceneList.Add(scene);
|
||||
|
||||
@@ -86,6 +93,18 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList
|
||||
}
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (m_SceneList.Contains(scene))
|
||||
m_SceneList.Remove(scene);
|
||||
|
||||
scene.EventManager.OnNewClient -= OnNewClient;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
if (!enabled)
|
||||
@@ -102,11 +121,6 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList
|
||||
get { return "MuteListModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -40,7 +41,8 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
{
|
||||
public class OfflineMessageModule : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class OfflineMessageModule : ISharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -49,7 +51,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
private string m_RestURL = String.Empty;
|
||||
private bool m_ForwardOfflineGroupMessages = true;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
if (!enabled)
|
||||
return;
|
||||
@@ -83,14 +85,23 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!m_SceneList.Contains(scene))
|
||||
m_SceneList.Add(scene);
|
||||
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
}
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (!m_SceneList.Contains(scene))
|
||||
m_SceneList.Add(scene);
|
||||
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (!enabled)
|
||||
return;
|
||||
@@ -120,16 +131,22 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
m_log.Debug("[OFFLINE MESSAGING] Offline messages enabled");
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (m_SceneList.Contains(scene))
|
||||
m_SceneList.Remove(scene);
|
||||
scene.EventManager.OnNewClient -= OnNewClient;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "OfflineMessageModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
@@ -163,10 +180,12 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
|
||||
private void RetrieveInstantMessages(IClientAPI client)
|
||||
{
|
||||
m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId);
|
||||
if (m_RestURL != "")
|
||||
{
|
||||
m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId);
|
||||
|
||||
List<GridInstantMessage>msglist = SynchronousRestObjectPoster.BeginPostObject<UUID, List<GridInstantMessage>>(
|
||||
"POST", m_RestURL+"/RetrieveMessages/", client.AgentId);
|
||||
List<GridInstantMessage> msglist = SynchronousRestObjectPoster.BeginPostObject<UUID, List<GridInstantMessage>>(
|
||||
"POST", m_RestURL + "/RetrieveMessages/", client.AgentId);
|
||||
|
||||
if (msglist != null)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -30,6 +30,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -41,10 +42,11 @@ using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
/// <summary>
|
||||
/// This module loads and saves OpenSimulator inventory archives
|
||||
/// </summary>
|
||||
public class InventoryArchiverModule : IRegionModule, IInventoryArchiverModule
|
||||
public class InventoryArchiverModule : ISharedRegionModule, IInventoryArchiverModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -82,18 +84,28 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
DisablePresenceChecks = disablePresenceChecks;
|
||||
}
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (m_scenes.Count == 0)
|
||||
{
|
||||
scene.RegisterModuleInterface<IInventoryArchiverModule>(this);
|
||||
OnInventoryArchiveSaved += SaveInvConsoleCommandCompleted;
|
||||
|
||||
|
||||
scene.AddCommand(
|
||||
this, "load iar",
|
||||
"load iar <first> <last> <inventory path> <password> [<archive path>]",
|
||||
"Load user inventory archive.", HandleLoadInvConsoleCommand);
|
||||
|
||||
"Load user inventory archive.", HandleLoadInvConsoleCommand);
|
||||
|
||||
scene.AddCommand(
|
||||
this, "save iar",
|
||||
"save iar <first> <last> <inventory path> <password> [<archive path>]",
|
||||
@@ -101,10 +113,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
|
||||
m_aScene = scene;
|
||||
}
|
||||
|
||||
|
||||
m_scenes[scene.RegionInfo.RegionID] = scene;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
scene.UnregisterModuleInterface<IInventoryArchiverModule>(this);
|
||||
if(m_scenes.ContainsKey(scene.RegionInfo.RegionID))
|
||||
m_scenes.Remove(scene.RegionInfo.RegionID);
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
|
||||
public void Close() {}
|
||||
|
||||
@@ -29,6 +29,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -39,7 +40,8 @@ using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
{
|
||||
public class InventoryTransferModule : IInventoryTransferModule, IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class InventoryTransferModule : IInventoryTransferModule, ISharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log
|
||||
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
@@ -50,10 +52,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
new Dictionary<UUID, Scene>();
|
||||
|
||||
private IMessageTransferModule m_TransferModule = null;
|
||||
private bool m_enabled = true;
|
||||
|
||||
#region IRegionModule Members
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
if (config.Configs["Messaging"] != null)
|
||||
{
|
||||
@@ -62,29 +65,59 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
if (config.Configs["Messaging"].GetString(
|
||||
"InventoryTransferModule", "InventoryTransferModule") !=
|
||||
"InventoryTransferModule")
|
||||
return;
|
||||
m_enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_Scenelist.Contains(scene))
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (m_enabled)
|
||||
{
|
||||
m_Scenelist.Add(scene);
|
||||
if (!m_Scenelist.Contains(scene))
|
||||
{
|
||||
m_Scenelist.Add(scene);
|
||||
|
||||
scene.RegisterModuleInterface<IInventoryTransferModule>(this);
|
||||
scene.RegisterModuleInterface<IInventoryTransferModule>(this);
|
||||
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
scene.EventManager.OnClientClosed += ClientLoggedOut;
|
||||
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
scene.EventManager.OnClientClosed += ClientLoggedOut;
|
||||
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (m_enabled)
|
||||
{
|
||||
if (m_Scenelist.Count > 0)
|
||||
{
|
||||
m_TransferModule = m_Scenelist[0].RequestModuleInterface<IMessageTransferModule>();
|
||||
if (m_TransferModule == null)
|
||||
m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (m_Scenelist.Contains(scene))
|
||||
m_Scenelist.Remove(scene);
|
||||
|
||||
scene.UnregisterModuleInterface<IInventoryTransferModule>(this);
|
||||
|
||||
scene.EventManager.OnNewClient -= OnNewClient;
|
||||
scene.EventManager.OnClientClosed -= ClientLoggedOut;
|
||||
scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
if (m_Scenelist.Count > 0)
|
||||
{
|
||||
m_TransferModule = m_Scenelist[0].RequestModuleInterface<IMessageTransferModule>();
|
||||
if (m_TransferModule == null)
|
||||
m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only");
|
||||
}
|
||||
}
|
||||
|
||||
public void Close()
|
||||
|
||||
@@ -29,6 +29,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -37,36 +38,72 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Lure
|
||||
{
|
||||
public class LureModule : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class LureModule : ISharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private readonly List<Scene> m_scenes = new List<Scene>();
|
||||
|
||||
private bool m_enabled = true;
|
||||
|
||||
private IMessageTransferModule m_TransferModule = null;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
if (config.Configs["Messaging"] != null)
|
||||
{
|
||||
if (config.Configs["Messaging"].GetString(
|
||||
"LureModule", "LureModule") !=
|
||||
"LureModule")
|
||||
return;
|
||||
m_enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
lock (m_scenes)
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (m_enabled)
|
||||
{
|
||||
if (!m_scenes.Contains(scene))
|
||||
lock (m_scenes)
|
||||
{
|
||||
m_scenes.Add(scene);
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
scene.EventManager.OnIncomingInstantMessage +=
|
||||
OnGridInstantMessage;
|
||||
if (!m_scenes.Contains(scene))
|
||||
{
|
||||
m_scenes.Add(scene);
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
scene.EventManager.OnIncomingInstantMessage +=
|
||||
OnGridInstantMessage;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (m_enabled)
|
||||
{
|
||||
m_TransferModule =
|
||||
m_scenes[0].RequestModuleInterface<IMessageTransferModule>();
|
||||
|
||||
if (m_TransferModule == null)
|
||||
m_log.Error("[INSTANT MESSAGE]: No message transfer module, " +
|
||||
"lures will not work!");
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (m_scenes.Contains(scene))
|
||||
m_scenes.Remove(scene);
|
||||
scene.EventManager.OnNewClient -= OnNewClient;
|
||||
scene.EventManager.OnIncomingInstantMessage -=
|
||||
OnGridInstantMessage;
|
||||
}
|
||||
|
||||
void OnNewClient(IClientAPI client)
|
||||
{
|
||||
client.OnInstantMessage += OnInstantMessage;
|
||||
@@ -76,12 +113,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
m_TransferModule =
|
||||
m_scenes[0].RequestModuleInterface<IMessageTransferModule>();
|
||||
|
||||
if (m_TransferModule == null)
|
||||
m_log.Error("[INSTANT MESSAGE]: No message transfer module, "+
|
||||
"lures will not work!");
|
||||
}
|
||||
|
||||
public void Close()
|
||||
|
||||
@@ -29,6 +29,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
@@ -41,24 +42,54 @@ using Caps=OpenSim.Framework.Capabilities.Caps;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
|
||||
{
|
||||
public class ObjectAdd : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class ObjectAdd : ISharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private Scene m_scene;
|
||||
#region IRegionModule Members
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void Initialise(Scene pScene, IConfigSource pSource)
|
||||
public void Initialise(IConfigSource pSource)
|
||||
{
|
||||
m_scene = pScene;
|
||||
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_scene.EventManager.OnRegisterCaps += RegisterCaps;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
scene.EventManager.OnRegisterCaps -= RegisterCaps;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "ObjectAddModule"; }
|
||||
}
|
||||
|
||||
public void RegisterCaps(UUID agentID, Caps caps)
|
||||
{
|
||||
UUID capuuid = UUID.Random();
|
||||
@@ -348,22 +379,6 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
|
||||
Array.Reverse(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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ using System.Collections;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -38,20 +39,17 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Profiles
|
||||
{
|
||||
public class AvatarProfilesModule : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class AvatarProfilesModule : INonSharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private Scene m_scene;
|
||||
private IProfileModule m_profileModule = null;
|
||||
private bool m_enabled = true;
|
||||
|
||||
public AvatarProfilesModule()
|
||||
{
|
||||
}
|
||||
#region INonSharedRegionModule Members
|
||||
|
||||
#region IRegionModule Members
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
IConfig profileConfig = config.Configs["Profile"];
|
||||
if (profileConfig != null)
|
||||
@@ -62,18 +60,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_scene.EventManager.OnNewClient += NewClient;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (!m_enabled)
|
||||
return;
|
||||
m_profileModule = m_scene.RequestModuleInterface<IProfileModule>();
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
scene.EventManager.OnNewClient -= NewClient;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
@@ -83,11 +94,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles
|
||||
get { return "AvatarProfilesModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void NewClient(IClientAPI client)
|
||||
|
||||
Reference in New Issue
Block a user