29 using System.Collections.Generic;
30 using System.Reflection;
35 using OpenSim.Framework;
36 using OpenSim.Server.Base;
37 using OpenSim.Region.Framework.Interfaces;
38 using OpenSim.Region.Framework.Scenes;
39 using OpenSim.Services.Interfaces;
43 [Extension(Path =
"/OpenSim/RegionModules", NodeName =
"RegionModule", Id =
"LocalNeighbourServicesConnector")]
47 private static readonly ILog m_log =
49 MethodBase.GetCurrentMethod().DeclaringType);
51 private List<Scene> m_Scenes =
new List<Scene>();
53 private bool m_Enabled =
false;
64 #region ISharedRegionModule
66 public Type ReplaceableInterface
73 get {
return "LocalNeighbourServicesConnector"; }
78 IConfig moduleConfig = source.Configs[
"Modules"];
79 if (moduleConfig != null)
81 string name = moduleConfig.GetString(
"NeighbourServices", this.Name);
86 m_log.Info(
"[NEIGHBOUR CONNECTOR]: Local neighbour connector enabled");
107 m_log.Info(
"[NEIGHBOUR CONNECTOR]: Local neighbour connector enabled for region " + scene.RegionInfo.RegionName);
117 if (m_Scenes.Contains(scene))
118 m_Scenes.Remove(scene);
121 #endregion ISharedRegionModule
123 #region INeighbourService
128 Util.RegionHandleToRegionLoc(regionHandle, out x, out y);
130 foreach (
Scene s
in m_Scenes)
134 m_log.DebugFormat(
"[LOCAL NEIGHBOUR SERVICE CONNECTOR]: HelloNeighbour from region {0} to neighbour {1} at {2}-{3}",
135 thisRegion.RegionName, s.Name, x, y );
138 return s.IncomingHelloNeighbour(thisRegion);
145 #endregion INeighbourService
void PostInitialise()
This is called exactly once after all the shared region-modules have been instanciated and IRegionMod...
void Initialise(IConfigSource source)
This is called to initialize the region module. For shared modules, this is called exactly once...
void RemoveRegion(Scene scene)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
LocalNeighbourServicesConnector()
void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...
LocalNeighbourServicesConnector(List< Scene > scenes)
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
Interactive OpenSim region server
virtual RegionInfo RegionInfo
OpenSim.Services.Interfaces.GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion)
void AddRegion(Scene scene)
This is called whenever a Scene is added. For shared modules, this can happen several times...