diff options
author | Diva Canto | 2010-01-18 09:14:19 -0800 |
---|---|---|
committer | Diva Canto | 2010-01-18 09:14:19 -0800 |
commit | bbbe9e73cca2a0ed5d35db1b054b8ed4cd23bfea (patch) | |
tree | 3594ac376b196a87139450ada56c555ca776b2be /OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |
parent | HG teleports through gatekeeper are working. (diff) | |
download | opensim-SC_OLD-bbbe9e73cca2a0ed5d35db1b054b8ed4cd23bfea.zip opensim-SC_OLD-bbbe9e73cca2a0ed5d35db1b054b8ed4cd23bfea.tar.gz opensim-SC_OLD-bbbe9e73cca2a0ed5d35db1b054b8ed4cd23bfea.tar.bz2 opensim-SC_OLD-bbbe9e73cca2a0ed5d35db1b054b8ed4cd23bfea.tar.xz |
* Fixed misspelling of field in GridService
* Moved TeleportClientHome to EntityTransferModule
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 622d057..fcc7a85 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
50 | { | 50 | { |
51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | 52 | ||
53 | private bool m_Enabled = false; | 53 | protected bool m_Enabled = false; |
54 | protected Scene m_aScene; | 54 | protected Scene m_aScene; |
55 | protected List<UUID> m_agentsInTransit; | 55 | protected List<UUID> m_agentsInTransit; |
56 | 56 | ||
@@ -94,6 +94,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
94 | m_aScene = scene; | 94 | m_aScene = scene; |
95 | 95 | ||
96 | scene.RegisterModuleInterface<IEntityTransferModule>(this); | 96 | scene.RegisterModuleInterface<IEntityTransferModule>(this); |
97 | scene.EventManager.OnNewClient += OnNewClient; | ||
98 | } | ||
99 | |||
100 | protected void OnNewClient(IClientAPI client) | ||
101 | { | ||
102 | client.OnTeleportHomeRequest += TeleportHome; | ||
97 | } | 103 | } |
98 | 104 | ||
99 | public virtual void Close() | 105 | public virtual void Close() |
@@ -499,6 +505,33 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
499 | 505 | ||
500 | #endregion | 506 | #endregion |
501 | 507 | ||
508 | #region Teleport Home | ||
509 | |||
510 | public virtual void TeleportHome(UUID id, IClientAPI client) | ||
511 | { | ||
512 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); | ||
513 | |||
514 | OpenSim.Services.Interfaces.PresenceInfo pinfo = m_aScene.PresenceService.GetAgent(client.SessionId); | ||
515 | |||
516 | if (pinfo != null) | ||
517 | { | ||
518 | GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, pinfo.HomeRegionID); | ||
519 | if (regionInfo == null) | ||
520 | { | ||
521 | // can't find the Home region: Tell viewer and abort | ||
522 | client.SendTeleportFailed("Your home region could not be found."); | ||
523 | return; | ||
524 | } | ||
525 | // a little eekie that this goes back to Scene and with a forced cast, will fix that at some point... | ||
526 | ((Scene)(client.Scene)).RequestTeleportLocation( | ||
527 | client, regionInfo.RegionHandle, pinfo.HomePosition, pinfo.HomeLookAt, | ||
528 | (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome)); | ||
529 | } | ||
530 | } | ||
531 | |||
532 | #endregion | ||
533 | |||
534 | |||
502 | #region Agent Crossings | 535 | #region Agent Crossings |
503 | 536 | ||
504 | public void Cross(ScenePresence agent, bool isFlying) | 537 | public void Cross(ScenePresence agent, bool isFlying) |