diff options
author | Diva Canto | 2010-01-17 18:04:55 -0800 |
---|---|---|
committer | Diva Canto | 2010-01-17 18:04:55 -0800 |
commit | b2e6ec9e12ad07eb08496ebe8ca0476b793017d5 (patch) | |
tree | ac72f03b9cfca6f344d697f6d7581e5147ccf450 /OpenSim/Services | |
parent | Oops, forgot this one. (diff) | |
download | opensim-SC-b2e6ec9e12ad07eb08496ebe8ca0476b793017d5.zip opensim-SC-b2e6ec9e12ad07eb08496ebe8ca0476b793017d5.tar.gz opensim-SC-b2e6ec9e12ad07eb08496ebe8ca0476b793017d5.tar.bz2 opensim-SC-b2e6ec9e12ad07eb08496ebe8ca0476b793017d5.tar.xz |
Agent gets there through the Gatekeeper, but still a few quirks to fix.
Diffstat (limited to 'OpenSim/Services')
4 files changed, 87 insertions, 12 deletions
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index b1b2a30..683fe79 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | |||
@@ -65,6 +65,11 @@ namespace OpenSim.Services.Connectors.Simulation | |||
65 | 65 | ||
66 | #region Agents | 66 | #region Agents |
67 | 67 | ||
68 | protected virtual string AgentPath() | ||
69 | { | ||
70 | return "/agent/"; | ||
71 | } | ||
72 | |||
68 | public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason) | 73 | public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason) |
69 | { | 74 | { |
70 | reason = String.Empty; | 75 | reason = String.Empty; |
@@ -80,7 +85,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
80 | string uri = string.Empty; | 85 | string uri = string.Empty; |
81 | try | 86 | try |
82 | { | 87 | { |
83 | uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + "/agent/" + aCircuit.AgentID + "/"; | 88 | uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/"; |
84 | } | 89 | } |
85 | catch (Exception e) | 90 | catch (Exception e) |
86 | { | 91 | { |
@@ -197,7 +202,8 @@ namespace OpenSim.Services.Connectors.Simulation | |||
197 | catch (WebException ex) | 202 | catch (WebException ex) |
198 | { | 203 | { |
199 | m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", ex.Message); | 204 | m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", ex.Message); |
200 | // ignore, really | 205 | reason = "Destination did not reply"; |
206 | return false; | ||
201 | } | 207 | } |
202 | finally | 208 | finally |
203 | { | 209 | { |
@@ -224,7 +230,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
224 | string uri = string.Empty; | 230 | string uri = string.Empty; |
225 | try | 231 | try |
226 | { | 232 | { |
227 | uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + "/agent/" + cAgentData.AgentID + "/"; | 233 | uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + cAgentData.AgentID + "/"; |
228 | } | 234 | } |
229 | catch (Exception e) | 235 | catch (Exception e) |
230 | { | 236 | { |
@@ -329,7 +335,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
329 | { | 335 | { |
330 | agent = null; | 336 | agent = null; |
331 | // Eventually, we want to use a caps url instead of the agentID | 337 | // Eventually, we want to use a caps url instead of the agentID |
332 | string uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + "/agent/" + id + "/" + destination.RegionID.ToString() + "/"; | 338 | string uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; |
333 | //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri); | 339 | //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri); |
334 | 340 | ||
335 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); | 341 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); |
@@ -426,7 +432,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
426 | string uri = string.Empty; | 432 | string uri = string.Empty; |
427 | try | 433 | try |
428 | { | 434 | { |
429 | uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + "/agent/" + id + "/" + destination.RegionID.ToString() + "/"; | 435 | uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; |
430 | } | 436 | } |
431 | catch (Exception e) | 437 | catch (Exception e) |
432 | { | 438 | { |
@@ -474,10 +480,15 @@ namespace OpenSim.Services.Connectors.Simulation | |||
474 | 480 | ||
475 | #region Objects | 481 | #region Objects |
476 | 482 | ||
483 | protected virtual string ObjectPath() | ||
484 | { | ||
485 | return "/object/"; | ||
486 | } | ||
487 | |||
477 | public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) | 488 | public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) |
478 | { | 489 | { |
479 | string uri | 490 | string uri |
480 | = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + "/object/" + sog.UUID + "/"; | 491 | = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/"; |
481 | //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri); | 492 | //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri); |
482 | 493 | ||
483 | WebRequest ObjectCreateRequest = WebRequest.Create(uri); | 494 | WebRequest ObjectCreateRequest = WebRequest.Create(uri); |
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index a5bd881..416e443 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs | |||
@@ -164,57 +164,103 @@ namespace OpenSim.Services.HypergridService | |||
164 | return region; | 164 | return region; |
165 | } | 165 | } |
166 | 166 | ||
167 | public bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination) | 167 | public bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason) |
168 | { | 168 | { |
169 | reason = string.Empty; | ||
170 | |||
169 | string authURL = string.Empty; | 171 | string authURL = string.Empty; |
170 | if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) | 172 | if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) |
171 | authURL = aCircuit.ServiceURLs["HomeURI"].ToString(); | 173 | authURL = aCircuit.ServiceURLs["HomeURI"].ToString(); |
172 | |||
173 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to login foreign agent {0} {1} @ {2} ({3}) at destination {4}", | 174 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to login foreign agent {0} {1} @ {2} ({3}) at destination {4}", |
174 | aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName); | 175 | aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName); |
175 | 176 | ||
176 | if (!Authenticate(aCircuit)) | 177 | if (!Authenticate(aCircuit)) |
177 | { | 178 | { |
179 | reason = "Unable to verify identity"; | ||
178 | m_log.InfoFormat("[GATEKEEPER SERVICE]: Unable to verify identity of agent {0} {1}. Refusing service.", aCircuit.firstname, aCircuit.lastname); | 180 | m_log.InfoFormat("[GATEKEEPER SERVICE]: Unable to verify identity of agent {0} {1}. Refusing service.", aCircuit.firstname, aCircuit.lastname); |
179 | return false; | 181 | return false; |
180 | } | 182 | } |
183 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Identity verified for {0} {1} @ {2}", aCircuit.firstname, aCircuit.lastname, authURL); | ||
181 | 184 | ||
182 | // Check to see if we have a local user with that UUID | 185 | // Check to see if we have a local user with that UUID |
183 | UserAccount account = m_UserAccountService.GetUserAccount(m_ScopeID, aCircuit.AgentID); | 186 | UserAccount account = m_UserAccountService.GetUserAccount(m_ScopeID, aCircuit.AgentID); |
184 | if (account != null) | 187 | if (account != null) |
185 | { | 188 | { |
186 | // No, sorry; go away | 189 | // No, sorry; go away |
190 | reason = "User identifier not allowed on this grid"; | ||
187 | m_log.InfoFormat("[GATEKEEPER SERVICE]: Foreign agent {0} {1} has UUID of local user {3}. Refusing service.", | 191 | m_log.InfoFormat("[GATEKEEPER SERVICE]: Foreign agent {0} {1} has UUID of local user {3}. Refusing service.", |
188 | aCircuit.firstname, aCircuit.lastname, aCircuit.AgentID); | 192 | aCircuit.firstname, aCircuit.lastname, aCircuit.AgentID); |
189 | return false; | 193 | return false; |
190 | } | 194 | } |
195 | m_log.DebugFormat("[GATEKEEPER SERVICE]: User ID ok"); | ||
191 | 196 | ||
192 | // May want to authorize | 197 | // May want to authorize |
193 | 198 | ||
194 | // Login the presence | 199 | // Login the presence |
195 | if (!m_PresenceService.LoginAgent(aCircuit.AgentID.ToString(), aCircuit.SessionID, aCircuit.SecureSessionID)) | 200 | if (!m_PresenceService.LoginAgent(aCircuit.AgentID.ToString(), aCircuit.SessionID, aCircuit.SecureSessionID)) |
196 | { | 201 | { |
202 | reason = "Unable to login presence"; | ||
197 | m_log.InfoFormat("[GATEKEEPER SERVICE]: Presence login failed for foreign agent {0} {1}. Refusing service.", | 203 | m_log.InfoFormat("[GATEKEEPER SERVICE]: Presence login failed for foreign agent {0} {1}. Refusing service.", |
198 | aCircuit.firstname, aCircuit.lastname); | 204 | aCircuit.firstname, aCircuit.lastname); |
199 | return false; | 205 | return false; |
200 | } | 206 | } |
207 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence ok"); | ||
208 | |||
209 | // Get the region | ||
210 | destination = m_GridService.GetRegionByUUID(m_ScopeID, destination.RegionID); | ||
211 | if (destination == null) | ||
212 | { | ||
213 | reason = "Destination region not found"; | ||
214 | return false; | ||
215 | } | ||
216 | m_log.DebugFormat("[GATEKEEPER SERVICE]: destination ok : {0}", destination.RegionName); | ||
201 | 217 | ||
202 | // Finally launch the agent at the destination | 218 | // Finally launch the agent at the destination |
203 | string reason = string.Empty; | ||
204 | aCircuit.firstname = aCircuit.firstname + "." + aCircuit.lastname; | 219 | aCircuit.firstname = aCircuit.firstname + "." + aCircuit.lastname; |
205 | aCircuit.lastname = "@" + aCircuit.ServiceURLs["HomeURI"].ToString(); | 220 | aCircuit.lastname = "@" + aCircuit.ServiceURLs["HomeURI"].ToString(); |
206 | return m_SimulationService.CreateAgent(destination, aCircuit, 0, out reason); | 221 | return m_SimulationService.CreateAgent(destination, aCircuit, 0, out reason); |
207 | } | 222 | } |
208 | 223 | ||
209 | public bool LoginAttachments(ISceneObject sog, GridRegion destination) | 224 | public bool UpdateAgent(GridRegion destination, AgentData agent) |
225 | { | ||
226 | // Get the region | ||
227 | destination = m_GridService.GetRegionByUUID(m_ScopeID, destination.RegionID); | ||
228 | if (destination == null) | ||
229 | { | ||
230 | return false; | ||
231 | } | ||
232 | |||
233 | return m_SimulationService.UpdateAgent(destination, agent); | ||
234 | } | ||
235 | |||
236 | public bool LoginAttachment(GridRegion destination, ISceneObject sog) | ||
210 | { | 237 | { |
238 | // Get the region | ||
239 | destination = m_GridService.GetRegionByUUID(m_ScopeID, destination.RegionID); | ||
240 | if (destination == null) | ||
241 | { | ||
242 | return false; | ||
243 | } | ||
244 | |||
211 | // May want to filter attachments | 245 | // May want to filter attachments |
212 | return m_SimulationService.CreateObject(destination, sog, false); | 246 | return m_SimulationService.CreateObject(destination, sog, false); |
213 | } | 247 | } |
214 | 248 | ||
249 | public void ReleaseAgent(UUID regionID, UUID agentID) | ||
250 | { | ||
251 | GridRegion region = m_GridService.GetRegionByUUID(m_ScopeID, regionID); | ||
252 | if (region != null) | ||
253 | { | ||
254 | string uri = "http://" + region.ExternalHostName + ":" + region.HttpPort + | ||
255 | "/agent/" + agentID.ToString() + "/" + regionID.ToString() + "/release/"; | ||
256 | |||
257 | m_SimulationService.ReleaseAgent(regionID, agentID, uri); | ||
258 | } | ||
259 | } | ||
260 | |||
215 | protected bool Authenticate(AgentCircuitData aCircuit) | 261 | protected bool Authenticate(AgentCircuitData aCircuit) |
216 | { | 262 | { |
217 | string authURL = string.Empty; | 263 | string authURL = string.Empty; |
218 | if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) | 264 | if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) |
219 | authURL = aCircuit.ServiceURLs["HomeURI"].ToString(); | 265 | authURL = aCircuit.ServiceURLs["HomeURI"].ToString(); |
220 | 266 | ||
@@ -227,7 +273,17 @@ namespace OpenSim.Services.HypergridService | |||
227 | Object[] args = new Object[] { authURL }; | 273 | Object[] args = new Object[] { authURL }; |
228 | IAuthenticationService authService = ServerUtils.LoadPlugin<IAuthenticationService>(m_AuthDll, args); | 274 | IAuthenticationService authService = ServerUtils.LoadPlugin<IAuthenticationService>(m_AuthDll, args); |
229 | if (authService != null) | 275 | if (authService != null) |
230 | return authService.Verify(aCircuit.AgentID, aCircuit.SecureSessionID.ToString(), 30); | 276 | { |
277 | try | ||
278 | { | ||
279 | return authService.Verify(aCircuit.AgentID, aCircuit.SecureSessionID.ToString(), 30); | ||
280 | } | ||
281 | catch | ||
282 | { | ||
283 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", authURL); | ||
284 | return false; | ||
285 | } | ||
286 | } | ||
231 | 287 | ||
232 | return false; | 288 | return false; |
233 | } | 289 | } |
diff --git a/OpenSim/Services/Interfaces/IGatekeeperService.cs b/OpenSim/Services/Interfaces/IGatekeeperService.cs index 9904e20..5e21804 100644 --- a/OpenSim/Services/Interfaces/IGatekeeperService.cs +++ b/OpenSim/Services/Interfaces/IGatekeeperService.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | 30 | ||
31 | using OpenSim.Framework; | ||
31 | using OpenMetaverse; | 32 | using OpenMetaverse; |
32 | 33 | ||
33 | namespace OpenSim.Services.Interfaces | 34 | namespace OpenSim.Services.Interfaces |
@@ -36,5 +37,11 @@ namespace OpenSim.Services.Interfaces | |||
36 | { | 37 | { |
37 | bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string imageURL, out string reason); | 38 | bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string imageURL, out string reason); |
38 | GridRegion GetHyperlinkRegion(UUID regionID); | 39 | GridRegion GetHyperlinkRegion(UUID regionID); |
40 | |||
41 | bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason); | ||
42 | bool UpdateAgent(GridRegion destination, AgentData agent); | ||
43 | void ReleaseAgent(UUID regionID, UUID agentID); | ||
44 | |||
45 | bool LoginAttachment(GridRegion destination, ISceneObject sog); | ||
39 | } | 46 | } |
40 | } | 47 | } |
diff --git a/OpenSim/Services/Interfaces/IHypergridService.cs b/OpenSim/Services/Interfaces/IHypergridService.cs index f2a1983..dd3c053 100644 --- a/OpenSim/Services/Interfaces/IHypergridService.cs +++ b/OpenSim/Services/Interfaces/IHypergridService.cs | |||
@@ -44,4 +44,5 @@ namespace OpenSim.Services.Interfaces | |||
44 | List<GridRegion> GetRegionsByName(string name); | 44 | List<GridRegion> GetRegionsByName(string name); |
45 | List<GridRegion> GetRegionRange(int xmin, int xmax, int ymin, int ymax); | 45 | List<GridRegion> GetRegionRange(int xmin, int xmax, int ymin, int ymax); |
46 | } | 46 | } |
47 | |||
47 | } | 48 | } |