diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Grid/Interregion/RemotingObject.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Grid/Interregion/RemotingObject.cs | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/OpenSim/Region/Environment/Modules/Grid/Interregion/RemotingObject.cs b/OpenSim/Region/Environment/Modules/Grid/Interregion/RemotingObject.cs index 2c72bb9..453a2b7 100644 --- a/OpenSim/Region/Environment/Modules/Grid/Interregion/RemotingObject.cs +++ b/OpenSim/Region/Environment/Modules/Grid/Interregion/RemotingObject.cs | |||
@@ -1,50 +1,50 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using OpenSim.Framework; | 3 | using OpenSim.Framework; |
4 | 4 | ||
5 | namespace OpenSim.Region.Environment.Modules.Grid.Interregion | 5 | namespace OpenSim.Region.Environment.Modules.Grid.Interregion |
6 | { | 6 | { |
7 | public class RemotingObject : MarshalByRefObject | 7 | public class RemotingObject : MarshalByRefObject |
8 | { | 8 | { |
9 | private readonly Location[] m_coords; | 9 | private readonly Location[] m_coords; |
10 | private readonly Dictionary<Type, Object> m_interfaces = new Dictionary<Type, object>(); | 10 | private readonly Dictionary<Type, Object> m_interfaces = new Dictionary<Type, object>(); |
11 | 11 | ||
12 | public RemotingObject(Dictionary<Type, Object> myInterfaces, Location[] coords) | 12 | public RemotingObject(Dictionary<Type, Object> myInterfaces, Location[] coords) |
13 | { | 13 | { |
14 | m_interfaces = myInterfaces; | 14 | m_interfaces = myInterfaces; |
15 | m_coords = coords; | 15 | m_coords = coords; |
16 | } | 16 | } |
17 | 17 | ||
18 | public Location[] GetLocations() | 18 | public Location[] GetLocations() |
19 | { | 19 | { |
20 | return (Location[]) m_coords.Clone(); | 20 | return (Location[]) m_coords.Clone(); |
21 | } | 21 | } |
22 | 22 | ||
23 | public string[] GetInterfaces() | 23 | public string[] GetInterfaces() |
24 | { | 24 | { |
25 | string[] interfaces = new string[m_interfaces.Count]; | 25 | string[] interfaces = new string[m_interfaces.Count]; |
26 | int i = 0; | 26 | int i = 0; |
27 | 27 | ||
28 | foreach (KeyValuePair<Type, object> pair in m_interfaces) | 28 | foreach (KeyValuePair<Type, object> pair in m_interfaces) |
29 | { | 29 | { |
30 | interfaces[i++] = pair.Key.FullName; | 30 | interfaces[i++] = pair.Key.FullName; |
31 | } | 31 | } |
32 | 32 | ||
33 | return interfaces; | 33 | return interfaces; |
34 | } | 34 | } |
35 | 35 | ||
36 | /// <summary> | 36 | /// <summary> |
37 | /// Returns a registered interface availible to neighbouring regions. | 37 | /// Returns a registered interface availible to neighbouring regions. |
38 | /// </summary> | 38 | /// </summary> |
39 | /// <typeparam name="T">The type of interface you wish to request</typeparam> | 39 | /// <typeparam name="T">The type of interface you wish to request</typeparam> |
40 | /// <returns>A MarshalByRefObject inherited from this region inheriting the interface requested.</returns> | 40 | /// <returns>A MarshalByRefObject inherited from this region inheriting the interface requested.</returns> |
41 | /// <remarks>All registered interfaces <b>MUST</b> inherit from MarshalByRefObject and use only serialisable types.</remarks> | 41 | /// <remarks>All registered interfaces <b>MUST</b> inherit from MarshalByRefObject and use only serialisable types.</remarks> |
42 | public T RequestInterface<T>() | 42 | public T RequestInterface<T>() |
43 | { | 43 | { |
44 | if (m_interfaces.ContainsKey(typeof (T))) | 44 | if (m_interfaces.ContainsKey(typeof (T))) |
45 | return (T) m_interfaces[typeof (T)]; | 45 | return (T) m_interfaces[typeof (T)]; |
46 | 46 | ||
47 | throw new NotSupportedException("No such interface registered."); | 47 | throw new NotSupportedException("No such interface registered."); |
48 | } | 48 | } |
49 | } | 49 | } |
50 | } \ No newline at end of file | 50 | } \ No newline at end of file |