aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-02-23 22:56:42 +0000
committerJustin Clark-Casey (justincc)2012-02-23 22:56:42 +0000
commit90ea00a1098c918d5eb5a2be2793b109c6622a35 (patch)
tree9c7749d7addeaa21aae6467a1fd016fba3e13986 /OpenSim/Region/CoreModules/World
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC_OLD-90ea00a1098c918d5eb5a2be2793b109c6622a35.zip
opensim-SC_OLD-90ea00a1098c918d5eb5a2be2793b109c6622a35.tar.gz
opensim-SC_OLD-90ea00a1098c918d5eb5a2be2793b109c6622a35.tar.bz2
opensim-SC_OLD-90ea00a1098c918d5eb5a2be2793b109c6622a35.tar.xz
Try to resolve some problems with viewers crashing after hitting parcel banlines or freezing on the banline.
This involves 1) On forcible teleport, call m_scene.RequestTeleportLocation() rather than ScenePresence.Teleport() - only EntityTransferModule now should call SP.Teleport() 2) When avatar is being forcibly moved due to banlines, use a 'stop movement' tolerance of 0.2 to requested position rather than 1 This prevents the avatar sometimes being stuck to banlines until they teleport somewhere else. This aims to fix some problems in http://opensimulator.org/mantis/view.php?id=5822
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs27
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];