From 4e7013d5d565bf6e9dab8a1c88a5b7c992be6114 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 13 May 2010 07:59:30 -0700 Subject: Made fields consistently protected. --- OpenSim/Services/LLLoginService/LLLoginService.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index f97222e..9e24a39 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -58,21 +58,21 @@ namespace OpenSim.Services.LLLoginService protected IInventoryService m_InventoryService; protected IGridService m_GridService; protected IPresenceService m_PresenceService; - private ISimulationService m_LocalSimulationService; - private ISimulationService m_RemoteSimulationService; + protected ISimulationService m_LocalSimulationService; + protected ISimulationService m_RemoteSimulationService; protected ILibraryService m_LibraryService; protected IFriendsService m_FriendsService; protected IAvatarService m_AvatarService; - private IUserAgentService m_UserAgentService; + protected IUserAgentService m_UserAgentService; - private GatekeeperServiceConnector m_GatekeeperConnector; + protected GatekeeperServiceConnector m_GatekeeperConnector; - private string m_DefaultRegionName; + protected string m_DefaultRegionName; protected string m_WelcomeMessage; - private bool m_RequireInventory; + protected bool m_RequireInventory; protected int m_MinLoginLevel; - private string m_GatekeeperURL; - private bool m_AllowRemoteSetLoginLevel; + protected string m_GatekeeperURL; + protected bool m_AllowRemoteSetLoginLevel; IConfig m_LoginServerConfig; -- cgit v1.1 From 2a1e45f65736214a9e8d782be1f92bb78725121f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 15 May 2010 19:25:14 -0700 Subject: Finalized the client's TCP IP address verification process for HG1.5. --- .../Hypergrid/UserAgentServiceConnector.cs | 5 ++++ .../Services/HypergridService/UserAgentService.cs | 27 ++++++++++++---------- OpenSim/Services/Interfaces/IGatekeeperService.cs | 1 + OpenSim/Services/LLLoginService/LLLoginService.cs | 17 +++++++++----- 4 files changed, 32 insertions(+), 18 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 3e91e3a..42eca05 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -204,6 +204,11 @@ namespace OpenSim.Services.Connectors.Hypergrid return args; } + public void SetClientToken(UUID sessionID, string token) + { + // no-op + } + public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt) { position = Vector3.UnitY; lookAt = Vector3.UnitY; diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 64f7e8a..0172960 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -148,6 +148,15 @@ namespace OpenSim.Services.HypergridService return true; } + public void SetClientToken(UUID sessionID, string token) + { + if (m_TravelingAgents.ContainsKey(sessionID)) + { + m_log.DebugFormat("[USER AGENT SERVICE]: Setting token {0} for session {1}", token, sessionID); + m_TravelingAgents[sessionID].ClientToken = token; + } + } + TravelingAgentInfo UpdateTravelInfo(AgentCircuitData agentCircuit, GridRegion region) { TravelingAgentInfo travel = new TravelingAgentInfo(); @@ -203,22 +212,16 @@ namespace OpenSim.Services.HypergridService public bool VerifyClient(UUID sessionID, string token) { - return true; + m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token); + //return true; // Commenting this for now until I understand better what part of a sender's // info stays unchanged throughout a session // - //if (m_TravelingAgents.ContainsKey(sessionID)) - //{ - // // Aquiles heel. Must trust the first grid upon login - // if (m_TravelingAgents[sessionID].ClientToken == string.Empty) - // { - // m_TravelingAgents[sessionID].ClientToken = token; - // return true; - // } - // return m_TravelingAgents[sessionID].ClientToken == token; - //} - //return false; + if (m_TravelingAgents.ContainsKey(sessionID)) + return m_TravelingAgents[sessionID].ClientToken == token; + + return false; } public bool VerifyAgent(UUID sessionID, string token) diff --git a/OpenSim/Services/Interfaces/IGatekeeperService.cs b/OpenSim/Services/Interfaces/IGatekeeperService.cs index ca7b9b3..2d397bc 100644 --- a/OpenSim/Services/Interfaces/IGatekeeperService.cs +++ b/OpenSim/Services/Interfaces/IGatekeeperService.cs @@ -49,6 +49,7 @@ namespace OpenSim.Services.Interfaces public interface IUserAgentService { bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, out string reason); + void SetClientToken(UUID sessionID, string token); void LogoutAgent(UUID userID, UUID sessionID); GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 9e24a39..7471c77 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -329,7 +329,7 @@ namespace OpenSim.Services.LLLoginService // Instantiate/get the simulation interface and launch an agent at the destination // string reason = string.Empty; - AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, out where, out reason); + AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, clientIP, out where, out reason); if (aCircuit == null) { @@ -589,7 +589,7 @@ namespace OpenSim.Services.LLLoginService } protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar, - UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, out string where, out string reason) + UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, IPEndPoint clientIP, out string where, out string reason) { where = currentWhere; ISimulationService simConnector = null; @@ -655,7 +655,7 @@ namespace OpenSim.Services.LLLoginService { circuitCode = (uint)Util.RandomClass.Next(); ; aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); - success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, out reason); + success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason); if (!success && m_GridService != null) { // Try the fallback regions @@ -664,7 +664,7 @@ namespace OpenSim.Services.LLLoginService { foreach (GridRegion r in fallbacks) { - success = LaunchAgentIndirectly(gatekeeper, r, aCircuit, out reason); + success = LaunchAgentIndirectly(gatekeeper, r, aCircuit, clientIP, out reason); if (success) { where = "safe"; @@ -741,10 +741,15 @@ namespace OpenSim.Services.LLLoginService return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason); } - private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, out string reason) + private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason) { m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); - return m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason); + if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason)) + { + m_UserAgentService.SetClientToken(aCircuit.SessionID, clientIP.Address.ToString()); + return true; + } + return false; } #region Console Commands -- cgit v1.1 From 74b23ff9c644f20e04ebda1c03eb69af29c417cc Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 15 May 2010 19:58:30 -0700 Subject: Almost, but not quite. Commenting verification again, until I understand where 127.0.0.1 is being transformed to the local IP address. I suspect it's Adam's NAT snippets. --- OpenSim/Services/HypergridService/UserAgentService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 0172960..4a275c6 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -213,15 +213,15 @@ namespace OpenSim.Services.HypergridService public bool VerifyClient(UUID sessionID, string token) { m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token); - //return true; + return true; // Commenting this for now until I understand better what part of a sender's // info stays unchanged throughout a session // - if (m_TravelingAgents.ContainsKey(sessionID)) - return m_TravelingAgents[sessionID].ClientToken == token; + //if (m_TravelingAgents.ContainsKey(sessionID)) + // return m_TravelingAgents[sessionID].ClientToken == token; - return false; + //return false; } public bool VerifyAgent(UUID sessionID, string token) -- cgit v1.1 From e5e52e4072f8eab2a44f79dd4a31403d5eb2d5a7 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 15 May 2010 20:27:25 -0700 Subject: This combination is working. It all points to not being able to use 127.0.0.1/localhost in testing HG situations. The login server must have the LAN IP address, and the regions must show ExternalHostname as SYSTEMIP. Working, but this needs more testing. --- OpenSim/Services/HypergridService/UserAgentService.cs | 10 +++++----- OpenSim/Services/LLLoginService/LLLoginService.cs | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 4a275c6..2f1fed4 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -213,15 +213,15 @@ namespace OpenSim.Services.HypergridService public bool VerifyClient(UUID sessionID, string token) { m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token); - return true; + //return true; // Commenting this for now until I understand better what part of a sender's // info stays unchanged throughout a session - // - //if (m_TravelingAgents.ContainsKey(sessionID)) - // return m_TravelingAgents[sessionID].ClientToken == token; - //return false; + if (m_TravelingAgents.ContainsKey(sessionID)) + return m_TravelingAgents[sessionID].ClientToken == token; + + return false; } public bool VerifyAgent(UUID sessionID, string token) diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 7471c77..9d151df 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -746,6 +746,7 @@ namespace OpenSim.Services.LLLoginService m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason)) { + //IPAddress addr = NetworkUtil.GetIPFor(clientIP.Address, gatekeeper.ExternalEndPoint.Address); m_UserAgentService.SetClientToken(aCircuit.SessionID, clientIP.Address.ToString()); return true; } -- cgit v1.1 From 49f4becdae9faf4afbf03c4e464237e323de496d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 16 May 2010 08:10:57 -0700 Subject: * Fixed configs in StandaloneHypergrid.ini, it still had the SQLite connection strings. * Added a comment in LLLoginService.cs, for future reference --- OpenSim/Services/LLLoginService/LLLoginService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 9d151df..712b899 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -746,8 +746,10 @@ namespace OpenSim.Services.LLLoginService m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason)) { - //IPAddress addr = NetworkUtil.GetIPFor(clientIP.Address, gatekeeper.ExternalEndPoint.Address); - m_UserAgentService.SetClientToken(aCircuit.SessionID, clientIP.Address.ToString()); + // We may need to do this at some point, + // so leaving it here in comments. + //IPAddress addr = NetworkUtil.GetIPFor(clientIP.Address, destination.ExternalEndPoint.Address); + m_UserAgentService.SetClientToken(aCircuit.SessionID, /*addr.Address.ToString() */ clientIP.Address.ToString()); return true; } return false; -- cgit v1.1