Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
commit
8ea83f119c
|
@ -70,6 +70,7 @@ namespace OpenSim.Framework
|
|||
void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client);
|
||||
bool IsEitherBannedOrRestricted(UUID avatar);
|
||||
bool IsBannedFromLand(UUID avatar);
|
||||
bool CanBeOnThisLand(UUID avatar, float posHeight);
|
||||
bool IsRestrictedFromLand(UUID avatar);
|
||||
bool IsInLandAccessList(UUID avatar);
|
||||
void SendLandUpdateToClient(IClientAPI remote_client);
|
||||
|
|
|
@ -442,6 +442,19 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
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)
|
||||
{
|
||||
if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup)
|
||||
|
|
|
@ -2247,6 +2247,17 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
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
|
||||
// < 0 ignore
|
||||
// 0 bad sit spot
|
||||
|
@ -2265,6 +2276,12 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (part == null)
|
||||
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());
|
||||
|
||||
RemoveFromPhysicalScene();
|
||||
|
|
Loading…
Reference in New Issue