allow drawdistance to change between 32 and MaxDrawDistance, configurable

value default to 256, so should have no effect. Next steps needed: reduce
 client udp Throttles with distance, update childreen connections with
 significat movement and view range changes, Make disconnect be delayed in time, make disconnects be receiving region action not sender on region changes. Allow distance less than 256 to only connect to visible regions, even none. Make this be relative to camera and not agent position or region centers as it is now.
avinationmerge
UbitUmarov 2014-11-06 19:03:25 +00:00
parent b5e43a4b90
commit ead78764ab
4 changed files with 34 additions and 17 deletions

View File

@ -5766,7 +5766,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|| (qdelta1 < QDELTABody) // significant if body rotation above(below cos) threshold
// Ignoring head rotation altogether, because it's not being used for anything interesting up the stack
// || (qdelta2 < QDELTAHead) // significant if head rotation above(below cos) threshold
|| (x.Far != m_thisAgentUpdateArgs.Far) // significant if far distance changed
|| (Math.Abs(x.Far - m_thisAgentUpdateArgs.Far) >= 32) // significant if far distance changed
;
//if (movementSignificant)
//{

View File

@ -2352,11 +2352,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
{
int dd = avatar.DrawDistance < Constants.RegionSize ? (int)Constants.RegionSize : (int)avatar.DrawDistance;
int startX = (int)pRegionLocX * (int)Constants.RegionSize - dd + (int)(Constants.RegionSize/2);
int startY = (int)pRegionLocY * (int)Constants.RegionSize - dd + (int)(Constants.RegionSize/2);
dd--;
int endX = (int)pRegionLocX * (int)Constants.RegionSize + dd + (int)(Constants.RegionSize/2);
int endY = (int)pRegionLocY * (int)Constants.RegionSize + dd + (int)(Constants.RegionSize/2);
// region center
int endX = (int)pRegionLocX * (int)Constants.RegionSize + (int)(Constants.RegionSize / 2);
int endY = (int)pRegionLocY * (int)Constants.RegionSize + (int)(Constants.RegionSize / 2);
int startX = endX - dd;
int startY = endY - dd;
endX += dd;
endY += dd;
if (startX < 0) startX = 0;
if (startY < 0) startY = 0;

View File

@ -227,6 +227,13 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_defaultDrawDistance; }
}
// protected float m_maxDrawDistance = 512.0f;
protected float m_maxDrawDistance = 256.0f;
public float MaxDrawDistance
{
get { return m_maxDrawDistance; }
}
private List<string> m_AllowedViewers = new List<string>();
private List<string> m_BannedViewers = new List<string>();
@ -863,6 +870,7 @@ namespace OpenSim.Region.Framework.Scenes
StartDisabled = startupConfig.GetBoolean("StartDisabled", false);
m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance", m_defaultDrawDistance);
m_defaultDrawDistance = startupConfig.GetFloat("MaxDrawDistance", m_maxDrawDistance);
UseBackup = startupConfig.GetBoolean("UseSceneBackup", UseBackup);
if (!UseBackup)
m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName);
@ -1069,7 +1077,7 @@ namespace OpenSim.Region.Framework.Scenes
BordersLocked = true;
Border northBorder = new Border();
northBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize); //<---
northBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, RegionInfo.RegionSizeY); //<---
northBorder.CrossDirection = Cardinals.N;
NorthBorders.Add(northBorder);
@ -1079,7 +1087,7 @@ namespace OpenSim.Region.Framework.Scenes
SouthBorders.Add(southBorder);
Border eastBorder = new Border();
eastBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize); //<---
eastBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, RegionInfo.RegionSizeX); //<---
eastBorder.CrossDirection = Cardinals.E;
EastBorders.Add(eastBorder);
@ -1092,6 +1100,7 @@ namespace OpenSim.Region.Framework.Scenes
m_eventManager = new EventManager();
m_permissions = new ScenePermissions(this);
}
#endregion

View File

@ -2061,8 +2061,10 @@ namespace OpenSim.Region.Framework.Scenes
// When we get to the point of re-computing neighbors everytime this
// changes, then start using the agent's drawdistance rather than the
// region's draw distance.
// DrawDistance = agentData.Far;
DrawDistance = Scene.DefaultDrawDistance;
DrawDistance = Util.Clamp(agentData.Far, 32, m_scene.MaxDrawDistance);
// DrawDistance = Scene.DefaultDrawDistance;
m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0;
m_leftButtonDown = (flags & AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0;
@ -2417,8 +2419,7 @@ namespace OpenSim.Region.Framework.Scenes
// When we get to the point of re-computing neighbors everytime this
// changes, then start using the agent's drawdistance rather than the
// region's draw distance.
// DrawDistance = agentData.Far;
DrawDistance = Scene.DefaultDrawDistance;
DrawDistance = Util.Clamp(agentData.Far, 32, m_scene.MaxDrawDistance);
// Check if Client has camera in 'follow cam' or 'build' mode.
Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation);
@ -4011,6 +4012,7 @@ namespace OpenSim.Region.Framework.Scenes
foreach (ulong handle in byebyeRegions)
{
RemoveNeighbourRegion(handle);
Scene.CapsModule.DropChildSeed(UUID, handle);
}
}
@ -4087,8 +4089,8 @@ namespace OpenSim.Region.Framework.Scenes
// When we get to the point of re-computing neighbors everytime this
// changes, then start using the agent's drawdistance rather than the
// region's draw distance.
// DrawDistance = cAgentData.Far;
DrawDistance = Scene.DefaultDrawDistance;
DrawDistance = cAgentData.Far;
// DrawDistance = Scene.DefaultDrawDistance;
if (cAgentData.Position != marker) // UGH!!
m_pos = cAgentData.Position + offset;
@ -4204,8 +4206,8 @@ namespace OpenSim.Region.Framework.Scenes
// When we get to the point of re-computing neighbors everytime this
// changes, then start using the agent's drawdistance rather than the
// region's draw distance.
// DrawDistance = cAgent.Far;
DrawDistance = Scene.DefaultDrawDistance;
DrawDistance = cAgent.Far;
//DrawDistance = Scene.DefaultDrawDistance;
if (cAgent.ChildrenCapSeeds != null && cAgent.ChildrenCapSeeds.Count > 0)
{