diff options
author | Melanie | 2010-11-09 20:18:36 +0100 |
---|---|---|
committer | Melanie | 2010-11-09 22:15:59 +0000 |
commit | 22144eb8f74207fedb1042cbcf9f7ade3e2eca59 (patch) | |
tree | 6e56074b4658fb43e7f6283abf531e89ec69bbb7 /OpenSim/Region/CoreModules | |
parent | Formatting cleanup. (diff) | |
download | opensim-SC_OLD-22144eb8f74207fedb1042cbcf9f7ade3e2eca59.zip opensim-SC_OLD-22144eb8f74207fedb1042cbcf9f7ade3e2eca59.tar.gz opensim-SC_OLD-22144eb8f74207fedb1042cbcf9f7ade3e2eca59.tar.bz2 opensim-SC_OLD-22144eb8f74207fedb1042cbcf9f7ade3e2eca59.tar.xz |
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.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 634685a..695202f 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -88,7 +88,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
88 | 88 | ||
89 | // caches ExtendedLandData | 89 | // caches ExtendedLandData |
90 | private Cache parcelInfoCache; | 90 | private Cache parcelInfoCache; |
91 | private Vector3? forcedPosition = null; | 91 | private Dictionary<UUID, Vector3> forcedPosition = |
92 | new Dictionary<UUID, Vector3>(); | ||
92 | 93 | ||
93 | #region INonSharedRegionModule Members | 94 | #region INonSharedRegionModule Members |
94 | 95 | ||
@@ -177,7 +178,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
177 | void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) | 178 | void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) |
178 | { | 179 | { |
179 | //If we are forcing a position for them to go | 180 | //If we are forcing a position for them to go |
180 | if (forcedPosition != null) | 181 | if (forcedPosition.ContainsKey(remoteClient.AgentId)) |
181 | { | 182 | { |
182 | ScenePresence clientAvatar = m_scene.GetScenePresence(remoteClient.AgentId); | 183 | ScenePresence clientAvatar = m_scene.GetScenePresence(remoteClient.AgentId); |
183 | 184 | ||
@@ -187,23 +188,23 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
187 | 188 | ||
188 | 189 | ||
189 | //Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines | 190 | //Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines |
190 | if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) < .2) | 191 | if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) < .2) |
191 | { | 192 | { |
192 | Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); | 193 | Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition)); |
193 | forcedPosition = null; | 194 | forcedPosition.Remove(remoteClient.AgentId); |
194 | } | 195 | } |
195 | //if we are far away, teleport | 196 | //if we are far away, teleport |
196 | else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) > 3) | 197 | else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) > 3) |
197 | { | 198 | { |
198 | Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); | 199 | Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition)); |
199 | clientAvatar.Teleport(forcedPosition.Value); | 200 | clientAvatar.Teleport(forcedPosition[remoteClient.AgentId]); |
200 | forcedPosition = null; | 201 | forcedPosition.Remove(remoteClient.AgentId); |
201 | } | 202 | } |
202 | else | 203 | else |
203 | { | 204 | { |
204 | //Forces them toward the forced position we want if they aren't there yet | 205 | //Forces them toward the forced position we want if they aren't there yet |
205 | agentData.UseClientAgentPosition = true; | 206 | agentData.UseClientAgentPosition = true; |
206 | agentData.ClientAgentPosition = forcedPosition.Value; | 207 | agentData.ClientAgentPosition = forcedPosition[remoteClient.AgentId]; |
207 | } | 208 | } |
208 | } | 209 | } |
209 | } | 210 | } |
@@ -326,7 +327,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
326 | if (m_scene.Permissions.IsGod(avatar.UUID)) return; | 327 | if (m_scene.Permissions.IsGod(avatar.UUID)) return; |
327 | if (position.HasValue) | 328 | if (position.HasValue) |
328 | { | 329 | { |
329 | forcedPosition = position; | 330 | forcedPosition[avatar.ControllingClient.AgentId] = (Vector3)position; |
330 | } | 331 | } |
331 | } | 332 | } |
332 | 333 | ||
@@ -457,7 +458,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
457 | parcel.IsBannedFromLand(clientAvatar.UUID)) | 458 | parcel.IsBannedFromLand(clientAvatar.UUID)) |
458 | { | 459 | { |
459 | //once we've sent the message once, keep going toward the target until we are done | 460 | //once we've sent the message once, keep going toward the target until we are done |
460 | if (forcedPosition == null) | 461 | if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) |
461 | { | 462 | { |
462 | SendYouAreBannedNotice(clientAvatar); | 463 | SendYouAreBannedNotice(clientAvatar); |
463 | ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); | 464 | ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); |
@@ -466,7 +467,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
466 | else if (parcel.IsRestrictedFromLand(clientAvatar.UUID)) | 467 | else if (parcel.IsRestrictedFromLand(clientAvatar.UUID)) |
467 | { | 468 | { |
468 | //once we've sent the message once, keep going toward the target until we are done | 469 | //once we've sent the message once, keep going toward the target until we are done |
469 | if (forcedPosition == null) | 470 | if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) |
470 | { | 471 | { |
471 | SendYouAreRestrictedNotice(clientAvatar); | 472 | SendYouAreRestrictedNotice(clientAvatar); |
472 | ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); | 473 | ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); |
@@ -475,7 +476,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
475 | else | 476 | else |
476 | { | 477 | { |
477 | //when we are finally in a safe place, lets release the forced position lock | 478 | //when we are finally in a safe place, lets release the forced position lock |
478 | forcedPosition = null; | 479 | forcedPosition.Remove(clientAvatar.ControllingClient.AgentId); |
479 | } | 480 | } |
480 | } | 481 | } |
481 | } | 482 | } |