29 using System.Reflection;
30 using System.Collections.Generic;
34 using OpenSim.Framework;
35 using OpenSim.Framework.Servers;
36 using OpenSim.Region.Framework.Scenes;
37 using OpenSim.Region.Framework.Interfaces;
38 using OpenSim.Server.Base;
39 using OpenSim.Server.Handlers.Base;
40 using OpenSim.Services.Interfaces;
45 [Extension(Path =
"/OpenSim/RegionModules", NodeName =
"RegionModule", Id =
"NeighbourServiceInConnectorModule")]
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 private static bool m_Enabled =
false;
50 private static bool m_Registered =
false;
52 private IConfigSource m_Config;
53 private List<Scene> m_Scenes =
new List<Scene>();
55 #region Region Module interface
61 IConfig moduleConfig = config.Configs[
"Modules"];
62 if (moduleConfig != null)
64 m_Enabled = moduleConfig.GetBoolean(
"NeighbourServiceInConnector",
false);
67 m_log.Info(
"[NEIGHBOUR IN CONNECTOR]: NeighbourServiceInConnector enabled");
86 public Type ReplaceableInterface
93 get {
return "NeighbourServiceInConnectorModule"; }
104 Object[] args =
new Object[] { m_Config, MainServer.Instance,
this, scene };
105 ServerUtils.LoadPlugin<
IServiceConnector>(
"OpenSim.Server.Handlers.dll:NeighbourServiceInConnector", args);
114 if (m_Enabled && m_Scenes.Contains(scene))
115 m_Scenes.Remove(scene);
124 #region INeighbourService
128 foreach (
Scene s
in m_Scenes)
133 return s.IncomingHelloNeighbour(thisRegion);
139 #endregion INeighbourService
void AddRegion(Scene scene)
This is called whenever a Scene is added. For shared modules, this can happen several times...
void RemoveRegion(Scene scene)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
void PostInitialise()
This is called exactly once after all the shared region-modules have been instanciated and IRegionMod...
void Initialise(IConfigSource config)
This is called to initialize the region module. For shared modules, this is called exactly once...
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
Interactive OpenSim region server
GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion)
virtual RegionInfo RegionInfo
void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...