From 29b8c84ceaaeca80bfa9c0bfc8c31e421e39ef71 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 2 May 2008 16:41:08 +0000 Subject: * Commit 2/3 - Please dont attempt to update to this revision until all 3 are in. --- .../Modules/Grid/Interregion/IInterregionModule.cs | 1 + .../Modules/Grid/Interregion/InterregionModule.cs | 33 ++++++++-------------- 2 files changed, 13 insertions(+), 21 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/Grid/Interregion') diff --git a/OpenSim/Region/Environment/Modules/Grid/Interregion/IInterregionModule.cs b/OpenSim/Region/Environment/Modules/Grid/Interregion/IInterregionModule.cs index b717d59..e9e7167 100644 --- a/OpenSim/Region/Environment/Modules/Grid/Interregion/IInterregionModule.cs +++ b/OpenSim/Region/Environment/Modules/Grid/Interregion/IInterregionModule.cs @@ -11,5 +11,6 @@ namespace OpenSim.Region.Environment.Modules.Grid.Interregion T[] RequestInterface(); Location GetLocationByDirection(Scene scene, InterregionModule.Direction dir); void internal_CreateRemotingObjects(); + void RegisterRemoteRegion(string uri); } } \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs b/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs index 2ca4df9..9cd9d96 100644 --- a/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs +++ b/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs @@ -29,14 +29,14 @@ namespace OpenSim.Region.Environment.Modules.Grid.Interregion #endregion private readonly Dictionary m_interfaces = new Dictionary(); + private readonly Object m_lockObject = new object(); private readonly List m_myLocations = new List(); private readonly Dictionary m_neighbourInterfaces = new Dictionary(); private readonly Dictionary m_neighbourRemote = new Dictionary(); private IConfigSource m_config; - private bool m_enabled = false; + private const bool m_enabled = false; - private Object m_lockObject = new object(); private RemotingObject m_myRemote; private TcpChannel m_tcpChannel; private int m_tcpPort = 10101; @@ -81,10 +81,7 @@ namespace OpenSim.Region.Environment.Modules.Grid.Interregion { return m_neighbourRemote[loc].RequestInterface(); } - else - { - throw new IndexOutOfRangeException("No neighbour availible at that location"); - } + throw new IndexOutOfRangeException("No neighbour availible at that location"); } public T[] RequestInterface() @@ -108,25 +105,24 @@ namespace OpenSim.Region.Environment.Modules.Grid.Interregion return new Location(0, 0); } - #endregion + public void RegisterRemoteRegion(string uri) + { + RegisterRemotingInterface((RemotingObject) Activator.GetObject(typeof (RemotingObject), uri)); + } - //TODO: This prevents us from registering new scenes after PostInitialise if we want comms updated. + #endregion #region IRegionModule Members public void Initialise(Scene scene, IConfigSource source) { - if (m_enabled) - { - m_myLocations.Add(new Location((int) scene.RegionInfo.RegionLocX, - (int) scene.RegionInfo.RegionLocY)); - m_config = source; + m_myLocations.Add(new Location((int) scene.RegionInfo.RegionLocX, + (int) scene.RegionInfo.RegionLocY)); + m_config = source; - scene.RegisterModuleInterface(this); - } + scene.RegisterModuleInterface(this); } - //TODO: This prevents us from registering new scenes after PostInitialise if we want comms updated. public void PostInitialise() { if (m_enabled) @@ -160,11 +156,6 @@ namespace OpenSim.Region.Environment.Modules.Grid.Interregion #endregion - public void RegisterRemoteRegion(string uri) - { - RegisterRemotingInterface((RemotingObject) Activator.GetObject(typeof (RemotingObject), uri)); - } - private void RegisterRemotingInterface(RemotingObject remote) { Location[] locs = remote.GetLocations(); -- cgit v1.1