aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/HypergridService/GatekeeperService.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs43
1 files changed, 35 insertions, 8 deletions
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 97a0afc..f6136b5 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -58,6 +58,7 @@ namespace OpenSim.Services.HypergridService
58 private static IUserAgentService m_UserAgentService; 58 private static IUserAgentService m_UserAgentService;
59 private static ISimulationService m_SimulationService; 59 private static ISimulationService m_SimulationService;
60 private static IGridUserService m_GridUserService; 60 private static IGridUserService m_GridUserService;
61 private static IBansService m_BansService;
61 62
62 private static string m_AllowedClients = string.Empty; 63 private static string m_AllowedClients = string.Empty;
63 private static string m_DeniedClients = string.Empty; 64 private static string m_DeniedClients = string.Empty;
@@ -87,6 +88,7 @@ namespace OpenSim.Services.HypergridService
87 string presenceService = serverConfig.GetString("PresenceService", String.Empty); 88 string presenceService = serverConfig.GetString("PresenceService", String.Empty);
88 string simulationService = serverConfig.GetString("SimulationService", String.Empty); 89 string simulationService = serverConfig.GetString("SimulationService", String.Empty);
89 string gridUserService = serverConfig.GetString("GridUserService", String.Empty); 90 string gridUserService = serverConfig.GetString("GridUserService", String.Empty);
91 string bansService = serverConfig.GetString("BansService", String.Empty);
90 92
91 // These are mandatory, the others aren't 93 // These are mandatory, the others aren't
92 if (gridService == string.Empty || presenceService == string.Empty) 94 if (gridService == string.Empty || presenceService == string.Empty)
@@ -121,6 +123,8 @@ namespace OpenSim.Services.HypergridService
121 m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(homeUsersService, args); 123 m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(homeUsersService, args);
122 if (gridUserService != string.Empty) 124 if (gridUserService != string.Empty)
123 m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); 125 m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args);
126 if (bansService != string.Empty)
127 m_BansService = ServerUtils.LoadPlugin<IBansService>(bansService, args);
124 128
125 if (simService != null) 129 if (simService != null)
126 m_SimulationService = simService; 130 m_SimulationService = simService;
@@ -167,7 +171,7 @@ namespace OpenSim.Services.HypergridService
167 m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to link to {0}", (regionName == string.Empty)? "default region" : regionName); 171 m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to link to {0}", (regionName == string.Empty)? "default region" : regionName);
168 if (!m_AllowTeleportsToAnyRegion || regionName == string.Empty) 172 if (!m_AllowTeleportsToAnyRegion || regionName == string.Empty)
169 { 173 {
170 List<GridRegion> defs = m_GridService.GetDefaultRegions(m_ScopeID); 174 List<GridRegion> defs = m_GridService.GetDefaultHypergridRegions(m_ScopeID);
171 if (defs != null && defs.Count > 0) 175 if (defs != null && defs.Count > 0)
172 { 176 {
173 region = defs[0]; 177 region = defs[0];
@@ -223,7 +227,7 @@ namespace OpenSim.Services.HypergridService
223 m_log.InfoFormat("[GATEKEEPER SERVICE]: Login request for {0} {1} @ {2} ({3}) at {4} using viewer {5}, channel {6}, IP {7}, Mac {8}, Id0 {9} Teleport Flags {10}", 227 m_log.InfoFormat("[GATEKEEPER SERVICE]: Login request for {0} {1} @ {2} ({3}) at {4} using viewer {5}, channel {6}, IP {7}, Mac {8}, Id0 {9} Teleport Flags {10}",
224 aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName, 228 aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName,
225 aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0, aCircuit.teleportFlags.ToString()); 229 aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0, aCircuit.teleportFlags.ToString());
226 230
227 // 231 //
228 // Check client 232 // Check client
229 // 233 //
@@ -287,17 +291,16 @@ namespace OpenSim.Services.HypergridService
287 } 291 }
288 } 292 }
289 } 293 }
290 m_log.DebugFormat("[GATEKEEPER SERVICE]: User is ok");
291 294
292 // 295 //
293 // Foreign agents allowed? Exceptions? 296 // Foreign agents allowed? Exceptions?
294 // 297 //
295 if (account == null) 298 if (account == null)
296 { 299 {
297 bool allowed = m_ForeignAgentsAllowed; 300 bool allowed = m_ForeignAgentsAllowed;
298 301
299 if (m_ForeignAgentsAllowed && IsException(aCircuit, m_ForeignsAllowedExceptions)) 302 if (m_ForeignAgentsAllowed && IsException(aCircuit, m_ForeignsAllowedExceptions))
300 allowed = false; 303 allowed = false;
301 304
302 if (!m_ForeignAgentsAllowed && IsException(aCircuit, m_ForeignsDisallowedExceptions)) 305 if (!m_ForeignAgentsAllowed && IsException(aCircuit, m_ForeignsDisallowedExceptions))
303 allowed = true; 306 allowed = true;
@@ -311,6 +314,20 @@ namespace OpenSim.Services.HypergridService
311 } 314 }
312 } 315 }
313 316
317 //
318 // Is the user banned?
319 // This uses a Ban service that's more powerful than the configs
320 //
321 string uui = (account != null ? aCircuit.AgentID.ToString() : Util.ProduceUserUniversalIdentifier(aCircuit));
322 if (m_BansService != null && m_BansService.IsBanned(uui, aCircuit.IPAddress, aCircuit.Id0, authURL))
323 {
324 reason = "You are banned from this world";
325 m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: user {0} is banned", uui);
326 return false;
327 }
328
329 m_log.DebugFormat("[GATEKEEPER SERVICE]: User {0} is ok", aCircuit.Name);
330
314 bool isFirstLogin = false; 331 bool isFirstLogin = false;
315 // 332 //
316 // Login the presence, if it's not there yet (by the login service) 333 // Login the presence, if it's not there yet (by the login service)
@@ -328,7 +345,8 @@ namespace OpenSim.Services.HypergridService
328 aCircuit.firstname, aCircuit.lastname); 345 aCircuit.firstname, aCircuit.lastname);
329 return false; 346 return false;
330 } 347 }
331 m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence ok"); 348
349 m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence {0} is ok", aCircuit.Name);
332 350
333 // Also login foreigners with GridUser service 351 // Also login foreigners with GridUser service
334 if (m_GridUserService != null && account == null) 352 if (m_GridUserService != null && account == null)
@@ -359,7 +377,9 @@ namespace OpenSim.Services.HypergridService
359 reason = "Destination region not found"; 377 reason = "Destination region not found";
360 return false; 378 return false;
361 } 379 }
362 m_log.DebugFormat("[GATEKEEPER SERVICE]: destination ok: {0}", destination.RegionName); 380
381 m_log.DebugFormat(
382 "[GATEKEEPER SERVICE]: Destination {0} is ok for {1}", destination.RegionName, aCircuit.Name);
363 383
364 // 384 //
365 // Adjust the visible name 385 // Adjust the visible name
@@ -393,7 +413,8 @@ namespace OpenSim.Services.HypergridService
393 // Preserve our TeleportFlags we have gathered so-far 413 // Preserve our TeleportFlags we have gathered so-far
394 loginFlag |= (Constants.TeleportFlags) aCircuit.teleportFlags; 414 loginFlag |= (Constants.TeleportFlags) aCircuit.teleportFlags;
395 415
396 m_log.DebugFormat("[GATEKEEPER SERVICE]: launching agent {0}", loginFlag); 416 m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0} {1}", aCircuit.Name, loginFlag);
417
397 return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason); 418 return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason);
398 } 419 }
399 420
@@ -402,6 +423,12 @@ namespace OpenSim.Services.HypergridService
402 if (!CheckAddress(aCircuit.ServiceSessionID)) 423 if (!CheckAddress(aCircuit.ServiceSessionID))
403 return false; 424 return false;
404 425
426 if (string.IsNullOrEmpty(aCircuit.IPAddress))
427 {
428 m_log.DebugFormat("[GATEKEEPER SERVICE]: Agent did not provide a client IP address.");
429 return false;
430 }
431
405 string userURL = string.Empty; 432 string userURL = string.Empty;
406 if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) 433 if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
407 userURL = aCircuit.ServiceURLs["HomeURI"].ToString(); 434 userURL = aCircuit.ServiceURLs["HomeURI"].ToString();