*Added Ban Lines around parcels for banned avatars, but there is no actual blocking done yet.

*Made the OnSignificantClientMovement distance from .02 to .45 to make it easier on the server.
afrisby
mingchen 2007-12-19 04:28:54 +00:00
parent 16174dac6e
commit bd16dddce5
4 changed files with 32 additions and 2 deletions

View File

@ -53,7 +53,7 @@ namespace OpenSim.Framework
public int simwideArea = 0;
public int salePrice = 0; //Unemeplemented. Parcels price.
public Parcel.ParcelStatus landStatus = Parcel.ParcelStatus.Leased;
public uint landFlags = (uint) Parcel.ParcelFlags.AllowFly | (uint) Parcel.ParcelFlags.AllowLandmark |
(uint) Parcel.ParcelFlags.AllowAllObjectEntry |
(uint) Parcel.ParcelFlags.AllowDeedToGroup | (uint) Parcel.ParcelFlags.AllowTerraform |

View File

@ -227,6 +227,18 @@ namespace OpenSim.Region.Environment.LandManagement
}
}
public bool isBannedFromLand(ParcelManager.ParcelAccessEntry entry, IClientAPI remote_client)
{
if ((this.landData.landFlags & (uint)Parcel.ParcelFlags.UseBanList) > 0)
{
if (this.landData.parcelAccessList.Contains(entry))
{
//They are banned, so lets send them a notice about this parcel
return true;
}
}
return false;
}
public void sendLandUpdateToClient(IClientAPI remote_client)
{
sendLandProperties(0, false, 0, remote_client);

View File

@ -590,6 +590,22 @@ namespace OpenSim.Region.Environment.LandManagement
addLandObject(fullSimParcel);
}
public void sendOutBannedNotices(IClientAPI avatar)
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = avatar.AgentId;
entry.Flags = ParcelManager.AccessList.Ban;
entry.Time = new DateTime();
foreach (Land checkBan in landList.Values)
{
if (checkBan.isBannedFromLand(entry, avatar))
{
checkBan.sendLandProperties(-30000, false, (int)ParcelManager.ParcelResult.Single, avatar);
}
}
}
public void sendLandUpdate(ScenePresence avatar)
{
Land over = getLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))),
@ -599,6 +615,7 @@ namespace OpenSim.Region.Environment.LandManagement
{
over.sendLandUpdateToClient(avatar.ControllingClient);
}
}
public void handleSignificantClientMovement(IClientAPI remote_client)
@ -608,6 +625,7 @@ namespace OpenSim.Region.Environment.LandManagement
if (clientAvatar != null)
{
sendLandUpdate(clientAvatar);
sendOutBannedNotices(remote_client);
}
}

View File

@ -1181,7 +1181,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
protected void CheckForSignificantMovement()
{
if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > 0.02)
if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > 0.5)
{
posLastSignificantMove = AbsolutePosition;
if (OnSignificantClientMovement != null)