mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
This commit is contained in:
@@ -39,9 +39,12 @@ using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
using Mono.Addins;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
{
|
||||
public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class AvatarFactoryModule : IAvatarFactoryModule, INonSharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -61,10 +64,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
|
||||
#region IRegionModule
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
scene.RegisterModuleInterface<IAvatarFactoryModule>(this);
|
||||
scene.EventManager.OnNewClient += SubscribeToClientEvents;
|
||||
|
||||
IConfig appearanceConfig = config.Configs["Appearance"];
|
||||
if (appearanceConfig != null)
|
||||
@@ -74,11 +75,29 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
// m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime);
|
||||
}
|
||||
|
||||
if (m_scene == null)
|
||||
m_scene = scene;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (m_scene == null)
|
||||
m_scene = scene;
|
||||
|
||||
scene.RegisterModuleInterface<IAvatarFactoryModule>(this);
|
||||
scene.EventManager.OnNewClient += SubscribeToClientEvents;
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (scene == m_scene)
|
||||
{
|
||||
scene.UnregisterModuleInterface<IAvatarFactoryModule>(this);
|
||||
scene.EventManager.OnNewClient -= SubscribeToClientEvents;
|
||||
}
|
||||
|
||||
m_scene = null;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
m_updateTimer.Enabled = false;
|
||||
m_updateTimer.AutoReset = true;
|
||||
@@ -100,6 +119,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
|
||||
private void SubscribeToClientEvents(IClientAPI client)
|
||||
{
|
||||
client.OnRequestWearables += Client_OnRequestWearables;
|
||||
|
||||
@@ -33,9 +33,12 @@ using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenMetaverse;
|
||||
|
||||
using Mono.Addins;
|
||||
|
||||
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);
|
||||
|
||||
@@ -54,7 +57,11 @@ 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 void AddRegion(Scene scene)
|
||||
{
|
||||
lock (m_scenel)
|
||||
{
|
||||
@@ -72,6 +79,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||
scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel;
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (m_scenel.ContainsKey(scene.RegionInfo.RegionHandle))
|
||||
m_scenel.Remove(scene.RegionInfo.RegionHandle);
|
||||
|
||||
scene.EventManager.OnAvatarKilled -= KillAvatar;
|
||||
scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
@@ -85,11 +105,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||
get { return "CombatModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return true; }
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
|
||||
private void KillAvatar(uint killerObjectLocalID, ScenePresence deadAvatar)
|
||||
{
|
||||
string deadAvatarMessage;
|
||||
|
||||
@@ -32,6 +32,7 @@ using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using Mono.Addins;
|
||||
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
@@ -39,16 +40,27 @@ using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
{
|
||||
public class DialogModule : IRegionModule, IDialogModule
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class DialogModule : IDialogModule, 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.RegisterModuleInterface<IDialogModule>(this);
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (scene != m_scene)
|
||||
return;
|
||||
|
||||
m_scene.AddCommand(
|
||||
"Users", this, "alert", "alert <message>",
|
||||
@@ -56,46 +68,59 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
HandleAlertConsoleCommand);
|
||||
|
||||
m_scene.AddCommand(
|
||||
"Users", this, "alert-user", "alert-user <first> <last> <message>",
|
||||
"Users", this, "alert-user",
|
||||
"alert-user <first> <last> <message>",
|
||||
"Send an alert to a user",
|
||||
HandleAlertConsoleCommand);
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
public void Close() {}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (scene != m_scene)
|
||||
return;
|
||||
|
||||
m_scene.UnregisterModuleInterface<IDialogModule>(this);
|
||||
}
|
||||
|
||||
public void Close() { }
|
||||
public string Name { get { return "Dialog Module"; } }
|
||||
public bool IsSharedModule { get { return false; } }
|
||||
|
||||
|
||||
public void SendAlertToUser(IClientAPI client, string message)
|
||||
{
|
||||
SendAlertToUser(client, message, false);
|
||||
}
|
||||
|
||||
public void SendAlertToUser(IClientAPI client, string message, bool modal)
|
||||
|
||||
public void SendAlertToUser(IClientAPI client, string message,
|
||||
bool modal)
|
||||
{
|
||||
client.SendAgentAlertMessage(message, modal);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void SendAlertToUser(UUID agentID, string message)
|
||||
{
|
||||
SendAlertToUser(agentID, message, false);
|
||||
}
|
||||
|
||||
|
||||
public void SendAlertToUser(UUID agentID, string message, bool modal)
|
||||
{
|
||||
ScenePresence sp = m_scene.GetScenePresence(agentID);
|
||||
|
||||
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendAgentAlertMessage(message, modal);
|
||||
}
|
||||
|
||||
public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
|
||||
|
||||
public void SendAlertToUser(string firstName, string lastName,
|
||||
string message, bool modal)
|
||||
{
|
||||
ScenePresence presence = m_scene.GetScenePresence(firstName, lastName);
|
||||
ScenePresence presence = m_scene.GetScenePresence(firstName,
|
||||
lastName);
|
||||
if (presence != null)
|
||||
presence.ControllingClient.SendAgentAlertMessage(message, modal);
|
||||
{
|
||||
presence.ControllingClient.SendAgentAlertMessage(message,
|
||||
modal);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SendGeneralAlert(string message)
|
||||
{
|
||||
m_scene.ForEachRootClient(delegate(IClientAPI client)
|
||||
@@ -104,11 +129,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
});
|
||||
}
|
||||
|
||||
public void SendDialogToUser(
|
||||
UUID avatarID, string objectName, UUID objectID, UUID ownerID,
|
||||
string message, UUID textureID, int ch, string[] buttonlabels)
|
||||
public void SendDialogToUser(UUID avatarID, string objectName,
|
||||
UUID objectID, UUID ownerID, string message, UUID textureID,
|
||||
int ch, string[] buttonlabels)
|
||||
{
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerID);
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(
|
||||
m_scene.RegionInfo.ScopeID, ownerID);
|
||||
string ownerFirstName, ownerLastName;
|
||||
if (account != null)
|
||||
{
|
||||
@@ -123,29 +149,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarID);
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendDialog(
|
||||
objectName, objectID, ownerID, ownerFirstName, ownerLastName, message, textureID, ch, buttonlabels);
|
||||
{
|
||||
sp.ControllingClient.SendDialog(objectName, objectID, ownerID,
|
||||
ownerFirstName, ownerLastName, message, textureID, ch,
|
||||
buttonlabels);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendUrlToUser(
|
||||
UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, string message, string url)
|
||||
public void SendUrlToUser(UUID avatarID, string objectName,
|
||||
UUID objectID, UUID ownerID, bool groupOwned, string message,
|
||||
string url)
|
||||
{
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarID);
|
||||
|
||||
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url);
|
||||
{
|
||||
sp.ControllingClient.SendLoadURL(objectName, objectID,
|
||||
ownerID, groupOwned, message, url);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid)
|
||||
|
||||
public void SendTextBoxToUser(UUID avatarid, string message,
|
||||
int chatChannel, string name, UUID objectid, UUID ownerid)
|
||||
{
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerid);
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(
|
||||
m_scene.RegionInfo.ScopeID, ownerid);
|
||||
string ownerFirstName, ownerLastName;
|
||||
UUID ownerID = UUID.Zero;
|
||||
UUID ownerID = UUID.Zero;
|
||||
if (account != null)
|
||||
{
|
||||
ownerFirstName = account.FirstName;
|
||||
ownerLastName = account.LastName;
|
||||
ownerID = account.PrincipalID;
|
||||
ownerID = account.PrincipalID;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -154,29 +189,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
}
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarid);
|
||||
|
||||
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerID, ownerFirstName, ownerLastName, objectid);
|
||||
{
|
||||
sp.ControllingClient.SendTextBoxRequest(message, chatChannel,
|
||||
name, ownerID, ownerFirstName, ownerLastName,
|
||||
objectid);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendNotificationToUsersInRegion(
|
||||
UUID fromAvatarID, string fromAvatarName, string message)
|
||||
public void SendNotificationToUsersInRegion(UUID fromAvatarID,
|
||||
string fromAvatarName, string message)
|
||||
{
|
||||
m_scene.ForEachRootClient(delegate(IClientAPI client)
|
||||
{
|
||||
client.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
|
||||
client.SendBlueBoxMessage(fromAvatarID, fromAvatarName,
|
||||
message);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Handle an alert command from the console.
|
||||
/// </summary>
|
||||
/// <param name="module"></param>
|
||||
/// <param name="cmdparams"></param>
|
||||
public void HandleAlertConsoleCommand(string module, string[] cmdparams)
|
||||
public void HandleAlertConsoleCommand(string module,
|
||||
string[] cmdparams)
|
||||
{
|
||||
if (m_scene.ConsoleScene() != null && m_scene.ConsoleScene() != m_scene)
|
||||
if (m_scene.ConsoleScene() != null &&
|
||||
m_scene.ConsoleScene() != m_scene)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
string message = string.Empty;
|
||||
|
||||
@@ -184,7 +228,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
{
|
||||
message = CombineParams(cmdparams, 1);
|
||||
m_log.InfoFormat("[DIALOG]: Sending general alert in region {0} with message {1}",
|
||||
m_scene.RegionInfo.RegionName, message);
|
||||
m_scene.RegionInfo.RegionName, message);
|
||||
SendGeneralAlert(message);
|
||||
}
|
||||
else if (cmdparams.Length > 3)
|
||||
@@ -192,9 +236,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
string firstName = cmdparams[1];
|
||||
string lastName = cmdparams[2];
|
||||
message = CombineParams(cmdparams, 3);
|
||||
m_log.InfoFormat(
|
||||
"[DIALOG]: Sending alert in region {0} to {1} {2} with message {3}",
|
||||
m_scene.RegionInfo.RegionName, firstName, lastName, message);
|
||||
m_log.InfoFormat("[DIALOG]: Sending alert in region {0} to {1} {2} with message {3}",
|
||||
m_scene.RegionInfo.RegionName, firstName, lastName,
|
||||
message);
|
||||
SendAlertToUser(firstName, lastName, message, false);
|
||||
}
|
||||
else
|
||||
@@ -212,7 +256,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
{
|
||||
result += commandParams[i] + " ";
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
@@ -35,26 +36,46 @@ using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
using Mono.Addins;
|
||||
|
||||
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 void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
|
||||
|
||||
m_scene.EventManager.OnNewClient += OnNewClient;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
m_scene.EventManager.OnNewClient -= OnNewClient;
|
||||
m_scene = null;
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
public void Close() {}
|
||||
public string Name { get { return "Gestures Module"; } }
|
||||
public bool IsSharedModule { get { return false; } }
|
||||
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
private void OnNewClient(IClientAPI client)
|
||||
{
|
||||
client.OnActivateGesture += ActivateGesture;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
@@ -50,9 +51,12 @@ using Caps = OpenSim.Framework.Capabilities.Caps;
|
||||
using OSDArray = OpenMetaverse.StructuredData.OSDArray;
|
||||
using OSDMap = OpenMetaverse.StructuredData.OSDMap;
|
||||
|
||||
using Mono.Addins;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
{
|
||||
public class GodsModule : IRegionModule, IGodsModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class GodsModule : INonSharedRegionModule, IGodsModule
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
@@ -66,10 +70,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
protected Dictionary<UUID, string> m_capsDict =
|
||||
new Dictionary<UUID, string>();
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
protected IDialogModule DialogModule
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_dialogModule == null)
|
||||
m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
|
||||
|
||||
return m_dialogModule;
|
||||
}
|
||||
}
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
|
||||
m_scene.RegisterModuleInterface<IGodsModule>(this);
|
||||
m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
|
||||
m_scene.EventManager.OnRegisterCaps += OnRegisterCaps;
|
||||
@@ -77,12 +95,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
scene.EventManager.OnIncomingInstantMessage +=
|
||||
OnIncomingInstantMessage;
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
m_scene.UnregisterModuleInterface<IGodsModule>(this);
|
||||
m_scene.EventManager.OnNewClient -= SubscribeToClientEvents;
|
||||
m_scene = null;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close() {}
|
||||
public string Name { get { return "Gods Module"; } }
|
||||
public bool IsSharedModule { get { return false; } }
|
||||
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void SubscribeToClientEvents(IClientAPI client)
|
||||
{
|
||||
client.OnGodKickUser += KickUser;
|
||||
@@ -172,8 +204,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_dialogModule != null)
|
||||
m_dialogModule.SendAlertToUser(agentID, "Request for god powers denied");
|
||||
if (DialogModule != null)
|
||||
DialogModule.SendAlertToUser(agentID, "Request for god powers denied");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
@@ -34,9 +35,12 @@ using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
using Mono.Addins;
|
||||
|
||||
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 +59,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
private static GroupMembershipData osGroup =
|
||||
new GroupMembershipData();
|
||||
|
||||
#region IRegionModule Members
|
||||
private bool m_Enabled = false;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
IConfig groupsConfig = config.Configs["Groups"];
|
||||
|
||||
@@ -67,7 +73,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!groupsConfig.GetBoolean("Enabled", false))
|
||||
m_Enabled = groupsConfig.GetBoolean("Enabled", false);
|
||||
if (!m_Enabled)
|
||||
{
|
||||
m_log.Info("[GROUPS]: Groups disabled in configuration");
|
||||
return;
|
||||
@@ -77,6 +84,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
lock (m_SceneList)
|
||||
{
|
||||
if (!m_SceneList.Contains(scene))
|
||||
@@ -96,7 +110,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
scene.EventManager.OnClientClosed += OnClientClosed;
|
||||
// scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
|
||||
// scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
lock (m_SceneList)
|
||||
{
|
||||
if (m_SceneList.Contains(scene))
|
||||
m_SceneList.Remove(scene);
|
||||
}
|
||||
|
||||
scene.EventManager.OnNewClient -= OnNewClient;
|
||||
scene.EventManager.OnClientClosed -= OnClientClosed;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
@@ -105,6 +138,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
|
||||
public void Close()
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
// m_log.Debug("[GROUPS]: Shutting down group module.");
|
||||
|
||||
lock (m_ClientMap)
|
||||
@@ -123,9 +159,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
get { return "GroupsModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return true; }
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -39,20 +39,18 @@ using OpenSim.Framework.Console;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using Mono.Addins;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
{
|
||||
/// <summary>
|
||||
/// This module loads and saves OpenSimulator inventory archives
|
||||
/// </summary>
|
||||
public class InventoryArchiverModule : IRegionModule, IInventoryArchiverModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class InventoryArchiverModule : ISharedRegionModule, IInventoryArchiverModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public string Name { get { return "Inventory Archiver Module"; } }
|
||||
|
||||
public bool IsSharedModule { get { return true; } }
|
||||
|
||||
/// <value>
|
||||
/// Enable or disable checking whether the iar user is actually logged in
|
||||
/// </value>
|
||||
@@ -99,9 +97,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
// public InventoryArchiverModule(bool disablePresenceChecks)
|
||||
// {
|
||||
// DisablePresenceChecks = disablePresenceChecks;
|
||||
// }
|
||||
// }
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
#region ISharedRegionModule
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (m_scenes.Count == 0)
|
||||
{
|
||||
@@ -144,10 +148,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
m_scenes[scene.RegionInfo.RegionID] = scene;
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close() {}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public string Name { get { return "Inventory Archiver Module"; } }
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Trigger the inventory archive saved event.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user