aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/HypergridService
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/HypergridService')
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs38
-rw-r--r--OpenSim/Services/HypergridService/HypergridService.cs8
2 files changed, 41 insertions, 5 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}
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
51 private static HypergridService m_RootInstance = null; 51 private static HypergridService m_RootInstance = null;
52 protected IConfigSource m_config; 52 protected IConfigSource m_config;
53 53
54 protected IAuthenticationService m_AuthenticationService = null; 54 protected IPresenceService m_PresenceService = null;
55 protected IGridService m_GridService; 55 protected IGridService m_GridService;
56 protected IAssetService m_AssetService; 56 protected IAssetService m_AssetService;
57 protected HypergridServiceConnector m_HypergridConnector; 57 protected HypergridServiceConnector m_HypergridConnector;
@@ -94,7 +94,7 @@ namespace OpenSim.Services.HypergridService
94 if (gridConfig != null) 94 if (gridConfig != null)
95 { 95 {
96 string gridService = gridConfig.GetString("GridService", string.Empty); 96 string gridService = gridConfig.GetString("GridService", string.Empty);
97 string authService = gridConfig.GetString("AuthenticationService", String.Empty); 97 string presenceService = gridConfig.GetString("PresenceService", String.Empty);
98 string assetService = gridConfig.GetString("AssetService", string.Empty); 98 string assetService = gridConfig.GetString("AssetService", string.Empty);
99 99
100 Object[] args = new Object[] { config }; 100 Object[] args = new Object[] { config };
@@ -104,8 +104,8 @@ namespace OpenSim.Services.HypergridService
104 if (m_GridService == null) 104 if (m_GridService == null)
105 throw new Exception("HypergridService cannot function without a GridService"); 105 throw new Exception("HypergridService cannot function without a GridService");
106 106
107 if (authService != String.Empty) 107 if (presenceService != String.Empty)
108 m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args); 108 m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args);
109 109
110 if (assetService != string.Empty) 110 if (assetService != string.Empty)
111 m_AssetService = ServerUtils.LoadPlugin<IAssetService>(assetService, args); 111 m_AssetService = ServerUtils.LoadPlugin<IAssetService>(assetService, args);