* 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 walls0.6.8-post-fixes
parent
c003f49432
commit
b81c829576
|
@ -231,6 +231,10 @@ namespace OpenSim.Client.Linden
|
||||||
{
|
{
|
||||||
return scene.RegionInfo;
|
return scene.RegionInfo;
|
||||||
}
|
}
|
||||||
|
else if (m_scenes.Count > 0)
|
||||||
|
{
|
||||||
|
return m_scenes[0].RegionInfo;
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1031,30 +1031,26 @@ namespace OpenSim.Framework.Communications.Services
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// StartLocation not available, send him to a nearby region instead
|
// Get the default region handle
|
||||||
// regionInfo = m_gridService.RequestClosestRegion("");
|
ulong defaultHandle = Utils.UIntsToLong(m_defaultHomeX * Constants.RegionSize, m_defaultHomeY * Constants.RegionSize);
|
||||||
//m_log.InfoFormat("[LOGIN]: StartLocation not available sending to region {0}", regionInfo.regionName);
|
|
||||||
|
|
||||||
// Send him to default region instead
|
// If we haven't already tried the default region, reset regionInfo
|
||||||
ulong defaultHandle = (((ulong)m_defaultHomeX * Constants.RegionSize) << 32) |
|
if (regionInfo != null && defaultHandle != regionInfo.RegionHandle)
|
||||||
((ulong)m_defaultHomeY * Constants.RegionSize);
|
regionInfo = null;
|
||||||
|
|
||||||
if ((regionInfo != null) && (defaultHandle == regionInfo.RegionHandle))
|
|
||||||
{
|
|
||||||
m_log.ErrorFormat("[LOGIN]: Not trying the default region since this is the same as the selected region");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_log.Error("[LOGIN]: Sending user to default region " + defaultHandle + " instead");
|
|
||||||
regionInfo = GetRegionInfo(defaultHandle);
|
|
||||||
|
|
||||||
if (regionInfo == null)
|
if (regionInfo == null)
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat("[LOGIN]: No default region available. Aborting.");
|
m_log.Error("[LOGIN]: Sending user to default region " + defaultHandle + " instead");
|
||||||
return false;
|
regionInfo = GetRegionInfo(defaultHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
theUser.CurrentAgent.Position = new Vector3(128, 128, 0);
|
if (regionInfo == null)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat("[LOGIN]: Sending user to any region");
|
||||||
|
regionInfo = RequestClosestRegion(String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
theUser.CurrentAgent.Position = new Vector3(128f, 128f, 0f);
|
||||||
response.StartLocation = "safe";
|
response.StartLocation = "safe";
|
||||||
|
|
||||||
return PrepareLoginToRegion(regionInfo, theUser, response, client);
|
return PrepareLoginToRegion(regionInfo, theUser, response, client);
|
||||||
|
|
|
@ -193,6 +193,10 @@ namespace OpenSim.Region.CoreModules.Hypergrid
|
||||||
{
|
{
|
||||||
return scene.RegionInfo;
|
return scene.RegionInfo;
|
||||||
}
|
}
|
||||||
|
else if (m_scenes.Count > 0)
|
||||||
|
{
|
||||||
|
return m_scenes[0].RegionInfo;
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +252,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid
|
||||||
{
|
{
|
||||||
foreach (Scene nextScene in m_scenes)
|
foreach (Scene nextScene in m_scenes)
|
||||||
{
|
{
|
||||||
if (nextScene.RegionInfo.RegionName == regionName)
|
if (nextScene.RegionInfo.RegionName.Equals(regionName, StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
scene = nextScene;
|
scene = nextScene;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -2394,18 +2394,19 @@ if (m_shape != null) {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendScheduledUpdates()
|
public void SendScheduledUpdates()
|
||||||
{
|
{
|
||||||
const float VELOCITY_TOLERANCE = 0.0001f;
|
const float ROTATION_TOLERANCE = 0.01f;
|
||||||
const float POSITION_TOLERANCE = 0.1f;
|
const float VELOCITY_TOLERANCE = 0.001f;
|
||||||
|
const float POSITION_TOLERANCE = 0.05f;
|
||||||
const int TIME_MS_TOLERANCE = 3000;
|
const int TIME_MS_TOLERANCE = 3000;
|
||||||
|
|
||||||
if (m_updateFlag == 1)
|
if (m_updateFlag == 1)
|
||||||
{
|
{
|
||||||
// Throw away duplicate or insignificant updates
|
// Throw away duplicate or insignificant updates
|
||||||
if (RotationOffset != m_lastRotation ||
|
if (!RotationOffset.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) ||
|
||||||
Acceleration != m_lastAcceleration ||
|
!Acceleration.Equals(m_lastAcceleration) ||
|
||||||
(Velocity - m_lastVelocity).Length() > VELOCITY_TOLERANCE ||
|
!Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) ||
|
||||||
(RotationalVelocity - m_lastAngularVelocity).Length() > VELOCITY_TOLERANCE ||
|
!RotationalVelocity.ApproxEquals(m_lastAngularVelocity, VELOCITY_TOLERANCE) ||
|
||||||
(OffsetPosition - m_lastPosition).Length() > POSITION_TOLERANCE ||
|
!OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) ||
|
||||||
Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
|
Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
|
||||||
{
|
{
|
||||||
AddTerseUpdateToAllAvatars();
|
AddTerseUpdateToAllAvatars();
|
||||||
|
|
|
@ -2362,8 +2362,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
const float VELOCITY_TOLERANCE = 0.0001f;
|
const float ROTATION_TOLERANCE = 0.01f;
|
||||||
const float POSITION_TOLERANCE = 10.0f;
|
const float VELOCITY_TOLERANCE = 0.001f;
|
||||||
|
const float POSITION_TOLERANCE = 0.05f;
|
||||||
const int TIME_MS_TOLERANCE = 3000;
|
const int TIME_MS_TOLERANCE = 3000;
|
||||||
|
|
||||||
SendPrimUpdates();
|
SendPrimUpdates();
|
||||||
|
@ -2377,9 +2378,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (m_isChildAgent == false)
|
if (m_isChildAgent == false)
|
||||||
{
|
{
|
||||||
// Throw away duplicate or insignificant updates
|
// Throw away duplicate or insignificant updates
|
||||||
if (m_bodyRot != m_lastRotation ||
|
if (!m_bodyRot.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) ||
|
||||||
(m_velocity - m_lastVelocity).Length() > VELOCITY_TOLERANCE ||
|
!m_velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) ||
|
||||||
(m_pos - m_lastPosition).Length() > POSITION_TOLERANCE ||
|
!m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) ||
|
||||||
Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
|
Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
|
||||||
{
|
{
|
||||||
SendTerseUpdateToAllClients();
|
SendTerseUpdateToAllClients();
|
||||||
|
@ -2415,7 +2416,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_perfMonMS = Environment.TickCount;
|
m_perfMonMS = Environment.TickCount;
|
||||||
|
|
||||||
Vector3 pos = m_pos;
|
Vector3 pos = m_pos;
|
||||||
pos.Z -= m_appearance.HipOffset;
|
pos.Z += m_appearance.HipOffset;
|
||||||
|
|
||||||
|
//m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity);
|
||||||
|
|
||||||
remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
|
remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
|
||||||
pos, m_velocity, Vector3.Zero, m_bodyRot, Vector4.UnitW, m_uuid, null, GetUpdatePriority(remoteClient)));
|
pos, m_velocity, Vector3.Zero, m_bodyRot, Vector4.UnitW, m_uuid, null, GetUpdatePriority(remoteClient)));
|
||||||
|
@ -2514,7 +2517,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Vector3 pos = m_pos;
|
Vector3 pos = m_pos;
|
||||||
pos.Z -= m_appearance.HipOffset;
|
pos.Z += m_appearance.HipOffset;
|
||||||
|
|
||||||
remoteAvatar.m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid,
|
remoteAvatar.m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid,
|
||||||
LocalId, pos, m_appearance.Texture.GetBytes(),
|
LocalId, pos, m_appearance.Texture.GetBytes(),
|
||||||
|
@ -2585,7 +2588,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
|
// m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
|
||||||
|
|
||||||
Vector3 pos = m_pos;
|
Vector3 pos = m_pos;
|
||||||
pos.Z -= m_appearance.HipOffset;
|
pos.Z += m_appearance.HipOffset;
|
||||||
|
|
||||||
m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId,
|
m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId,
|
||||||
pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot));
|
pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot));
|
||||||
|
@ -2694,7 +2697,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector3 pos = m_pos;
|
Vector3 pos = m_pos;
|
||||||
pos.Z -= m_appearance.HipOffset;
|
pos.Z += m_appearance.HipOffset;
|
||||||
|
|
||||||
m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId,
|
m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId,
|
||||||
pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot));
|
pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot));
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue