aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/HypergridService
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs34
-rw-r--r--OpenSim/Services/HypergridService/HypergridService.cs8
2 files changed, 38 insertions, 4 deletions
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index ec7ef1d..a5bd881 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -112,6 +112,10 @@ namespace OpenSim.Services.HypergridService
112 m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to link to {0}", regionName); 112 m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to link to {0}", regionName);
113 if (!m_AllowTeleportsToAnyRegion) 113 if (!m_AllowTeleportsToAnyRegion)
114 { 114 {
115 List<GridRegion> defs = m_GridService.GetDefaultRegions(m_ScopeID);
116 if (defs != null && defs.Count > 0)
117 m_DefaultGatewayRegion = defs[0];
118
115 try 119 try
116 { 120 {
117 regionID = m_DefaultGatewayRegion.RegionID; 121 regionID = m_DefaultGatewayRegion.RegionID;
@@ -150,6 +154,8 @@ namespace OpenSim.Services.HypergridService
150 154
151 public GridRegion GetHyperlinkRegion(UUID regionID) 155 public GridRegion GetHyperlinkRegion(UUID regionID)
152 { 156 {
157 m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to get hyperlink region {0}", regionID);
158
153 if (!m_AllowTeleportsToAnyRegion) 159 if (!m_AllowTeleportsToAnyRegion)
154 // Don't even check the given regionID 160 // Don't even check the given regionID
155 return m_DefaultGatewayRegion; 161 return m_DefaultGatewayRegion;
@@ -160,23 +166,43 @@ namespace OpenSim.Services.HypergridService
160 166
161 public bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination) 167 public bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination)
162 { 168 {
169 string authURL = string.Empty;
170 if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
171 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 aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName);
175
163 if (!Authenticate(aCircuit)) 176 if (!Authenticate(aCircuit))
177 {
178 m_log.InfoFormat("[GATEKEEPER SERVICE]: Unable to verify identity of agent {0} {1}. Refusing service.", aCircuit.firstname, aCircuit.lastname);
164 return false; 179 return false;
180 }
165 181
166 // Check to see if we have a local user with that UUID 182 // Check to see if we have a local user with that UUID
167 UserAccount account = m_UserAccountService.GetUserAccount(m_ScopeID, aCircuit.AgentID); 183 UserAccount account = m_UserAccountService.GetUserAccount(m_ScopeID, aCircuit.AgentID);
168 if (account != null) 184 if (account != null)
185 {
169 // No, sorry; go away 186 // No, sorry; go away
187 m_log.InfoFormat("[GATEKEEPER SERVICE]: Foreign agent {0} {1} has UUID of local user {3}. Refusing service.",
188 aCircuit.firstname, aCircuit.lastname, aCircuit.AgentID);
170 return false; 189 return false;
190 }
171 191
172 // May want to authorize 192 // May want to authorize
173 193
174 // Login the presence 194 // Login the presence
175 if (!m_PresenceService.LoginAgent(aCircuit.AgentID.ToString(), aCircuit.SessionID, aCircuit.SecureSessionID)) 195 if (!m_PresenceService.LoginAgent(aCircuit.AgentID.ToString(), aCircuit.SessionID, aCircuit.SecureSessionID))
196 {
197 m_log.InfoFormat("[GATEKEEPER SERVICE]: Presence login failed for foreign agent {0} {1}. Refusing service.",
198 aCircuit.firstname, aCircuit.lastname);
176 return false; 199 return false;
200 }
177 201
178 // Finally launch the agent at the destination 202 // Finally launch the agent at the destination
179 string reason = string.Empty; 203 string reason = string.Empty;
204 aCircuit.firstname = aCircuit.firstname + "." + aCircuit.lastname;
205 aCircuit.lastname = "@" + aCircuit.ServiceURLs["HomeURI"].ToString();
180 return m_SimulationService.CreateAgent(destination, aCircuit, 0, out reason); 206 return m_SimulationService.CreateAgent(destination, aCircuit, 0, out reason);
181 } 207 }
182 208
@@ -188,9 +214,15 @@ namespace OpenSim.Services.HypergridService
188 214
189 protected bool Authenticate(AgentCircuitData aCircuit) 215 protected bool Authenticate(AgentCircuitData aCircuit)
190 { 216 {
191 string authURL = string.Empty; // GetAuthURL(aCircuit); 217 string authURL = string.Empty;
218 if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
219 authURL = aCircuit.ServiceURLs["HomeURI"].ToString();
220
192 if (authURL == string.Empty) 221 if (authURL == string.Empty)
222 {
223 m_log.DebugFormat("[GATEKEEPER SERVICE]: Agent did not provide an authentication server URL");
193 return false; 224 return false;
225 }
194 226
195 Object[] args = new Object[] { authURL }; 227 Object[] args = new Object[] { authURL };
196 IAuthenticationService authService = ServerUtils.LoadPlugin<IAuthenticationService>(m_AuthDll, args); 228 IAuthenticationService authService = ServerUtils.LoadPlugin<IAuthenticationService>(m_AuthDll, args);
diff --git a/OpenSim/Services/HypergridService/HypergridService.cs b/OpenSim/Services/HypergridService/HypergridService.cs
index 747b98a..734931d 100644
--- a/OpenSim/Services/HypergridService/HypergridService.cs
+++ b/OpenSim/Services/HypergridService/HypergridService.cs
@@ -347,10 +347,12 @@ namespace OpenSim.Services.HypergridService
347 347
348 #region Get Hyperlinks 348 #region Get Hyperlinks
349 349
350 public GridRegion GetHyperlinkRegion(UUID regionID) 350 public GridRegion GetHyperlinkRegion(GridRegion gatekeeper, UUID regionID)
351 { 351 {
352 //GridRegion region = m_HypergridConnector. 352 if (m_HyperlinkRegions.ContainsKey(regionID))
353 return null; 353 return m_HypergridConnector.GetHyperlinkRegion(gatekeeper, regionID);
354 else
355 return gatekeeper;
354 } 356 }
355 357
356 #endregion 358 #endregion