aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs5
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs29
-rw-r--r--OpenSim/Services/Interfaces/IGatekeeperService.cs1
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs36
4 files changed, 44 insertions, 27 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..2f1fed4 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 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