From be20f41637b6c06ce3ab16bc25851b6e43468e12 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Wed, 30 Apr 2008 21:43:47 +0000 Subject: * Cruft removal step #1. Cleaning Modules directory. --- .../Modules/Grid/Interregion/InterregionModule.cs | 137 +++++++++++---------- 1 file changed, 71 insertions(+), 66 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/Grid/Interregion') diff --git a/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs b/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs index 1a77ac8..8307e50 100644 --- a/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs +++ b/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs @@ -35,61 +35,14 @@ namespace OpenSim.Region.Environment.Modules.Communications.Interregion private readonly Dictionary m_neighbourInterfaces = new Dictionary(); private readonly Dictionary m_neighbourRemote = new Dictionary(); private IConfigSource m_config; - private RemotingObject m_myRemote; + private bool m_enabled = false; private Object m_lockObject = new object(); + private RemotingObject m_myRemote; private TcpChannel m_tcpChannel; private int m_tcpPort = 10101; - private bool m_enabled = false; - - #region IRegionModule Members - - //TODO: This prevents us from registering new scenes after PostInitialise if we want comms updated. - 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; - - scene.RegisterModuleInterface(this); - } - } - - //TODO: This prevents us from registering new scenes after PostInitialise if we want comms updated. - public void PostInitialise() - { - if (m_enabled) - { - try - { - m_tcpPort = m_config.Configs["Comms"].GetInt("remoting_port", m_tcpPort); - } - catch - { - } - - internal_CreateRemotingObjects(); - } - } - - public void Close() - { - ChannelServices.UnregisterChannel(m_tcpChannel); - } - - public string Name - { - get { return "InterregionModule"; } - } - - public bool IsSharedModule - { - get { return true; } - } - #endregion + #region IInterregionModule Members public void internal_CreateRemotingObjects() { @@ -106,22 +59,6 @@ namespace OpenSim.Region.Environment.Modules.Communications.Interregion } } - public void RegisterRemoteRegion(string uri) - { - RegisterRemotingInterface((RemotingObject) Activator.GetObject(typeof (RemotingObject), uri)); - } - - private void RegisterRemotingInterface(RemotingObject remote) - { - Location[] locs = remote.GetLocations(); - string[] interfaces = remote.GetInterfaces(); - foreach (Location loc in locs) - { - m_neighbourInterfaces[loc] = interfaces; - m_neighbourRemote[loc] = remote; - } - } - public void RegisterMethod(T e) { m_interfaces[typeof (T)] = e; @@ -171,5 +108,73 @@ namespace OpenSim.Region.Environment.Modules.Communications.Interregion { return new Location(0, 0); } + + #endregion + + //TODO: This prevents us from registering new scenes after PostInitialise if we want comms updated. + + #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; + + scene.RegisterModuleInterface(this); + } + } + + //TODO: This prevents us from registering new scenes after PostInitialise if we want comms updated. + public void PostInitialise() + { + if (m_enabled) + { + try + { + m_tcpPort = m_config.Configs["Comms"].GetInt("remoting_port", m_tcpPort); + } + catch + { + } + + internal_CreateRemotingObjects(); + } + } + + public void Close() + { + ChannelServices.UnregisterChannel(m_tcpChannel); + } + + public string Name + { + get { return "InterregionModule"; } + } + + public bool IsSharedModule + { + get { return true; } + } + + #endregion + + public void RegisterRemoteRegion(string uri) + { + RegisterRemotingInterface((RemotingObject) Activator.GetObject(typeof (RemotingObject), uri)); + } + + private void RegisterRemotingInterface(RemotingObject remote) + { + Location[] locs = remote.GetLocations(); + string[] interfaces = remote.GetInterfaces(); + foreach (Location loc in locs) + { + m_neighbourInterfaces[loc] = interfaces; + m_neighbourRemote[loc] = remote; + } + } } } \ No newline at end of file -- cgit v1.1