diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-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 5bd72ee..6e0072e 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -90,7 +90,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
90 | 90 | ||
91 | // caches ExtendedLandData | 91 | // caches ExtendedLandData |
92 | private Cache parcelInfoCache; | 92 | private Cache parcelInfoCache; |
93 | private Vector3? forcedPosition = null; | 93 | private Dictionary<UUID, Vector3> forcedPosition = |
94 | new Dictionary<UUID, Vector3>(); | ||
94 | 95 | ||
95 | #region INonSharedRegionModule Members | 96 | #region INonSharedRegionModule Members |
96 | 97 | ||
@@ -185,7 +186,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
185 | void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) | 186 | void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) |
186 | { | 187 | { |
187 | //If we are forcing a position for them to go | 188 | //If we are forcing a position for them to go |
188 | if (forcedPosition != null) | 189 | if (forcedPosition.ContainsKey(remoteClient.AgentId)) |
189 | { | 190 | { |
190 | ScenePresence clientAvatar = m_scene.GetScenePresence(remoteClient.AgentId); | 191 | ScenePresence clientAvatar = m_scene.GetScenePresence(remoteClient.AgentId); |
191 | 192 | ||
@@ -195,23 +196,23 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
195 | 196 | ||
196 | 197 | ||
197 | //Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines | 198 | //Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines |
198 | if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) < .2) | 199 | if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) < .2) |
199 | { | 200 | { |
200 | Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); | 201 | Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition)); |
201 | forcedPosition = null; | 202 | forcedPosition.Remove(remoteClient.AgentId); |
202 | } | 203 | } |
203 | //if we are far away, teleport | 204 | //if we are far away, teleport |
204 | else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) > 3) | 205 | else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) > 3) |
205 | { | 206 | { |
206 | Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); | 207 | Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition)); |
207 | clientAvatar.Teleport(forcedPosition.Value); | 208 | clientAvatar.Teleport(forcedPosition[remoteClient.AgentId]); |
208 | forcedPosition = null; | 209 | forcedPosition.Remove(remoteClient.AgentId); |
209 | } | 210 | } |
210 | else | 211 | else |
211 | { | 212 | { |
212 | //Forces them toward the forced position we want if they aren't there yet | 213 | //Forces them toward the forced position we want if they aren't there yet |
213 | agentData.UseClientAgentPosition = true; | 214 | agentData.UseClientAgentPosition = true; |
214 | agentData.ClientAgentPosition = forcedPosition.Value; | 215 | agentData.ClientAgentPosition = forcedPosition[remoteClient.AgentId]; |
215 | } | 216 | } |
216 | } | 217 | } |
217 | } | 218 | } |
@@ -334,7 +335,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
334 | if (m_scene.Permissions.IsGod(avatar.UUID)) return; | 335 | if (m_scene.Permissions.IsGod(avatar.UUID)) return; |
335 | if (position.HasValue) | 336 | if (position.HasValue) |
336 | { | 337 | { |
337 | forcedPosition = position; | 338 | forcedPosition[avatar.ControllingClient.AgentId] = (Vector3)position; |
338 | } | 339 | } |
339 | } | 340 | } |
340 | 341 | ||
@@ -465,7 +466,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
465 | parcel.IsBannedFromLand(clientAvatar.UUID)) | 466 | parcel.IsBannedFromLand(clientAvatar.UUID)) |
466 | { | 467 | { |
467 | //once we've sent the message once, keep going toward the target until we are done | 468 | //once we've sent the message once, keep going toward the target until we are done |
468 | if (forcedPosition == null) | 469 | if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) |
469 | { | 470 | { |
470 | SendYouAreBannedNotice(clientAvatar); | 471 | SendYouAreBannedNotice(clientAvatar); |
471 | ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); | 472 | ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); |
@@ -474,7 +475,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
474 | else if (parcel.IsRestrictedFromLand(clientAvatar.UUID)) | 475 | else if (parcel.IsRestrictedFromLand(clientAvatar.UUID)) |
475 | { | 476 | { |
476 | //once we've sent the message once, keep going toward the target until we are done | 477 | //once we've sent the message once, keep going toward the target until we are done |
477 | if (forcedPosition == null) | 478 | if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) |
478 | { | 479 | { |
479 | SendYouAreRestrictedNotice(clientAvatar); | 480 | SendYouAreRestrictedNotice(clientAvatar); |
480 | ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); | 481 | ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); |
@@ -483,7 +484,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
483 | else | 484 | else |
484 | { | 485 | { |
485 | //when we are finally in a safe place, lets release the forced position lock | 486 | //when we are finally in a safe place, lets release the forced position lock |
486 | forcedPosition = null; | 487 | forcedPosition.Remove(clientAvatar.ControllingClient.AgentId); |
487 | } | 488 | } |
488 | } | 489 | } |
489 | } | 490 | } |