diff options
Diffstat (limited to 'OpenSim/Services/HypergridService/GatekeeperService.cs')
-rw-r--r-- | OpenSim/Services/HypergridService/GatekeeperService.cs | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 72db93f..55d9ce1 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs | |||
@@ -164,6 +164,7 @@ namespace OpenSim.Services.HypergridService | |||
164 | return region; | 164 | return region; |
165 | } | 165 | } |
166 | 166 | ||
167 | #region Login Agent | ||
167 | public bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason) | 168 | public bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason) |
168 | { | 169 | { |
169 | reason = string.Empty; | 170 | reason = string.Empty; |
@@ -221,7 +222,7 @@ namespace OpenSim.Services.HypergridService | |||
221 | return m_SimulationService.CreateAgent(destination, aCircuit, 0, out reason); | 222 | return m_SimulationService.CreateAgent(destination, aCircuit, 0, out reason); |
222 | } | 223 | } |
223 | 224 | ||
224 | protected bool Authenticate(AgentCircuitData aCircuit) | 225 | protected bool Authenticate(AgentCircuitData aCircuit) |
225 | { | 226 | { |
226 | string authURL = string.Empty; | 227 | string authURL = string.Empty; |
227 | if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) | 228 | if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) |
@@ -250,5 +251,40 @@ namespace OpenSim.Services.HypergridService | |||
250 | 251 | ||
251 | return false; | 252 | return false; |
252 | } | 253 | } |
254 | |||
255 | #endregion | ||
256 | |||
257 | public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt) | ||
258 | { | ||
259 | position = new Vector3(128, 128, 0); lookAt = Vector3.UnitY; | ||
260 | |||
261 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to get home region of user {0}", userID); | ||
262 | |||
263 | GridRegion home = null; | ||
264 | PresenceInfo[] presences = m_PresenceService.GetAgents(new string[] { userID.ToString() }); | ||
265 | if (presences != null && presences.Length > 0) | ||
266 | { | ||
267 | UUID homeID = presences[0].HomeRegionID; | ||
268 | if (homeID != UUID.Zero) | ||
269 | { | ||
270 | home = m_GridService.GetRegionByUUID(m_ScopeID, homeID); | ||
271 | position = presences[0].HomePosition; | ||
272 | lookAt = presences[0].HomeLookAt; | ||
273 | } | ||
274 | if (home == null) | ||
275 | { | ||
276 | List<GridRegion> defs = m_GridService.GetDefaultRegions(m_ScopeID); | ||
277 | if (defs != null && defs.Count > 0) | ||
278 | home = defs[0]; | ||
279 | } | ||
280 | } | ||
281 | |||
282 | return home; | ||
283 | } | ||
284 | |||
285 | #region Misc | ||
286 | |||
287 | |||
288 | #endregion | ||
253 | } | 289 | } |
254 | } | 290 | } |