diff options
Diffstat (limited to 'OpenSim/Services')
4 files changed, 28 insertions, 14 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..4a275c6 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,21 +212,15 @@ namespace OpenSim.Services.HypergridService | |||
203 | 212 | ||
204 | public bool VerifyClient(UUID sessionID, string token) | 213 | public bool VerifyClient(UUID sessionID, string token) |
205 | { | 214 | { |
215 | m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token); | ||
206 | return true; | 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 | //{ | ||
213 | // // Aquiles heel. Must trust the first grid upon login | ||
214 | // if (m_TravelingAgents[sessionID].ClientToken == string.Empty) | ||
215 | // { | ||
216 | // m_TravelingAgents[sessionID].ClientToken = token; | ||
217 | // return true; | ||
218 | // } | ||
219 | // return m_TravelingAgents[sessionID].ClientToken == token; | 222 | // return m_TravelingAgents[sessionID].ClientToken == token; |
220 | //} | 223 | |
221 | //return false; | 224 | //return false; |
222 | } | 225 | } |
223 | 226 | ||
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 |