diff options
author | Diva Canto | 2009-09-22 20:25:00 -0700 |
---|---|---|
committer | Diva Canto | 2009-09-22 20:25:00 -0700 |
commit | 882d2c9cc399c4c7d1809702104ce94c9c2c7b17 (patch) | |
tree | 7b79cdd31d5ac659586acc4ae15bfd6519b4565e /OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | |
parent | Moved RegionName from RegionInfo to SimpleRegionInfo. (diff) | |
download | opensim-SC_OLD-882d2c9cc399c4c7d1809702104ce94c9c2c7b17.zip opensim-SC_OLD-882d2c9cc399c4c7d1809702104ce94c9c2c7b17.tar.gz opensim-SC_OLD-882d2c9cc399c4c7d1809702104ce94c9c2c7b17.tar.bz2 opensim-SC_OLD-882d2c9cc399c4c7d1809702104ce94c9c2c7b17.tar.xz |
Added hg console commands to the module.
Added the IN connector module for link-region and corresponding handler to be used in the regions only. No service as such is needed.
This will replace the current link-region machinery. Compiles but not tested.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | 64 |
1 files changed, 61 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index 22b1015..8526653 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | |||
@@ -30,6 +30,8 @@ using System; | |||
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using Nini.Config; | 32 | using Nini.Config; |
33 | using OpenMetaverse; | ||
34 | |||
33 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
34 | using OpenSim.Services.Connectors; | 36 | using OpenSim.Services.Connectors; |
35 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
@@ -47,9 +49,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
47 | 49 | ||
48 | private bool m_Enabled = false; | 50 | private bool m_Enabled = false; |
49 | 51 | ||
52 | private IGridService m_LocalGridService; | ||
53 | |||
50 | public RemoteGridServicesConnector(IConfigSource source) | 54 | public RemoteGridServicesConnector(IConfigSource source) |
51 | { | 55 | { |
52 | InitialiseService(source); | 56 | InitialiseServices(source); |
53 | } | 57 | } |
54 | 58 | ||
55 | #region ISharedRegionmodule | 59 | #region ISharedRegionmodule |
@@ -72,14 +76,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
72 | string name = moduleConfig.GetString("GridServices", ""); | 76 | string name = moduleConfig.GetString("GridServices", ""); |
73 | if (name == Name) | 77 | if (name == Name) |
74 | { | 78 | { |
75 | InitialiseService(source); | 79 | InitialiseServices(source); |
76 | m_Enabled = true; | 80 | m_Enabled = true; |
77 | m_log.Info("[REMOTE GRID CONNECTOR]: Remote grid enabled"); | 81 | m_log.Info("[REMOTE GRID CONNECTOR]: Remote grid enabled"); |
78 | } | 82 | } |
79 | } | 83 | } |
80 | } | 84 | } |
81 | 85 | ||
82 | private void InitialiseService(IConfigSource source) | 86 | private void InitialiseServices(IConfigSource source) |
83 | { | 87 | { |
84 | IConfig gridConfig = source.Configs["GridService"]; | 88 | IConfig gridConfig = source.Configs["GridService"]; |
85 | if (gridConfig == null) | 89 | if (gridConfig == null) |
@@ -89,6 +93,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
89 | } | 93 | } |
90 | 94 | ||
91 | base.Initialise(source); | 95 | base.Initialise(source); |
96 | |||
97 | m_LocalGridService = new LocalGridServicesConnector(source); | ||
92 | } | 98 | } |
93 | 99 | ||
94 | public void PostInitialise() | 100 | public void PostInitialise() |
@@ -116,5 +122,57 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
116 | } | 122 | } |
117 | 123 | ||
118 | #endregion | 124 | #endregion |
125 | |||
126 | #region IGridService | ||
127 | |||
128 | public override bool RegisterRegion(UUID scopeID, SimpleRegionInfo regionInfo) | ||
129 | { | ||
130 | if (m_LocalGridService.RegisterRegion(scopeID, regionInfo)) | ||
131 | return base.RegisterRegion(scopeID, regionInfo); | ||
132 | |||
133 | return false; | ||
134 | } | ||
135 | |||
136 | public override bool DeregisterRegion(UUID regionID) | ||
137 | { | ||
138 | if (m_LocalGridService.DeregisterRegion(regionID)) | ||
139 | return base.DeregisterRegion(regionID); | ||
140 | |||
141 | return false; | ||
142 | } | ||
143 | |||
144 | // Let's not override GetNeighbours -- let's get them all from the grid server | ||
145 | |||
146 | public override SimpleRegionInfo GetRegionByUUID(UUID scopeID, UUID regionID) | ||
147 | { | ||
148 | SimpleRegionInfo rinfo = m_LocalGridService.GetRegionByUUID(scopeID, regionID); | ||
149 | if (rinfo == null) | ||
150 | rinfo = base.GetRegionByUUID(scopeID, regionID); | ||
151 | |||
152 | return rinfo; | ||
153 | } | ||
154 | |||
155 | public override SimpleRegionInfo GetRegionByPosition(UUID scopeID, int x, int y) | ||
156 | { | ||
157 | SimpleRegionInfo rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y); | ||
158 | if (rinfo == null) | ||
159 | rinfo = base.GetRegionByPosition(scopeID, x, y); | ||
160 | |||
161 | return rinfo; | ||
162 | } | ||
163 | |||
164 | public override SimpleRegionInfo GetRegionByName(UUID scopeID, string regionName) | ||
165 | { | ||
166 | SimpleRegionInfo rinfo = m_LocalGridService.GetRegionByName(scopeID, regionName); | ||
167 | if (rinfo == null) | ||
168 | rinfo = base.GetRegionByName(scopeID, regionName); | ||
169 | |||
170 | return rinfo; | ||
171 | } | ||
172 | |||
173 | // Let's not override GetRegionsByName -- let's get them all from the grid server | ||
174 | // Let's not override GetRegionRange -- let's get them all from the grid server | ||
175 | |||
176 | #endregion | ||
119 | } | 177 | } |
120 | } | 178 | } |