Fix parcel bans to work only on the avatars they're supposed to work on instead of pushing all avatars, even the ones that are allowed.
parent
ae9c4a4d11
commit
22144eb8f7
|
@ -88,7 +88,8 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
|
|
||||||
// caches ExtendedLandData
|
// caches ExtendedLandData
|
||||||
private Cache parcelInfoCache;
|
private Cache parcelInfoCache;
|
||||||
private Vector3? forcedPosition = null;
|
private Dictionary<UUID, Vector3> forcedPosition =
|
||||||
|
new Dictionary<UUID, Vector3>();
|
||||||
|
|
||||||
#region INonSharedRegionModule Members
|
#region INonSharedRegionModule Members
|
||||||
|
|
||||||
|
@ -177,7 +178,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData)
|
void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData)
|
||||||
{
|
{
|
||||||
//If we are forcing a position for them to go
|
//If we are forcing a position for them to go
|
||||||
if (forcedPosition != null)
|
if (forcedPosition.ContainsKey(remoteClient.AgentId))
|
||||||
{
|
{
|
||||||
ScenePresence clientAvatar = m_scene.GetScenePresence(remoteClient.AgentId);
|
ScenePresence clientAvatar = m_scene.GetScenePresence(remoteClient.AgentId);
|
||||||
|
|
||||||
|
@ -187,23 +188,23 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
|
|
||||||
|
|
||||||
//Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines
|
//Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines
|
||||||
if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) < .2)
|
if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) < .2)
|
||||||
{
|
{
|
||||||
Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition));
|
Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition));
|
||||||
forcedPosition = null;
|
forcedPosition.Remove(remoteClient.AgentId);
|
||||||
}
|
}
|
||||||
//if we are far away, teleport
|
//if we are far away, teleport
|
||||||
else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) > 3)
|
else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) > 3)
|
||||||
{
|
{
|
||||||
Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition));
|
Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition));
|
||||||
clientAvatar.Teleport(forcedPosition.Value);
|
clientAvatar.Teleport(forcedPosition[remoteClient.AgentId]);
|
||||||
forcedPosition = null;
|
forcedPosition.Remove(remoteClient.AgentId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Forces them toward the forced position we want if they aren't there yet
|
//Forces them toward the forced position we want if they aren't there yet
|
||||||
agentData.UseClientAgentPosition = true;
|
agentData.UseClientAgentPosition = true;
|
||||||
agentData.ClientAgentPosition = forcedPosition.Value;
|
agentData.ClientAgentPosition = forcedPosition[remoteClient.AgentId];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -326,7 +327,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
if (m_scene.Permissions.IsGod(avatar.UUID)) return;
|
if (m_scene.Permissions.IsGod(avatar.UUID)) return;
|
||||||
if (position.HasValue)
|
if (position.HasValue)
|
||||||
{
|
{
|
||||||
forcedPosition = position;
|
forcedPosition[avatar.ControllingClient.AgentId] = (Vector3)position;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -457,7 +458,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
parcel.IsBannedFromLand(clientAvatar.UUID))
|
parcel.IsBannedFromLand(clientAvatar.UUID))
|
||||||
{
|
{
|
||||||
//once we've sent the message once, keep going toward the target until we are done
|
//once we've sent the message once, keep going toward the target until we are done
|
||||||
if (forcedPosition == null)
|
if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId))
|
||||||
{
|
{
|
||||||
SendYouAreBannedNotice(clientAvatar);
|
SendYouAreBannedNotice(clientAvatar);
|
||||||
ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar));
|
ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar));
|
||||||
|
@ -466,7 +467,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
else if (parcel.IsRestrictedFromLand(clientAvatar.UUID))
|
else if (parcel.IsRestrictedFromLand(clientAvatar.UUID))
|
||||||
{
|
{
|
||||||
//once we've sent the message once, keep going toward the target until we are done
|
//once we've sent the message once, keep going toward the target until we are done
|
||||||
if (forcedPosition == null)
|
if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId))
|
||||||
{
|
{
|
||||||
SendYouAreRestrictedNotice(clientAvatar);
|
SendYouAreRestrictedNotice(clientAvatar);
|
||||||
ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar));
|
ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar));
|
||||||
|
@ -475,7 +476,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//when we are finally in a safe place, lets release the forced position lock
|
//when we are finally in a safe place, lets release the forced position lock
|
||||||
forcedPosition = null;
|
forcedPosition.Remove(clientAvatar.ControllingClient.AgentId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4740,7 +4740,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
Vector3 nearestRegionEdgePoint = GetNearestRegionEdgePosition(avatar);
|
Vector3 nearestRegionEdgePoint = GetNearestRegionEdgePosition(avatar);
|
||||||
//Debug.WriteLine("They are really in a place they don't belong, sending them to: " + nearestRegionEdgePoint.ToString());
|
//Debug.WriteLine("They are really in a place they don't belong, sending them to: " + nearestRegionEdgePoint.ToString());
|
||||||
return nearestRegionEdgePoint;
|
return nearestRegionEdgePoint;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Vector3 GetParcelCenterAtGround(ILandObject parcel)
|
private Vector3 GetParcelCenterAtGround(ILandObject parcel)
|
||||||
|
|
Loading…
Reference in New Issue