diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Services/LLLoginService/LLLoginService.cs')
-rw-r--r-- | OpenSim/Services/LLLoginService/LLLoginService.cs | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 398fe4f..c85d35a 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -58,21 +58,21 @@ namespace OpenSim.Services.LLLoginService | |||
58 | protected IInventoryService m_InventoryService; | 58 | protected IInventoryService m_InventoryService; |
59 | protected IGridService m_GridService; | 59 | protected IGridService m_GridService; |
60 | protected IPresenceService m_PresenceService; | 60 | protected IPresenceService m_PresenceService; |
61 | private ISimulationService m_LocalSimulationService; | 61 | protected ISimulationService m_LocalSimulationService; |
62 | private ISimulationService m_RemoteSimulationService; | 62 | protected ISimulationService m_RemoteSimulationService; |
63 | protected ILibraryService m_LibraryService; | 63 | protected ILibraryService m_LibraryService; |
64 | protected IFriendsService m_FriendsService; | 64 | protected IFriendsService m_FriendsService; |
65 | protected IAvatarService m_AvatarService; | 65 | protected IAvatarService m_AvatarService; |
66 | private IUserAgentService m_UserAgentService; | 66 | protected IUserAgentService m_UserAgentService; |
67 | 67 | ||
68 | private GatekeeperServiceConnector m_GatekeeperConnector; | 68 | protected GatekeeperServiceConnector m_GatekeeperConnector; |
69 | 69 | ||
70 | private string m_DefaultRegionName; | 70 | protected string m_DefaultRegionName; |
71 | protected string m_WelcomeMessage; | 71 | protected string m_WelcomeMessage; |
72 | private bool m_RequireInventory; | 72 | protected bool m_RequireInventory; |
73 | protected int m_MinLoginLevel; | 73 | protected int m_MinLoginLevel; |
74 | private string m_GatekeeperURL; | 74 | protected string m_GatekeeperURL; |
75 | private bool m_AllowRemoteSetLoginLevel; | 75 | protected bool m_AllowRemoteSetLoginLevel; |
76 | 76 | ||
77 | IConfig m_LoginServerConfig; | 77 | IConfig m_LoginServerConfig; |
78 | 78 | ||
@@ -335,7 +335,7 @@ namespace OpenSim.Services.LLLoginService | |||
335 | // Instantiate/get the simulation interface and launch an agent at the destination | 335 | // Instantiate/get the simulation interface and launch an agent at the destination |
336 | // | 336 | // |
337 | string reason = string.Empty; | 337 | string reason = string.Empty; |
338 | AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, out where, out reason); | 338 | AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, clientIP, out where, out reason); |
339 | 339 | ||
340 | if (aCircuit == null) | 340 | if (aCircuit == null) |
341 | { | 341 | { |
@@ -595,7 +595,7 @@ namespace OpenSim.Services.LLLoginService | |||
595 | } | 595 | } |
596 | 596 | ||
597 | protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar, | 597 | protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar, |
598 | UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, out string where, out string reason) | 598 | UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, IPEndPoint clientIP, out string where, out string reason) |
599 | { | 599 | { |
600 | where = currentWhere; | 600 | where = currentWhere; |
601 | ISimulationService simConnector = null; | 601 | ISimulationService simConnector = null; |
@@ -661,7 +661,7 @@ namespace OpenSim.Services.LLLoginService | |||
661 | { | 661 | { |
662 | circuitCode = (uint)Util.RandomClass.Next(); ; | 662 | circuitCode = (uint)Util.RandomClass.Next(); ; |
663 | aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); | 663 | aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); |
664 | success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, out reason); | 664 | success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason); |
665 | if (!success && m_GridService != null) | 665 | if (!success && m_GridService != null) |
666 | { | 666 | { |
667 | // Try the fallback regions | 667 | // Try the fallback regions |
@@ -670,7 +670,7 @@ namespace OpenSim.Services.LLLoginService | |||
670 | { | 670 | { |
671 | foreach (GridRegion r in fallbacks) | 671 | foreach (GridRegion r in fallbacks) |
672 | { | 672 | { |
673 | success = LaunchAgentIndirectly(gatekeeper, r, aCircuit, out reason); | 673 | success = LaunchAgentIndirectly(gatekeeper, r, aCircuit, clientIP, out reason); |
674 | if (success) | 674 | if (success) |
675 | { | 675 | { |
676 | where = "safe"; | 676 | where = "safe"; |
@@ -747,10 +747,18 @@ namespace OpenSim.Services.LLLoginService | |||
747 | return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason); | 747 | return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason); |
748 | } | 748 | } |
749 | 749 | ||
750 | private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, out string reason) | 750 | private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason) |
751 | { | 751 | { |
752 | m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); | 752 | m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); |
753 | return m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason); | 753 | if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason)) |
754 | { | ||
755 | // We may need to do this at some point, | ||
756 | // so leaving it here in comments. | ||
757 | //IPAddress addr = NetworkUtil.GetIPFor(clientIP.Address, destination.ExternalEndPoint.Address); | ||
758 | m_UserAgentService.SetClientToken(aCircuit.SessionID, /*addr.Address.ToString() */ clientIP.Address.ToString()); | ||
759 | return true; | ||
760 | } | ||
761 | return false; | ||
754 | } | 762 | } |
755 | 763 | ||
756 | #region Console Commands | 764 | #region Console Commands |