* Added missing GatekeeperServiceConnector

* Added basic machinery for teleporting users home. Untested.
This commit is contained in:
Diva Canto
2010-01-18 10:37:11 -08:00
parent bbbe9e73cc
commit fd64823466
8 changed files with 477 additions and 228 deletions

View File

@@ -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<GridRegion> defs = m_GridService.GetDefaultRegions(m_ScopeID);
if (defs != null && defs.Count > 0)
home = defs[0];
}
}
return home;
}
#region Misc
#endregion
}
}

View File

@@ -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<IAuthenticationService>(authService, args);
if (presenceService != String.Empty)
m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args);
if (assetService != string.Empty)
m_AssetService = ServerUtils.LoadPlugin<IAssetService>(assetService, args);