mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
* Fixed misspelling of field in GridService
* Moved TeleportClientHome to EntityTransferModule
This commit is contained in:
@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private bool m_Enabled = false;
|
||||
protected bool m_Enabled = false;
|
||||
protected Scene m_aScene;
|
||||
protected List<UUID> m_agentsInTransit;
|
||||
|
||||
@@ -94,6 +94,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
m_aScene = scene;
|
||||
|
||||
scene.RegisterModuleInterface<IEntityTransferModule>(this);
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
}
|
||||
|
||||
protected void OnNewClient(IClientAPI client)
|
||||
{
|
||||
client.OnTeleportHomeRequest += TeleportHome;
|
||||
}
|
||||
|
||||
public virtual void Close()
|
||||
@@ -499,6 +505,33 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
#endregion
|
||||
|
||||
#region Teleport Home
|
||||
|
||||
public virtual void TeleportHome(UUID id, IClientAPI client)
|
||||
{
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
|
||||
|
||||
OpenSim.Services.Interfaces.PresenceInfo pinfo = m_aScene.PresenceService.GetAgent(client.SessionId);
|
||||
|
||||
if (pinfo != null)
|
||||
{
|
||||
GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, pinfo.HomeRegionID);
|
||||
if (regionInfo == null)
|
||||
{
|
||||
// can't find the Home region: Tell viewer and abort
|
||||
client.SendTeleportFailed("Your home region could not be found.");
|
||||
return;
|
||||
}
|
||||
// a little eekie that this goes back to Scene and with a forced cast, will fix that at some point...
|
||||
((Scene)(client.Scene)).RequestTeleportLocation(
|
||||
client, regionInfo.RegionHandle, pinfo.HomePosition, pinfo.HomeLookAt,
|
||||
(uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Agent Crossings
|
||||
|
||||
public void Cross(ScenePresence agent, bool isFlying)
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private bool m_Enabled = false;
|
||||
private IHypergridService m_HypergridService;
|
||||
private IHypergridService HyperGridService
|
||||
{
|
||||
@@ -84,42 +83,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
}
|
||||
}
|
||||
|
||||
public override void PostInitialise()
|
||||
{
|
||||
}
|
||||
|
||||
public override void AddRegion(Scene scene)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
if (m_aScene == null)
|
||||
m_aScene = scene;
|
||||
|
||||
scene.RegisterModuleInterface<IEntityTransferModule>(this);
|
||||
}
|
||||
|
||||
public override void Close()
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
public override void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
if (scene == m_aScene)
|
||||
m_aScene = null;
|
||||
}
|
||||
|
||||
public override void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user