diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 1c503aa..f6d4b40 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -94,8 +94,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
94 | 94 | ||
95 | // caches ExtendedLandData | 95 | // caches ExtendedLandData |
96 | private Cache parcelInfoCache; | 96 | private Cache parcelInfoCache; |
97 | private Dictionary<UUID, Vector3> forcedPosition = | 97 | |
98 | new Dictionary<UUID, Vector3>(); | 98 | /// <summary> |
99 | /// Record positions that avatar's are currently being forced to move to due to parcel entry restrictions. | ||
100 | /// </summary> | ||
101 | private Dictionary<UUID, Vector3> forcedPosition = new Dictionary<UUID, Vector3>(); | ||
99 | 102 | ||
100 | #region INonSharedRegionModule Members | 103 | #region INonSharedRegionModule Members |
101 | 104 | ||
@@ -224,22 +227,34 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
224 | //When the avatar walks into a ban line on the ground, it prevents getting stuck | 227 | //When the avatar walks into a ban line on the ground, it prevents getting stuck |
225 | agentData.ControlFlags = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | 228 | agentData.ControlFlags = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; |
226 | 229 | ||
227 | |||
228 | //Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines | 230 | //Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines |
229 | if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) < .2) | 231 | if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) < .2) |
230 | { | 232 | { |
231 | Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition)); | 233 | // m_log.DebugFormat( |
234 | // "[LAND MANAGEMENT MODULE]: Stopping force position of {0} because {1} is close enough to {2}", | ||
235 | // clientAvatar.Name, clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]); | ||
236 | |||
232 | forcedPosition.Remove(remoteClient.AgentId); | 237 | forcedPosition.Remove(remoteClient.AgentId); |
233 | } | 238 | } |
234 | //if we are far away, teleport | 239 | //if we are far away, teleport |
235 | else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) > 3) | 240 | else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) > 3) |
236 | { | 241 | { |
237 | Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition)); | 242 | Vector3 forcePosition = forcedPosition[remoteClient.AgentId]; |
238 | clientAvatar.Teleport(forcedPosition[remoteClient.AgentId]); | 243 | // m_log.DebugFormat( |
244 | // "[LAND MANAGEMENT MODULE]: Teleporting out {0} because {1} is too far from avatar position {2}", | ||
245 | // clientAvatar.Name, clientAvatar.AbsolutePosition, forcePosition); | ||
246 | |||
247 | m_scene.RequestTeleportLocation(remoteClient, m_scene.RegionInfo.RegionHandle, | ||
248 | forcePosition, clientAvatar.Lookat, (uint)Constants.TeleportFlags.ForceRedirect); | ||
249 | |||
239 | forcedPosition.Remove(remoteClient.AgentId); | 250 | forcedPosition.Remove(remoteClient.AgentId); |
240 | } | 251 | } |
241 | else | 252 | else |
242 | { | 253 | { |
254 | // m_log.DebugFormat( | ||
255 | // "[LAND MANAGEMENT MODULE]: Forcing {0} from {1} to {2}", | ||
256 | // clientAvatar.Name, clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]); | ||
257 | |||
243 | //Forces them toward the forced position we want if they aren't there yet | 258 | //Forces them toward the forced position we want if they aren't there yet |
244 | agentData.UseClientAgentPosition = true; | 259 | agentData.UseClientAgentPosition = true; |
245 | agentData.ClientAgentPosition = forcedPosition[remoteClient.AgentId]; | 260 | agentData.ClientAgentPosition = forcedPosition[remoteClient.AgentId]; |