diff options
author | Adam Frisby | 2008-05-02 16:41:08 +0000 |
---|---|---|
committer | Adam Frisby | 2008-05-02 16:41:08 +0000 |
commit | 29b8c84ceaaeca80bfa9c0bfc8c31e421e39ef71 (patch) | |
tree | 848ce119d9b87bc186c20b08cc604de50a872b31 /OpenSim/Region/Environment | |
parent | * Refactored ClientView into LLClientView. Removed all direct references to U... (diff) | |
download | opensim-SC_OLD-29b8c84ceaaeca80bfa9c0bfc8c31e421e39ef71.zip opensim-SC_OLD-29b8c84ceaaeca80bfa9c0bfc8c31e421e39ef71.tar.gz opensim-SC_OLD-29b8c84ceaaeca80bfa9c0bfc8c31e421e39ef71.tar.bz2 opensim-SC_OLD-29b8c84ceaaeca80bfa9c0bfc8c31e421e39ef71.tar.xz |
* Commit 2/3 - Please dont attempt to update to this revision until all 3 are in.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Grid/Interregion/IInterregionModule.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs | 33 |
2 files changed, 13 insertions, 21 deletions
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 | |||
11 | T[] RequestInterface<T>(); | 11 | T[] RequestInterface<T>(); |
12 | Location GetLocationByDirection(Scene scene, InterregionModule.Direction dir); | 12 | Location GetLocationByDirection(Scene scene, InterregionModule.Direction dir); |
13 | void internal_CreateRemotingObjects(); | 13 | void internal_CreateRemotingObjects(); |
14 | void RegisterRemoteRegion(string uri); | ||
14 | } | 15 | } |
15 | } \ No newline at end of file | 16 | } \ 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 | |||
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(); |