Revert "Adds land ejection and freezing. Adds more checks to land banning."

This reverts commit 44d523518a.
avinationmerge
Melanie 2010-03-09 22:28:52 +00:00
parent 49baf090cd
commit 06e351f1ef
1 changed files with 25 additions and 103 deletions

View File

@ -161,10 +161,6 @@ namespace OpenSim.Region.CoreModules.World.Land
client.OnParcelInfoRequest += ClientOnParcelInfoRequest; client.OnParcelInfoRequest += ClientOnParcelInfoRequest;
client.OnParcelDwellRequest += ClientOnParcelDwellRequest; client.OnParcelDwellRequest += ClientOnParcelDwellRequest;
client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup; client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup;
client.OnParcelGodMark += ClientOnParcelGodMark;
client.OnSimWideDeletes += ClientOnSimWideDeletes;
client.OnParcelFreezeUser += ClientOnParcelFreezeUser;
client.OnParcelEjectUser += ClientOnParcelEjectUser;
EntityBase presenceEntity; EntityBase presenceEntity;
if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence) if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence)
@ -273,7 +269,22 @@ namespace OpenSim.Region.CoreModules.World.Land
return parcelsNear; return parcelsNear;
} }
public void KickUserOffOfParcel(ScenePresence avatar)
{
if (avatar.GodLevel == 0)
{
List<ILandObject> parcelsNear = ParcelsNearPoint(avatar.AbsolutePosition);
foreach (ILandObject check in parcelsNear)
{
if (check.IsEitherBannedOrRestricted(avatar.UUID) != true)
{
Vector3 target = check.LandData.UserLocation;
avatar.TeleportWithMomentum(target);
return;
}
}
}
}
public void MoveUserOutOfParcel(ScenePresence avatar) public void MoveUserOutOfParcel(ScenePresence avatar)
{ {
if (avatar.GodLevel == 0) if (avatar.GodLevel == 0)
@ -290,6 +301,7 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
Vector3 target = new Vector3(avatar.AbsolutePosition.X + x, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); Vector3 target = new Vector3(avatar.AbsolutePosition.X + x, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z);
avatar.TeleportWithMomentum(target); avatar.TeleportWithMomentum(target);
avatar.Velocity = new Vector3(-avatar.Velocity.X - 5, avatar.Velocity.Y, avatar.Velocity.Z);
return; return;
} }
} }
@ -303,73 +315,11 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
Vector3 target = new Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y + y, avatar.AbsolutePosition.Z); Vector3 target = new Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y + y, avatar.AbsolutePosition.Z);
avatar.TeleportWithMomentum(target); avatar.TeleportWithMomentum(target);
avatar.Velocity = new Vector3(avatar.Velocity.X, -avatar.Velocity.Y - 5, avatar.Velocity.Z);
return; return;
} }
} }
} }
List<ILandObject> allParcels = new List<ILandObject>();
allParcels = AllParcels();
if (allParcels.Count != 1)
{
foreach (ILandObject parcel in allParcels)
{
if (parcel.IsEitherBannedOrRestricted(avatar.UUID) != true)
{
Vector3 temptarget = parcel.LandData.UserLocation;
if (parcel.ContainsPoint((int)parcel.LandData.UserLocation.X, (int)parcel.LandData.UserLocation.Y))
{
avatar.TeleportWithMomentum(temptarget);
return;
}
else
{
for (int x = 0; x <= Constants.RegionSize / 3; x += 3)
{
for (int y = 0; y <= Constants.RegionSize / 3; y += 3)
{
if (parcel.ContainsPoint(x, y))
{
temptarget = new Vector3(x, y, avatar.AbsolutePosition.Z);
avatar.TeleportWithMomentum(temptarget);
return;
}
}
}
}
}
}
}
//Move to region side
if (avatar.AbsolutePosition.X > avatar.AbsolutePosition.Y)
{
if (avatar.AbsolutePosition.X > .5 * Constants.RegionSize)
{
Vector3 target = new Vector3(Constants.RegionSize, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); ;
avatar.TeleportWithMomentum(target);
return;
}
else
{
Vector3 target = new Vector3(0, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); ;
avatar.TeleportWithMomentum(target);
return;
}
}
else
{
if (avatar.AbsolutePosition.Y > .5 * Constants.RegionSize)
{
Vector3 target = new Vector3(avatar.AbsolutePosition.X, Constants.RegionSize, avatar.AbsolutePosition.Z); ;
avatar.TeleportWithMomentum(target);
return;
}
else
{
Vector3 target = new Vector3(avatar.AbsolutePosition.X, 0, avatar.AbsolutePosition.Z); ;
avatar.TeleportWithMomentum(target);
return;
}
}
} }
} }
@ -412,12 +362,12 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
if (checkBan.IsRestrictedFromLand(avatar.ControllingClient.AgentId)) if (checkBan.IsRestrictedFromLand(avatar.ControllingClient.AgentId))
{ {
checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, true, (int)ParcelResult.Multiple, avatar.ControllingClient); checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar.ControllingClient);
return; return;
} }
if (checkBan.IsBannedFromLand(avatar.ControllingClient.AgentId)) if (checkBan.IsBannedFromLand(avatar.ControllingClient.AgentId))
{ {
checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, true, (int)ParcelResult.Multiple, avatar.ControllingClient); checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar.ControllingClient);
return; return;
} }
} }
@ -432,12 +382,12 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
if (checkBan.IsRestrictedFromLand(avatar.ControllingClient.AgentId)) if (checkBan.IsRestrictedFromLand(avatar.ControllingClient.AgentId))
{ {
checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, true, (int)ParcelResult.Multiple, avatar.ControllingClient); checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar.ControllingClient);
return; return;
} }
if (checkBan.IsBannedFromLand(avatar.ControllingClient.AgentId)) if (checkBan.IsBannedFromLand(avatar.ControllingClient.AgentId))
{ {
checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, true, (int)ParcelResult.Multiple, avatar.ControllingClient); checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar.ControllingClient);
return; return;
} }
} }
@ -545,18 +495,6 @@ namespace OpenSim.Region.CoreModules.World.Land
if (m_scene.Permissions.CanEditParcel(agentID, land)) if (m_scene.Permissions.CanEditParcel(agentID, land))
{ {
land.UpdateAccessList(flags, entries, remote_client); land.UpdateAccessList(flags, entries, remote_client);
List<ScenePresence> presences = ((Scene)remote_client.Scene).GetAvatars();
foreach (ScenePresence presence in presences)
{
land = GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
if (land != null)
{
if (land.IsEitherBannedOrRestricted(presence.UUID))
{
MoveUserOutOfParcel(presence);
}
}
}
} }
} }
else else
@ -1122,25 +1060,7 @@ namespace OpenSim.Region.CoreModules.World.Land
m_landList.TryGetValue(localID, out land); m_landList.TryGetValue(localID, out land);
} }
if (land != null) if (land != null) land.UpdateLandProperties(args, remote_client);
{
land.UpdateLandProperties(args, remote_client);
if ((args.ParcelFlags & (uint)(ParcelFlags.UseBanList | ParcelFlags.UseAccessList | ParcelFlags.UseAccessGroup | ParcelFlags.UsePassList)) != 0)
{
List<ScenePresence> presences = ((Scene)remote_client.Scene).GetAvatars();
foreach (ScenePresence presence in presences)
{
land = GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
if (land != null)
{
if (land.IsEitherBannedOrRestricted(presence.UUID))
{
MoveUserOutOfParcel(presence);
}
}
}
}
}
} }
public void ClientOnParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client) public void ClientOnParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client)
@ -1552,6 +1472,7 @@ namespace OpenSim.Region.CoreModules.World.Land
UpdateLandObject(localID, land.LandData); UpdateLandObject(localID, land.LandData);
} }
public void ClientOnParcelGodMark(IClientAPI client, UUID god, int landID) public void ClientOnParcelGodMark(IClientAPI client, UUID god, int landID)
{ {
ILandObject land = null; ILandObject land = null;
@ -1567,6 +1488,7 @@ namespace OpenSim.Region.CoreModules.World.Land
land.LandData.Name = DefaultGodParcelName; land.LandData.Name = DefaultGodParcelName;
land.SendLandUpdateToAvatarsOverMe(); land.SendLandUpdateToAvatarsOverMe();
} }
private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID) private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID)
{ {
ScenePresence SP; ScenePresence SP;