aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/HypergridService/UserAgentService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/HypergridService/UserAgentService.cs')
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs25
1 files changed, 15 insertions, 10 deletions
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index c65122a..6f2cdd5 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -219,7 +219,7 @@ namespace OpenSim.Services.HypergridService
219 219
220 public bool LoginAgentToGrid(GridRegion source, AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, bool fromLogin, out string reason) 220 public bool LoginAgentToGrid(GridRegion source, AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, bool fromLogin, out string reason)
221 { 221 {
222 m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}", 222 m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}",
223 agentCircuit.firstname, agentCircuit.lastname, (fromLogin ? agentCircuit.IPAddress : "stored IP"), gatekeeper.ServerURI); 223 agentCircuit.firstname, agentCircuit.lastname, (fromLogin ? agentCircuit.IPAddress : "stored IP"), gatekeeper.ServerURI);
224 224
225 string gridName = gatekeeper.ServerURI; 225 string gridName = gatekeeper.ServerURI;
@@ -254,7 +254,6 @@ namespace OpenSim.Services.HypergridService
254 } 254 }
255 } 255 }
256 256
257
258 // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination 257 // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination
259 GridRegion region = new GridRegion(gatekeeper); 258 GridRegion region = new GridRegion(gatekeeper);
260 region.ServerURI = gatekeeper.ServerURI; 259 region.ServerURI = gatekeeper.ServerURI;
@@ -269,7 +268,7 @@ namespace OpenSim.Services.HypergridService
269 agentCircuit.ServiceSessionID = region.ServerURI + ";" + UUID.Random(); 268 agentCircuit.ServiceSessionID = region.ServerURI + ";" + UUID.Random();
270 TravelingAgentInfo old = null; 269 TravelingAgentInfo old = null;
271 TravelingAgentInfo travel = CreateTravelInfo(agentCircuit, region, fromLogin, out old); 270 TravelingAgentInfo travel = CreateTravelInfo(agentCircuit, region, fromLogin, out old);
272 271
273 bool success = false; 272 bool success = false;
274 string myExternalIP = string.Empty; 273 string myExternalIP = string.Empty;
275 274
@@ -281,12 +280,14 @@ namespace OpenSim.Services.HypergridService
281 } 280 }
282 else 281 else
283 { 282 {
284 success = m_GatekeeperConnector.CreateAgent(source, region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out myExternalIP, out reason); 283 //TODO: Should there not be a call to QueryAccess here?
284 EntityTransferContext ctx = new EntityTransferContext();
285 success = m_GatekeeperConnector.CreateAgent(source, region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, ctx, out myExternalIP, out reason);
285 } 286 }
286 287
287 if (!success) 288 if (!success)
288 { 289 {
289 m_log.DebugFormat("[USER AGENT SERVICE]: Unable to login user {0} {1} to grid {2}, reason: {3}", 290 m_log.DebugFormat("[USER AGENT SERVICE]: Unable to login user {0} {1} to grid {2}, reason: {3}",
290 agentCircuit.firstname, agentCircuit.lastname, region.ServerURI, reason); 291 agentCircuit.firstname, agentCircuit.lastname, region.ServerURI, reason);
291 292
292 if (old != null) 293 if (old != null)
@@ -299,8 +300,12 @@ namespace OpenSim.Services.HypergridService
299 300
300 // Everything is ok 301 // Everything is ok
301 302
302 // Update the perceived IP Address of our grid 303 if (!fromLogin)
303 m_log.DebugFormat("[USER AGENT SERVICE]: Gatekeeper sees me as {0}", myExternalIP); 304 {
305 // Update the perceived IP Address of our grid
306 m_log.DebugFormat("[USER AGENT SERVICE]: Gatekeeper sees me as {0}", myExternalIP);
307 }
308
304 travel.MyIpAddress = myExternalIP; 309 travel.MyIpAddress = myExternalIP;
305 310
306 StoreTravelInfo(travel); 311 StoreTravelInfo(travel);
@@ -370,7 +375,7 @@ namespace OpenSim.Services.HypergridService
370 if (m_BypassClientVerification) 375 if (m_BypassClientVerification)
371 return true; 376 return true;
372 377
373 m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with reported IP {1}.", 378 m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with reported IP {1}.",
374 sessionID, reportedIP); 379 sessionID, reportedIP);
375 380
376 HGTravelingData hgt = m_Database.Get(sessionID); 381 HGTravelingData hgt = m_Database.Get(sessionID);
@@ -529,7 +534,7 @@ namespace OpenSim.Services.HypergridService
529 FriendInfo[] friendInfos = m_FriendsService.GetFriends(localUserID); 534 FriendInfo[] friendInfos = m_FriendsService.GetFriends(localUserID);
530 foreach (FriendInfo finfo in friendInfos) 535 foreach (FriendInfo finfo in friendInfos)
531 { 536 {
532 if (finfo.Friend.StartsWith(foreignUserID.ToString()) && finfo.Friend.EndsWith(secret) && 537 if (finfo.Friend.StartsWith(foreignUserID.ToString()) && finfo.Friend.EndsWith(secret) &&
533 (finfo.TheirFlags & (int)FriendRights.CanSeeOnline) != 0 && (finfo.TheirFlags != -1)) 538 (finfo.TheirFlags & (int)FriendRights.CanSeeOnline) != 0 && (finfo.TheirFlags != -1))
534 { 539 {
535 // great! 540 // great!
@@ -635,7 +640,7 @@ namespace OpenSim.Services.HypergridService
635 foreach (FriendInfo f in friends) 640 foreach (FriendInfo f in friends)
636 if (f.Friend.StartsWith(targetUserID.ToString())) 641 if (f.Friend.StartsWith(targetUserID.ToString()))
637 { 642 {
638 // Let's remove the secret 643 // Let's remove the secret
639 UUID id; string tmp = string.Empty, secret = string.Empty; 644 UUID id; string tmp = string.Empty, secret = string.Empty;
640 if (Util.ParseUniversalUserIdentifier(f.Friend, out id, out tmp, out tmp, out tmp, out secret)) 645 if (Util.ParseUniversalUserIdentifier(f.Friend, out id, out tmp, out tmp, out tmp, out secret))
641 return f.Friend.Replace(secret, "0"); 646 return f.Friend.Replace(secret, "0");