Fix for landing points. Only one scenario is not fully covered by this change, and that is people who teleport from neighbouring regions, who won't get affected by the landing point.
parent
a9f4d7a29c
commit
7371c7662a
|
@ -3460,6 +3460,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Honor parcel landing type and position.
|
// Honor parcel landing type and position.
|
||||||
|
/*
|
||||||
ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
|
ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
|
||||||
if (land != null)
|
if (land != null)
|
||||||
{
|
{
|
||||||
|
@ -3468,6 +3469,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
agent.startpos = land.LandData.UserLocation;
|
agent.startpos = land.LandData.UserLocation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/// This is now handled properly in ScenePresence.MakeRootAgent
|
||||||
}
|
}
|
||||||
|
|
||||||
m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
|
m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
|
||||||
|
|
|
@ -719,6 +719,31 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
position = emergencyPos;
|
position = emergencyPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vector3 currentPos = avatar.AbsolutePosition;
|
||||||
|
ILandObject srcLand = m_scene.LandChannel.GetLandObject(currentPos.X, currentPos.Y);
|
||||||
|
ILandObject destLand = m_scene.LandChannel.GetLandObject(position.X, position.Y);
|
||||||
|
if (srcLand != null && destLand != null && (teleportFlags & (uint)TeleportFlags.ViaLure) == 0 && (teleportFlags & (uint)TeleportFlags.ViaGodlikeLure) == 0)
|
||||||
|
{
|
||||||
|
if (srcLand.LandData.LocalID == destLand.LandData.LocalID)
|
||||||
|
{
|
||||||
|
//TPing within the same parcel. If the landing point is restricted, block the TP.
|
||||||
|
//Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni.
|
||||||
|
if (destLand.LandData.LandingType == (byte)1 && destLand.LandData.UserLocation != Vector3.Zero && avatar.GodLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar.UUID) && destLand.LandData.OwnerID != avatar.UUID)
|
||||||
|
{
|
||||||
|
avatar.ControllingClient.SendAgentAlertMessage("Can't TP to the destination; landing point set.", false);
|
||||||
|
position = currentPos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Tping to a different parcel. Respect the landing point on the destination parcel.
|
||||||
|
if (destLand.LandData.LandingType == (byte)1 && destLand.LandData.UserLocation != Vector3.Zero && avatar.GodLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar.UUID) && destLand.LandData.OwnerID != avatar.UUID)
|
||||||
|
{
|
||||||
|
position = destLand.LandData.UserLocation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Get proper AVG Height
|
// TODO: Get proper AVG Height
|
||||||
float localAVHeight = 1.56f;
|
float localAVHeight = 1.56f;
|
||||||
float posZLimit = 22;
|
float posZLimit = 22;
|
||||||
|
|
|
@ -838,6 +838,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
pos.Y = crossedBorder.BorderLine.Z - 1;
|
pos.Y = crossedBorder.BorderLine.Z - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//If they're TP'ing in or logging in, we haven't had time to add any known child regions yet.
|
||||||
|
//This has the unfortunate consequence that if somebody is TP'ing who is already a child agent,
|
||||||
|
//they'll bypass the landing point. But I can't think of any decent way of fixing this.
|
||||||
|
if (KnownChildRegionHandles.Count == 0)
|
||||||
|
{
|
||||||
|
ILandObject land = m_scene.LandChannel.GetLandObject(pos.X, pos.Y);
|
||||||
|
if (land != null)
|
||||||
|
{
|
||||||
|
//Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni.
|
||||||
|
if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero && m_godlevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid) && land.LandData.OwnerID != m_uuid)
|
||||||
|
{
|
||||||
|
pos = land.LandData.UserLocation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (pos.X < 0 || pos.Y < 0 || pos.Z < 0)
|
if (pos.X < 0 || pos.Y < 0 || pos.Z < 0)
|
||||||
{
|
{
|
||||||
|
@ -973,6 +988,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public void Teleport(Vector3 pos)
|
public void Teleport(Vector3 pos)
|
||||||
{
|
{
|
||||||
bool isFlying = false;
|
bool isFlying = false;
|
||||||
|
|
||||||
if (m_physicsActor != null)
|
if (m_physicsActor != null)
|
||||||
isFlying = m_physicsActor.Flying;
|
isFlying = m_physicsActor.Flying;
|
||||||
|
|
||||||
|
@ -987,6 +1003,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
SendTerseUpdateToAllClients();
|
SendTerseUpdateToAllClients();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TeleportWithMomentum(Vector3 pos)
|
public void TeleportWithMomentum(Vector3 pos)
|
||||||
|
|
Loading…
Reference in New Issue