diff options
author | Diva Canto | 2010-05-15 19:25:14 -0700 |
---|---|---|
committer | Diva Canto | 2010-05-15 19:25:14 -0700 |
commit | 2a1e45f65736214a9e8d782be1f92bb78725121f (patch) | |
tree | 27a2f60b2c68ac1c8ac5d7886c9bfa743c8cb24d /OpenSim/Services | |
parent | delete now unused MessageServerInfo (diff) | |
download | opensim-SC-2a1e45f65736214a9e8d782be1f92bb78725121f.zip opensim-SC-2a1e45f65736214a9e8d782be1f92bb78725121f.tar.gz opensim-SC-2a1e45f65736214a9e8d782be1f92bb78725121f.tar.bz2 opensim-SC-2a1e45f65736214a9e8d782be1f92bb78725121f.tar.xz |
Finalized the client's TCP IP address verification process for HG1.5.
Diffstat (limited to '')
4 files changed, 32 insertions, 18 deletions
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 | |||
204 | return args; | 204 | return args; |
205 | } | 205 | } |
206 | 206 | ||
207 | public void SetClientToken(UUID sessionID, string token) | ||
208 | { | ||
209 | // no-op | ||
210 | } | ||
211 | |||
207 | public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt) | 212 | public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt) |
208 | { | 213 | { |
209 | position = Vector3.UnitY; lookAt = Vector3.UnitY; | 214 | 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 | |||
148 | return true; | 148 | return true; |
149 | } | 149 | } |
150 | 150 | ||
151 | public void SetClientToken(UUID sessionID, string token) | ||
152 | { | ||
153 | if (m_TravelingAgents.ContainsKey(sessionID)) | ||
154 | { | ||
155 | m_log.DebugFormat("[USER AGENT SERVICE]: Setting token {0} for session {1}", token, sessionID); | ||
156 | m_TravelingAgents[sessionID].ClientToken = token; | ||
157 | } | ||
158 | } | ||
159 | |||
151 | TravelingAgentInfo UpdateTravelInfo(AgentCircuitData agentCircuit, GridRegion region) | 160 | TravelingAgentInfo UpdateTravelInfo(AgentCircuitData agentCircuit, GridRegion region) |
152 | { | 161 | { |
153 | TravelingAgentInfo travel = new TravelingAgentInfo(); | 162 | TravelingAgentInfo travel = new TravelingAgentInfo(); |
@@ -203,22 +212,16 @@ namespace OpenSim.Services.HypergridService | |||
203 | 212 | ||
204 | public bool VerifyClient(UUID sessionID, string token) | 213 | public bool VerifyClient(UUID sessionID, string token) |
205 | { | 214 | { |
206 | return true; | 215 | m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token); |
216 | //return true; | ||
207 | 217 | ||
208 | // Commenting this for now until I understand better what part of a sender's | 218 | // Commenting this for now until I understand better what part of a sender's |
209 | // info stays unchanged throughout a session | 219 | // info stays unchanged throughout a session |
210 | // | 220 | // |
211 | //if (m_TravelingAgents.ContainsKey(sessionID)) | 221 | if (m_TravelingAgents.ContainsKey(sessionID)) |
212 | //{ | 222 | return m_TravelingAgents[sessionID].ClientToken == token; |
213 | // // Aquiles heel. Must trust the first grid upon login | 223 | |
214 | // if (m_TravelingAgents[sessionID].ClientToken == string.Empty) | 224 | return false; |
215 | // { | ||
216 | // m_TravelingAgents[sessionID].ClientToken = token; | ||
217 | // return true; | ||
218 | // } | ||
219 | // return m_TravelingAgents[sessionID].ClientToken == token; | ||
220 | //} | ||
221 | //return false; | ||
222 | } | 225 | } |
223 | 226 | ||
224 | public bool VerifyAgent(UUID sessionID, string token) | 227 | 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 | |||
49 | public interface IUserAgentService | 49 | public interface IUserAgentService |
50 | { | 50 | { |
51 | bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, out string reason); | 51 | bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, out string reason); |
52 | void SetClientToken(UUID sessionID, string token); | ||
52 | void LogoutAgent(UUID userID, UUID sessionID); | 53 | void LogoutAgent(UUID userID, UUID sessionID); |
53 | GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); | 54 | GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); |
54 | 55 | ||
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 | |||
329 | // Instantiate/get the simulation interface and launch an agent at the destination | 329 | // Instantiate/get the simulation interface and launch an agent at the destination |
330 | // | 330 | // |
331 | string reason = string.Empty; | 331 | string reason = string.Empty; |
332 | AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, out where, out reason); | 332 | AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, clientIP, out where, out reason); |
333 | 333 | ||
334 | if (aCircuit == null) | 334 | if (aCircuit == null) |
335 | { | 335 | { |
@@ -589,7 +589,7 @@ namespace OpenSim.Services.LLLoginService | |||
589 | } | 589 | } |
590 | 590 | ||
591 | protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar, | 591 | protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar, |
592 | UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, out string where, out string reason) | 592 | UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, IPEndPoint clientIP, out string where, out string reason) |
593 | { | 593 | { |
594 | where = currentWhere; | 594 | where = currentWhere; |
595 | ISimulationService simConnector = null; | 595 | ISimulationService simConnector = null; |
@@ -655,7 +655,7 @@ namespace OpenSim.Services.LLLoginService | |||
655 | { | 655 | { |
656 | circuitCode = (uint)Util.RandomClass.Next(); ; | 656 | circuitCode = (uint)Util.RandomClass.Next(); ; |
657 | aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); | 657 | aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); |
658 | success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, out reason); | 658 | success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason); |
659 | if (!success && m_GridService != null) | 659 | if (!success && m_GridService != null) |
660 | { | 660 | { |
661 | // Try the fallback regions | 661 | // Try the fallback regions |
@@ -664,7 +664,7 @@ namespace OpenSim.Services.LLLoginService | |||
664 | { | 664 | { |
665 | foreach (GridRegion r in fallbacks) | 665 | foreach (GridRegion r in fallbacks) |
666 | { | 666 | { |
667 | success = LaunchAgentIndirectly(gatekeeper, r, aCircuit, out reason); | 667 | success = LaunchAgentIndirectly(gatekeeper, r, aCircuit, clientIP, out reason); |
668 | if (success) | 668 | if (success) |
669 | { | 669 | { |
670 | where = "safe"; | 670 | where = "safe"; |
@@ -741,10 +741,15 @@ namespace OpenSim.Services.LLLoginService | |||
741 | return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason); | 741 | return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason); |
742 | } | 742 | } |
743 | 743 | ||
744 | private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, out string reason) | 744 | private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason) |
745 | { | 745 | { |
746 | m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); | 746 | m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); |
747 | return m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason); | 747 | if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason)) |
748 | { | ||
749 | m_UserAgentService.SetClientToken(aCircuit.SessionID, clientIP.Address.ToString()); | ||
750 | return true; | ||
751 | } | ||
752 | return false; | ||
748 | } | 753 | } |
749 | 754 | ||
750 | #region Console Commands | 755 | #region Console Commands |