28 using System.Collections.Generic;
29 using System.Reflection;
34 using OpenSim.Framework;
35 using OpenSim.Framework.Servers;
36 using OpenSim.Framework.Client;
37 using OpenSim.Region.Framework.Interfaces;
38 using OpenSim.Region.Framework.Scenes;
40 namespace OpenSim.
Region.CoreModules.
Avatar.InstantMessage
42 [Extension(Path =
"/OpenSim/RegionModules", NodeName =
"RegionModule", Id =
"MuteListModule")]
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 private bool enabled =
true;
48 private List<Scene> m_SceneList =
new List<Scene>();
49 private string m_RestURL = String.Empty;
53 IConfig cnf = config.Configs[
"Messaging"];
60 if (cnf != null && cnf.GetString(
"MuteListModule",
"None") !=
67 m_RestURL = cnf.GetString(
"MuteListURL",
"");
70 m_log.Error(
"[MUTE LIST] Module was enabled, but no URL is given, disabling");
83 m_SceneList.Add(scene);
85 scene.EventManager.OnNewClient += OnNewClient;
100 m_SceneList.Remove(scene);
109 m_log.Debug(
"[MUTE LIST] Mute list enabled");
114 get {
return "MuteListModule"; }
117 public Type ReplaceableInterface
128 client.OnMuteListRequest += OnMuteListRequest;
131 private void OnMuteListRequest(
IClientAPI client, uint crc)
133 m_log.DebugFormat(
"[MUTE LIST] Got mute list request for crc {0}", crc);
134 string filename =
"mutes"+client.AgentId.ToString();
136 IXfer xfer = client.Scene.RequestModuleInterface<
IXfer>();
139 xfer.AddNewFile(filename,
new Byte[0]);
140 client.SendMuteListUpdate(filename);
void RemoveRegion(Scene scene)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
void AddRegion(Scene scene)
This is called whenever a Scene is added. For shared modules, this can happen several times...
void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...
void PostInitialise()
This is called exactly once after all the shared region-modules have been instanciated and IRegionMod...
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
void Initialise(IConfigSource config)
This is called to initialize the region module. For shared modules, this is called exactly once...