diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 41ca13b..f3a0b01 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -184,7 +184,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
184 | 184 | ||
185 | protected override void OnNewClient(IClientAPI client) | 185 | protected override void OnNewClient(IClientAPI client) |
186 | { | 186 | { |
187 | client.OnTeleportHomeRequest += TeleportHome; | 187 | client.OnTeleportHomeRequest += TriggerTeleportHome; |
188 | client.OnTeleportLandmarkRequest += RequestTeleportLandmark; | 188 | client.OnTeleportLandmarkRequest += RequestTeleportLandmark; |
189 | client.OnConnectionClosed += new Action<IClientAPI>(OnConnectionClosed); | 189 | client.OnConnectionClosed += new Action<IClientAPI>(OnConnectionClosed); |
190 | } | 190 | } |
@@ -291,6 +291,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
291 | return base.CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout); | 291 | return base.CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout); |
292 | } | 292 | } |
293 | 293 | ||
294 | public void TriggerTeleportHome(UUID id, IClientAPI client) | ||
295 | { | ||
296 | TeleportHome(id, client); | ||
297 | } | ||
298 | |||
294 | protected override bool ValidateGenericConditions(ScenePresence sp, GridRegion reg, GridRegion finalDestination, uint teleportFlags, out string reason) | 299 | protected override bool ValidateGenericConditions(ScenePresence sp, GridRegion reg, GridRegion finalDestination, uint teleportFlags, out string reason) |
295 | { | 300 | { |
296 | reason = "Please wear your grid's allowed appearance before teleporting to another grid"; | 301 | reason = "Please wear your grid's allowed appearance before teleporting to another grid"; |
@@ -409,7 +414,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
409 | // return base.UpdateAgent(reg, finalDestination, agentData, sp); | 414 | // return base.UpdateAgent(reg, finalDestination, agentData, sp); |
410 | //} | 415 | //} |
411 | 416 | ||
412 | public override void TeleportHome(UUID id, IClientAPI client) | 417 | public override bool TeleportHome(UUID id, IClientAPI client) |
413 | { | 418 | { |
414 | m_log.DebugFormat( | 419 | m_log.DebugFormat( |
415 | "[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId); | 420 | "[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId); |
@@ -420,8 +425,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
420 | { | 425 | { |
421 | // local grid user | 426 | // local grid user |
422 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local"); | 427 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local"); |
423 | base.TeleportHome(id, client); | 428 | return base.TeleportHome(id, client); |
424 | return; | ||
425 | } | 429 | } |
426 | 430 | ||
427 | // Foreign user wants to go home | 431 | // Foreign user wants to go home |
@@ -431,7 +435,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
431 | { | 435 | { |
432 | client.SendTeleportFailed("Your information has been lost"); | 436 | client.SendTeleportFailed("Your information has been lost"); |
433 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Unable to locate agent's gateway information"); | 437 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Unable to locate agent's gateway information"); |
434 | return; | 438 | return false; |
435 | } | 439 | } |
436 | 440 | ||
437 | IUserAgentService userAgentService = new UserAgentServiceConnector(aCircuit.ServiceURLs["HomeURI"].ToString()); | 441 | IUserAgentService userAgentService = new UserAgentServiceConnector(aCircuit.ServiceURLs["HomeURI"].ToString()); |
@@ -441,7 +445,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
441 | { | 445 | { |
442 | client.SendTeleportFailed("Your home region could not be found"); | 446 | client.SendTeleportFailed("Your home region could not be found"); |
443 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent's home region not found"); | 447 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent's home region not found"); |
444 | return; | 448 | return false; |
445 | } | 449 | } |
446 | 450 | ||
447 | ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(client.AgentId); | 451 | ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(client.AgentId); |
@@ -449,7 +453,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
449 | { | 453 | { |
450 | client.SendTeleportFailed("Internal error"); | 454 | client.SendTeleportFailed("Internal error"); |
451 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent not found in the scene where it is supposed to be"); | 455 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent not found in the scene where it is supposed to be"); |
452 | return; | 456 | return false; |
453 | } | 457 | } |
454 | 458 | ||
455 | GridRegion homeGatekeeper = MakeRegion(aCircuit); | 459 | GridRegion homeGatekeeper = MakeRegion(aCircuit); |
@@ -457,9 +461,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
457 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}", | 461 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}", |
458 | aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ServerURI, homeGatekeeper.RegionName); | 462 | aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ServerURI, homeGatekeeper.RegionName); |
459 | 463 | ||
460 | DoTeleport( | 464 | DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome)); |
461 | sp, homeGatekeeper, finalDestination, | 465 | return true; |
462 | position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome)); | ||
463 | } | 466 | } |
464 | 467 | ||
465 | /// <summary> | 468 | /// <summary> |
@@ -586,4 +589,4 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
586 | return region; | 589 | return region; |
587 | } | 590 | } |
588 | } | 591 | } |
589 | } \ No newline at end of file | 592 | } |