Implement PERMISSION_TELEPORT and the needed checks to make it work.
Old auth system still works as well.avinationmerge
parent
9589a09eda
commit
bd87eb90d1
|
@ -4641,23 +4641,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
ScenePresence presence = World.GetScenePresence(agentId);
|
||||
if (presence != null && presence.PresenceType != PresenceType.Npc)
|
||||
{
|
||||
// agent must not be a god
|
||||
if (presence.GodLevel >= 200) return;
|
||||
|
||||
if (destination == String.Empty)
|
||||
destination = World.RegionInfo.RegionName;
|
||||
|
||||
// agent must be over the owners land
|
||||
if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID)
|
||||
if (m_item.PermsGranter == agentId)
|
||||
{
|
||||
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0)
|
||||
{
|
||||
DoLLTeleport(presence, destination, targetPos, targetLookAt);
|
||||
}
|
||||
else // or must be wearing the prim
|
||||
{
|
||||
}
|
||||
|
||||
// agent must be wearing the object
|
||||
if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID)
|
||||
{
|
||||
DoLLTeleport(presence, destination, targetPos, targetLookAt);
|
||||
}
|
||||
else
|
||||
{
|
||||
// agent must not be a god
|
||||
if (presence.GodLevel >= 200) return;
|
||||
|
||||
// agent must be over the owners land
|
||||
ILandObject agentLand = World.LandChannel.GetLandObject(presence.AbsolutePosition);
|
||||
ILandObject objectLand = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
|
||||
if (m_host.OwnerID == objectLand.LandData.OwnerID && m_host.OwnerID == agentLand.LandData.OwnerID)
|
||||
{
|
||||
DoLLTeleport(presence, destination, targetPos, targetLookAt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,6 +80,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
public const int PERMISSION_CHANGE_PERMISSIONS = 512;
|
||||
public const int PERMISSION_TRACK_CAMERA = 1024;
|
||||
public const int PERMISSION_CONTROL_CAMERA = 2048;
|
||||
public const int PERMISSION_TELEPORT = 4096;
|
||||
|
||||
public const int AGENT_FLYING = 1;
|
||||
public const int AGENT_ATTACHMENTS = 2;
|
||||
|
|
Loading…
Reference in New Issue