diff options
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 29 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 1 |
2 files changed, 15 insertions, 15 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 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 94a773d..c5396d5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -4740,7 +4740,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4740 | Vector3 nearestRegionEdgePoint = GetNearestRegionEdgePosition(avatar); | 4740 | Vector3 nearestRegionEdgePoint = GetNearestRegionEdgePosition(avatar); |
4741 | //Debug.WriteLine("They are really in a place they don't belong, sending them to: " + nearestRegionEdgePoint.ToString()); | 4741 | //Debug.WriteLine("They are really in a place they don't belong, sending them to: " + nearestRegionEdgePoint.ToString()); |
4742 | return nearestRegionEdgePoint; | 4742 | return nearestRegionEdgePoint; |
4743 | return null; | ||
4744 | } | 4743 | } |
4745 | 4744 | ||
4746 | private Vector3 GetParcelCenterAtGround(ILandObject parcel) | 4745 | private Vector3 GetParcelCenterAtGround(ILandObject parcel) |