29 using System.Collections.Generic;
30 using System.Reflection;
35 using OpenMetaverse.Packets;
36 using OpenMetaverse.StructuredData;
37 using OpenSim.Framework;
38 using OpenSim.Region.Framework;
39 using OpenSim.Region.Framework.Interfaces;
40 using OpenSim.Region.Framework.Scenes;
44 [Extension(Path =
"/OpenSim/RegionModules", NodeName =
"RegionModule", Id =
"DAExampleModule")]
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 private readonly
bool ENABLED =
false;
51 public const string Namespace =
"Example";
52 public const string StoreName =
"DA";
57 public string Name {
get {
return "DAExample Module"; } }
58 public Type ReplaceableInterface {
get {
return null; } }
67 m_scene.EventManager.OnSceneGroupMove += OnSceneGroupMove;
68 m_dialogMod = m_scene.RequestModuleInterface<
IDialogModule>();
70 m_log.DebugFormat(
"[DA EXAMPLE MODULE]: Added region {0}", m_scene.Name);
78 m_scene.EventManager.OnSceneGroupMove -= OnSceneGroupMove;
86 RemoveRegion(m_scene);
105 if (!attrs.ContainsKey(
"moves"))
106 newValue =
new OSDInteger(1);
108 newValue =
new OSDInteger(attrs[
"moves"].AsInteger() + 1);
110 attrs[
"moves"] = newValue;
112 sop.DynAttrs.SetStore(Namespace, StoreName, attrs);
115 sop.ParentGroup.HasGroupChanged =
true;
117 string msg = string.Format(
"{0} {1} moved {2} times", sop.Name, sop.UUID, newValue);
118 m_log.DebugFormat(
"[DA EXAMPLE MODULE]: {0}", msg);
119 m_dialogMod.SendGeneralAlert(msg);
bool TryGetStore(string ns, string storeName, out OSDMap store)
void Initialise(IConfigSource source)
This is called to initialize the region module. For shared modules, this is called exactly once...
bool OnSceneGroupMove(UUID groupId, Vector3 delta)
OpenMetaverse.StructuredData.OSDMap OSDMap
void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...
Interactive OpenSim region server
DAMap DynAttrs
Dynamic attributes can be created and deleted as required.
void RemoveRegion(Scene scene)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
void AddRegion(Scene scene)
This is called whenever a Scene is added. For shared modules, this can happen several times...
IDialogModule m_dialogMod