aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs33
1 files changed, 12 insertions, 21 deletions
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
29 #endregion 29 #endregion
30 30
31 private readonly Dictionary<Type, Object> m_interfaces = new Dictionary<Type, object>(); 31 private readonly Dictionary<Type, Object> m_interfaces = new Dictionary<Type, object>();
32 private readonly Object m_lockObject = new object();
32 private readonly List<Location> m_myLocations = new List<Location>(); 33 private readonly List<Location> m_myLocations = new List<Location>();
33 34
34 private readonly Dictionary<Location, string[]> m_neighbourInterfaces = new Dictionary<Location, string[]>(); 35 private readonly Dictionary<Location, string[]> m_neighbourInterfaces = new Dictionary<Location, string[]>();
35 private readonly Dictionary<Location, RemotingObject> m_neighbourRemote = new Dictionary<Location, RemotingObject>(); 36 private readonly Dictionary<Location, RemotingObject> m_neighbourRemote = new Dictionary<Location, RemotingObject>();
36 private IConfigSource m_config; 37 private IConfigSource m_config;
37 private bool m_enabled = false; 38 private const bool m_enabled = false;
38 39
39 private Object m_lockObject = new object();
40 private RemotingObject m_myRemote; 40 private RemotingObject m_myRemote;
41 private TcpChannel m_tcpChannel; 41 private TcpChannel m_tcpChannel;
42 private int m_tcpPort = 10101; 42 private int m_tcpPort = 10101;
@@ -81,10 +81,7 @@ namespace OpenSim.Region.Environment.Modules.Grid.Interregion
81 { 81 {
82 return m_neighbourRemote[loc].RequestInterface<T>(); 82 return m_neighbourRemote[loc].RequestInterface<T>();
83 } 83 }
84 else 84 throw new IndexOutOfRangeException("No neighbour availible at that location");
85 {
86 throw new IndexOutOfRangeException("No neighbour availible at that location");
87 }
88 } 85 }
89 86
90 public T[] RequestInterface<T>() 87 public T[] RequestInterface<T>()
@@ -108,25 +105,24 @@ namespace OpenSim.Region.Environment.Modules.Grid.Interregion
108 return new Location(0, 0); 105 return new Location(0, 0);
109 } 106 }
110 107
111 #endregion 108 public void RegisterRemoteRegion(string uri)
109 {
110 RegisterRemotingInterface((RemotingObject) Activator.GetObject(typeof (RemotingObject), uri));
111 }
112 112
113 //TODO: This prevents us from registering new scenes after PostInitialise if we want comms updated. 113 #endregion
114 114
115 #region IRegionModule Members 115 #region IRegionModule Members
116 116
117 public void Initialise(Scene scene, IConfigSource source) 117 public void Initialise(Scene scene, IConfigSource source)
118 { 118 {
119 if (m_enabled) 119 m_myLocations.Add(new Location((int) scene.RegionInfo.RegionLocX,
120 { 120 (int) scene.RegionInfo.RegionLocY));
121 m_myLocations.Add(new Location((int) scene.RegionInfo.RegionLocX, 121 m_config = source;
122 (int) scene.RegionInfo.RegionLocY));
123 m_config = source;
124 122
125 scene.RegisterModuleInterface<IInterregionModule>(this); 123 scene.RegisterModuleInterface<IInterregionModule>(this);
126 }
127 } 124 }
128 125
129 //TODO: This prevents us from registering new scenes after PostInitialise if we want comms updated.
130 public void PostInitialise() 126 public void PostInitialise()
131 { 127 {
132 if (m_enabled) 128 if (m_enabled)
@@ -160,11 +156,6 @@ namespace OpenSim.Region.Environment.Modules.Grid.Interregion
160 156
161 #endregion 157 #endregion
162 158
163 public void RegisterRemoteRegion(string uri)
164 {
165 RegisterRemotingInterface((RemotingObject) Activator.GetObject(typeof (RemotingObject), uri));
166 }
167
168 private void RegisterRemotingInterface(RemotingObject remote) 159 private void RegisterRemotingInterface(RemotingObject remote)
169 { 160 {
170 Location[] locs = remote.GetLocations(); 161 Location[] locs = remote.GetLocations();