diff options
author | John Hurliman | 2009-10-28 14:13:17 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-28 14:13:17 -0700 |
commit | b81c829576dd916c0a7bf141919f5e13f025d818 (patch) | |
tree | 92e537b80a4cded51d1cccd2a3ba4dfb12c1665c | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-b81c829576dd916c0a7bf141919f5e13f025d818.zip opensim-SC_OLD-b81c829576dd916c0a7bf141919f5e13f025d818.tar.gz opensim-SC_OLD-b81c829576dd916c0a7bf141919f5e13f025d818.tar.bz2 opensim-SC_OLD-b81c829576dd916c0a7bf141919f5e13f025d818.tar.xz |
* Standalone logins will now go through the sequence of "requested region, default region, any region" before giving up
* Hip offset should have been added not subtracted (it's a negative offset). This puts avatar feet closer to the ground
* Improved duplicate checking for terse updates. This should reduce bandwidth and walking through walls
-rw-r--r-- | OpenSim/Client/Linden/LLStandaloneLoginModule.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/Services/LoginService.cs | 26 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 21 | ||||
-rw-r--r-- | bin/OpenMetaverseTypes.dll | bin | 102400 -> 102400 bytes |
6 files changed, 40 insertions, 32 deletions
diff --git a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs index bb9b623..8739ce5 100644 --- a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs +++ b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs | |||
@@ -231,6 +231,10 @@ namespace OpenSim.Client.Linden | |||
231 | { | 231 | { |
232 | return scene.RegionInfo; | 232 | return scene.RegionInfo; |
233 | } | 233 | } |
234 | else if (m_scenes.Count > 0) | ||
235 | { | ||
236 | return m_scenes[0].RegionInfo; | ||
237 | } | ||
234 | return null; | 238 | return null; |
235 | } | 239 | } |
236 | 240 | ||
diff --git a/OpenSim/Framework/Communications/Services/LoginService.cs b/OpenSim/Framework/Communications/Services/LoginService.cs index 922cd49..b652299 100644 --- a/OpenSim/Framework/Communications/Services/LoginService.cs +++ b/OpenSim/Framework/Communications/Services/LoginService.cs | |||
@@ -1031,30 +1031,26 @@ namespace OpenSim.Framework.Communications.Services | |||
1031 | return true; | 1031 | return true; |
1032 | } | 1032 | } |
1033 | 1033 | ||
1034 | // StartLocation not available, send him to a nearby region instead | 1034 | // Get the default region handle |
1035 | // regionInfo = m_gridService.RequestClosestRegion(""); | 1035 | ulong defaultHandle = Utils.UIntsToLong(m_defaultHomeX * Constants.RegionSize, m_defaultHomeY * Constants.RegionSize); |
1036 | //m_log.InfoFormat("[LOGIN]: StartLocation not available sending to region {0}", regionInfo.regionName); | ||
1037 | 1036 | ||
1038 | // Send him to default region instead | 1037 | // If we haven't already tried the default region, reset regionInfo |
1039 | ulong defaultHandle = (((ulong)m_defaultHomeX * Constants.RegionSize) << 32) | | 1038 | if (regionInfo != null && defaultHandle != regionInfo.RegionHandle) |
1040 | ((ulong)m_defaultHomeY * Constants.RegionSize); | 1039 | regionInfo = null; |
1041 | 1040 | ||
1042 | if ((regionInfo != null) && (defaultHandle == regionInfo.RegionHandle)) | 1041 | if (regionInfo == null) |
1043 | { | 1042 | { |
1044 | m_log.ErrorFormat("[LOGIN]: Not trying the default region since this is the same as the selected region"); | 1043 | m_log.Error("[LOGIN]: Sending user to default region " + defaultHandle + " instead"); |
1045 | return false; | 1044 | regionInfo = GetRegionInfo(defaultHandle); |
1046 | } | 1045 | } |
1047 | 1046 | ||
1048 | m_log.Error("[LOGIN]: Sending user to default region " + defaultHandle + " instead"); | ||
1049 | regionInfo = GetRegionInfo(defaultHandle); | ||
1050 | |||
1051 | if (regionInfo == null) | 1047 | if (regionInfo == null) |
1052 | { | 1048 | { |
1053 | m_log.ErrorFormat("[LOGIN]: No default region available. Aborting."); | 1049 | m_log.ErrorFormat("[LOGIN]: Sending user to any region"); |
1054 | return false; | 1050 | regionInfo = RequestClosestRegion(String.Empty); |
1055 | } | 1051 | } |
1056 | 1052 | ||
1057 | theUser.CurrentAgent.Position = new Vector3(128, 128, 0); | 1053 | theUser.CurrentAgent.Position = new Vector3(128f, 128f, 0f); |
1058 | response.StartLocation = "safe"; | 1054 | response.StartLocation = "safe"; |
1059 | 1055 | ||
1060 | return PrepareLoginToRegion(regionInfo, theUser, response, client); | 1056 | return PrepareLoginToRegion(regionInfo, theUser, response, client); |
diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs index 4199c98..46ee3c0 100644 --- a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs +++ b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs | |||
@@ -193,6 +193,10 @@ namespace OpenSim.Region.CoreModules.Hypergrid | |||
193 | { | 193 | { |
194 | return scene.RegionInfo; | 194 | return scene.RegionInfo; |
195 | } | 195 | } |
196 | else if (m_scenes.Count > 0) | ||
197 | { | ||
198 | return m_scenes[0].RegionInfo; | ||
199 | } | ||
196 | return null; | 200 | return null; |
197 | } | 201 | } |
198 | 202 | ||
@@ -248,7 +252,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid | |||
248 | { | 252 | { |
249 | foreach (Scene nextScene in m_scenes) | 253 | foreach (Scene nextScene in m_scenes) |
250 | { | 254 | { |
251 | if (nextScene.RegionInfo.RegionName == regionName) | 255 | if (nextScene.RegionInfo.RegionName.Equals(regionName, StringComparison.InvariantCultureIgnoreCase)) |
252 | { | 256 | { |
253 | scene = nextScene; | 257 | scene = nextScene; |
254 | return true; | 258 | return true; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a99a802..c16c4fe 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2394,18 +2394,19 @@ if (m_shape != null) { | |||
2394 | /// </summary> | 2394 | /// </summary> |
2395 | public void SendScheduledUpdates() | 2395 | public void SendScheduledUpdates() |
2396 | { | 2396 | { |
2397 | const float VELOCITY_TOLERANCE = 0.0001f; | 2397 | const float ROTATION_TOLERANCE = 0.01f; |
2398 | const float POSITION_TOLERANCE = 0.1f; | 2398 | const float VELOCITY_TOLERANCE = 0.001f; |
2399 | const float POSITION_TOLERANCE = 0.05f; | ||
2399 | const int TIME_MS_TOLERANCE = 3000; | 2400 | const int TIME_MS_TOLERANCE = 3000; |
2400 | 2401 | ||
2401 | if (m_updateFlag == 1) | 2402 | if (m_updateFlag == 1) |
2402 | { | 2403 | { |
2403 | // Throw away duplicate or insignificant updates | 2404 | // Throw away duplicate or insignificant updates |
2404 | if (RotationOffset != m_lastRotation || | 2405 | if (!RotationOffset.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || |
2405 | Acceleration != m_lastAcceleration || | 2406 | !Acceleration.Equals(m_lastAcceleration) || |
2406 | (Velocity - m_lastVelocity).Length() > VELOCITY_TOLERANCE || | 2407 | !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || |
2407 | (RotationalVelocity - m_lastAngularVelocity).Length() > VELOCITY_TOLERANCE || | 2408 | !RotationalVelocity.ApproxEquals(m_lastAngularVelocity, VELOCITY_TOLERANCE) || |
2408 | (OffsetPosition - m_lastPosition).Length() > POSITION_TOLERANCE || | 2409 | !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || |
2409 | Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) | 2410 | Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) |
2410 | { | 2411 | { |
2411 | AddTerseUpdateToAllAvatars(); | 2412 | AddTerseUpdateToAllAvatars(); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 9ba19d3..63c979f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2362,8 +2362,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2362 | 2362 | ||
2363 | public override void Update() | 2363 | public override void Update() |
2364 | { | 2364 | { |
2365 | const float VELOCITY_TOLERANCE = 0.0001f; | 2365 | const float ROTATION_TOLERANCE = 0.01f; |
2366 | const float POSITION_TOLERANCE = 10.0f; | 2366 | const float VELOCITY_TOLERANCE = 0.001f; |
2367 | const float POSITION_TOLERANCE = 0.05f; | ||
2367 | const int TIME_MS_TOLERANCE = 3000; | 2368 | const int TIME_MS_TOLERANCE = 3000; |
2368 | 2369 | ||
2369 | SendPrimUpdates(); | 2370 | SendPrimUpdates(); |
@@ -2377,9 +2378,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2377 | if (m_isChildAgent == false) | 2378 | if (m_isChildAgent == false) |
2378 | { | 2379 | { |
2379 | // Throw away duplicate or insignificant updates | 2380 | // Throw away duplicate or insignificant updates |
2380 | if (m_bodyRot != m_lastRotation || | 2381 | if (!m_bodyRot.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || |
2381 | (m_velocity - m_lastVelocity).Length() > VELOCITY_TOLERANCE || | 2382 | !m_velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || |
2382 | (m_pos - m_lastPosition).Length() > POSITION_TOLERANCE || | 2383 | !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || |
2383 | Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) | 2384 | Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) |
2384 | { | 2385 | { |
2385 | SendTerseUpdateToAllClients(); | 2386 | SendTerseUpdateToAllClients(); |
@@ -2415,7 +2416,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2415 | m_perfMonMS = Environment.TickCount; | 2416 | m_perfMonMS = Environment.TickCount; |
2416 | 2417 | ||
2417 | Vector3 pos = m_pos; | 2418 | Vector3 pos = m_pos; |
2418 | pos.Z -= m_appearance.HipOffset; | 2419 | pos.Z += m_appearance.HipOffset; |
2420 | |||
2421 | //m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity); | ||
2419 | 2422 | ||
2420 | remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, | 2423 | remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, |
2421 | pos, m_velocity, Vector3.Zero, m_bodyRot, Vector4.UnitW, m_uuid, null, GetUpdatePriority(remoteClient))); | 2424 | pos, m_velocity, Vector3.Zero, m_bodyRot, Vector4.UnitW, m_uuid, null, GetUpdatePriority(remoteClient))); |
@@ -2514,7 +2517,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2514 | return; | 2517 | return; |
2515 | 2518 | ||
2516 | Vector3 pos = m_pos; | 2519 | Vector3 pos = m_pos; |
2517 | pos.Z -= m_appearance.HipOffset; | 2520 | pos.Z += m_appearance.HipOffset; |
2518 | 2521 | ||
2519 | remoteAvatar.m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, | 2522 | remoteAvatar.m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, |
2520 | LocalId, pos, m_appearance.Texture.GetBytes(), | 2523 | LocalId, pos, m_appearance.Texture.GetBytes(), |
@@ -2585,7 +2588,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2585 | // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); | 2588 | // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); |
2586 | 2589 | ||
2587 | Vector3 pos = m_pos; | 2590 | Vector3 pos = m_pos; |
2588 | pos.Z -= m_appearance.HipOffset; | 2591 | pos.Z += m_appearance.HipOffset; |
2589 | 2592 | ||
2590 | m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId, | 2593 | m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId, |
2591 | pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot)); | 2594 | pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot)); |
@@ -2694,7 +2697,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2694 | } | 2697 | } |
2695 | 2698 | ||
2696 | Vector3 pos = m_pos; | 2699 | Vector3 pos = m_pos; |
2697 | pos.Z -= m_appearance.HipOffset; | 2700 | pos.Z += m_appearance.HipOffset; |
2698 | 2701 | ||
2699 | m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId, | 2702 | m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId, |
2700 | pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot)); | 2703 | pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot)); |
diff --git a/bin/OpenMetaverseTypes.dll b/bin/OpenMetaverseTypes.dll index 331d58b..95d6021 100644 --- a/bin/OpenMetaverseTypes.dll +++ b/bin/OpenMetaverseTypes.dll | |||
Binary files differ | |||