check land permitions on sit target for unscripted sits
parent
1665a0d636
commit
a285ff7e69
|
@ -70,6 +70,7 @@ namespace OpenSim.Framework
|
||||||
void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client);
|
void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client);
|
||||||
bool IsEitherBannedOrRestricted(UUID avatar);
|
bool IsEitherBannedOrRestricted(UUID avatar);
|
||||||
bool IsBannedFromLand(UUID avatar);
|
bool IsBannedFromLand(UUID avatar);
|
||||||
|
bool CanBeOnThisLand(UUID avatar, float posHeight);
|
||||||
bool IsRestrictedFromLand(UUID avatar);
|
bool IsRestrictedFromLand(UUID avatar);
|
||||||
bool IsInLandAccessList(UUID avatar);
|
bool IsInLandAccessList(UUID avatar);
|
||||||
void SendLandUpdateToClient(IClientAPI remote_client);
|
void SendLandUpdateToClient(IClientAPI remote_client);
|
||||||
|
|
|
@ -442,6 +442,19 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanBeOnThisLand(UUID avatar, float posHeight)
|
||||||
|
{
|
||||||
|
if (posHeight < LandChannel.BAN_LINE_SAFETY_HIEGHT && IsBannedFromLand(avatar))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (IsRestrictedFromLand(avatar))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public bool HasGroupAccess(UUID avatar)
|
public bool HasGroupAccess(UUID avatar)
|
||||||
{
|
{
|
||||||
if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup)
|
if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup)
|
||||||
|
|
|
@ -2247,6 +2247,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private bool CanEnterLandPosition(Vector3 testPos)
|
||||||
|
{
|
||||||
|
ILandObject land = m_scene.LandChannel.GetLandObject(testPos.X, testPos.Y);
|
||||||
|
|
||||||
|
if (land == null || land.LandData.Name == "NO_LAND")
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return land.CanBeOnThisLand(UUID,testPos.Z);
|
||||||
|
}
|
||||||
|
|
||||||
// status
|
// status
|
||||||
// < 0 ignore
|
// < 0 ignore
|
||||||
// 0 bad sit spot
|
// 0 bad sit spot
|
||||||
|
@ -2265,6 +2276,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (part == null)
|
if (part == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Vector3 targetPos = part.GetWorldPosition() + offset * part.GetWorldRotation();
|
||||||
|
if(!CanEnterLandPosition(targetPos))
|
||||||
|
{
|
||||||
|
ControllingClient.SendAlertMessage(" Sit position on restricted land, try another spot");
|
||||||
|
return;
|
||||||
|
}
|
||||||
// m_log.InfoFormat("physsit {0} {1}", offset.ToString(),Orientation.ToString());
|
// m_log.InfoFormat("physsit {0} {1}", offset.ToString(),Orientation.ToString());
|
||||||
|
|
||||||
RemoveFromPhysicalScene();
|
RemoveFromPhysicalScene();
|
||||||
|
|
Loading…
Reference in New Issue