aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/HypergridService
diff options
context:
space:
mode:
authorDiva Canto2010-08-19 19:54:40 -0700
committerDiva Canto2010-08-19 19:54:40 -0700
commita39ea07158756a76757d4b616c60cbcedf06f268 (patch)
tree59438c64692b850dc09f96e2658e9f4d77b36a9d /OpenSim/Services/HypergridService
parentPartial rewrite of client IP verification. Not completely finished yet, and u... (diff)
downloadopensim-SC_OLD-a39ea07158756a76757d4b616c60cbcedf06f268.zip
opensim-SC_OLD-a39ea07158756a76757d4b616c60cbcedf06f268.tar.gz
opensim-SC_OLD-a39ea07158756a76757d4b616c60cbcedf06f268.tar.bz2
opensim-SC_OLD-a39ea07158756a76757d4b616c60cbcedf06f268.tar.xz
Finished implementing ViaLogin vs ViaHGLogin. Removed lookup on myipaddress.com. Also removed client IP verification upon UDP connection that had been left there -- we can't do that in general.
Diffstat (limited to 'OpenSim/Services/HypergridService')
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs28
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs5
2 files changed, 21 insertions, 12 deletions
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 6f041da..3f5c4f1 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -225,17 +225,23 @@ namespace OpenSim.Services.HypergridService
225 225
226 // May want to authorize 226 // May want to authorize
227 227
228 bool isFirstLogin = false;
228 // 229 //
229 // Login the presence 230 // Login the presence, if it's not there yet (by the login service)
230 // 231 //
231 if (!m_PresenceService.LoginAgent(aCircuit.AgentID.ToString(), aCircuit.SessionID, aCircuit.SecureSessionID)) 232 PresenceInfo presence = m_PresenceService.GetAgent(aCircuit.SessionID);
232 { 233 if (presence != null) // it has been placed there by the login service
233 reason = "Unable to login presence"; 234 isFirstLogin = true;
234 m_log.InfoFormat("[GATEKEEPER SERVICE]: Presence login failed for foreign agent {0} {1}. Refusing service.", 235
235 aCircuit.firstname, aCircuit.lastname); 236 else
236 return false; 237 if (!m_PresenceService.LoginAgent(aCircuit.AgentID.ToString(), aCircuit.SessionID, aCircuit.SecureSessionID))
237 } 238 {
238 m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence ok"); 239 reason = "Unable to login presence";
240 m_log.InfoFormat("[GATEKEEPER SERVICE]: Presence login failed for foreign agent {0} {1}. Refusing service.",
241 aCircuit.firstname, aCircuit.lastname);
242 return false;
243 }
244 m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence ok");
239 245
240 // 246 //
241 // Get the region 247 // Get the region
@@ -274,7 +280,9 @@ namespace OpenSim.Services.HypergridService
274 // 280 //
275 // Finally launch the agent at the destination 281 // Finally launch the agent at the destination
276 // 282 //
277 return m_SimulationService.CreateAgent(destination, aCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); 283 Constants.TeleportFlags loginFlag = isFirstLogin ? Constants.TeleportFlags.ViaLogin : Constants.TeleportFlags.ViaHGLogin;
284 m_log.DebugFormat("[GATEKEEPER SERVICE]: launching agent {0}", loginFlag);
285 return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason);
278 } 286 }
279 287
280 protected bool Authenticate(AgentCircuitData aCircuit) 288 protected bool Authenticate(AgentCircuitData aCircuit)
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index 6b14e21..8c3be70 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -134,7 +134,7 @@ namespace OpenSim.Services.HypergridService
134 public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint clientIP, out string reason) 134 public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint clientIP, out string reason)
135 { 135 {
136 m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}", 136 m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}",
137 agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "(stored IP)" : clientIP.ToString()), 137 agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()),
138 gatekeeper.ExternalHostName +":"+ gatekeeper.HttpPort); 138 gatekeeper.ExternalHostName +":"+ gatekeeper.HttpPort);
139 139
140 // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination 140 // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination
@@ -169,9 +169,10 @@ namespace OpenSim.Services.HypergridService
169 return false; 169 return false;
170 } 170 }
171 171
172 m_log.DebugFormat("[USER AGENT SERVICE]: Gatekeeper sees me as {0}", myExternalIP);
172 // else set the IP addresses associated with this client 173 // else set the IP addresses associated with this client
173 if (clientIP != null) 174 if (clientIP != null)
174 m_TravelingAgents[agentCircuit.SessionID].ClientIPAddress = clientIP.ToString(); 175 m_TravelingAgents[agentCircuit.SessionID].ClientIPAddress = clientIP.Address.ToString();
175 m_TravelingAgents[agentCircuit.SessionID].MyIpAddress = myExternalIP; 176 m_TravelingAgents[agentCircuit.SessionID].MyIpAddress = myExternalIP;
176 return true; 177 return true;
177 } 178 }