From fd64823466ee667d0d827f95d3001ec8675512b2 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 18 Jan 2010 10:37:11 -0800 Subject: * Added missing GatekeeperServiceConnector * Added basic machinery for teleporting users home. Untested. --- .../Services/HypergridService/GatekeeperService.cs | 38 +++++++++++++++++++++- .../Services/HypergridService/HypergridService.cs | 8 ++--- 2 files changed, 41 insertions(+), 5 deletions(-) (limited to 'OpenSim/Services/HypergridService') 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 return region; } + #region Login Agent public bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason) { reason = string.Empty; @@ -221,7 +222,7 @@ namespace OpenSim.Services.HypergridService return m_SimulationService.CreateAgent(destination, aCircuit, 0, out reason); } - protected bool Authenticate(AgentCircuitData aCircuit) + protected bool Authenticate(AgentCircuitData aCircuit) { string authURL = string.Empty; if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) @@ -250,5 +251,40 @@ namespace OpenSim.Services.HypergridService return false; } + + #endregion + + public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt) + { + position = new Vector3(128, 128, 0); lookAt = Vector3.UnitY; + + m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to get home region of user {0}", userID); + + GridRegion home = null; + PresenceInfo[] presences = m_PresenceService.GetAgents(new string[] { userID.ToString() }); + if (presences != null && presences.Length > 0) + { + UUID homeID = presences[0].HomeRegionID; + if (homeID != UUID.Zero) + { + home = m_GridService.GetRegionByUUID(m_ScopeID, homeID); + position = presences[0].HomePosition; + lookAt = presences[0].HomeLookAt; + } + if (home == null) + { + List defs = m_GridService.GetDefaultRegions(m_ScopeID); + if (defs != null && defs.Count > 0) + home = defs[0]; + } + } + + return home; + } + + #region Misc + + + #endregion } } diff --git a/OpenSim/Services/HypergridService/HypergridService.cs b/OpenSim/Services/HypergridService/HypergridService.cs index 734931d..ac0f5ac 100644 --- a/OpenSim/Services/HypergridService/HypergridService.cs +++ b/OpenSim/Services/HypergridService/HypergridService.cs @@ -51,7 +51,7 @@ namespace OpenSim.Services.HypergridService private static HypergridService m_RootInstance = null; protected IConfigSource m_config; - protected IAuthenticationService m_AuthenticationService = null; + protected IPresenceService m_PresenceService = null; protected IGridService m_GridService; protected IAssetService m_AssetService; protected HypergridServiceConnector m_HypergridConnector; @@ -94,7 +94,7 @@ namespace OpenSim.Services.HypergridService if (gridConfig != null) { string gridService = gridConfig.GetString("GridService", string.Empty); - string authService = gridConfig.GetString("AuthenticationService", String.Empty); + string presenceService = gridConfig.GetString("PresenceService", String.Empty); string assetService = gridConfig.GetString("AssetService", string.Empty); Object[] args = new Object[] { config }; @@ -104,8 +104,8 @@ namespace OpenSim.Services.HypergridService if (m_GridService == null) throw new Exception("HypergridService cannot function without a GridService"); - if (authService != String.Empty) - m_AuthenticationService = ServerUtils.LoadPlugin(authService, args); + if (presenceService != String.Empty) + m_PresenceService = ServerUtils.LoadPlugin(presenceService, args); if (assetService != string.Empty) m_AssetService = ServerUtils.LoadPlugin(assetService, args); -- cgit v1.1