mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +08:00
changes to objects updates prioritizing getting dust on my disk. Schemes reduced to SimpleAngularDistance and BestAvatarResponsiveness
This commit is contained in:
@@ -627,10 +627,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
ImageManager.Close();
|
||||
ImageManager = null;
|
||||
|
||||
// m_entityUpdates.Close();
|
||||
// m_entityProps.Close();
|
||||
m_entityUpdates = new PriorityQueue(1);
|
||||
m_entityProps = new PriorityQueue(1);
|
||||
m_entityUpdates.Close();
|
||||
m_entityProps.Close();
|
||||
m_killRecord.Clear();
|
||||
GroupsInView.Clear();
|
||||
|
||||
@@ -2683,11 +2681,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks)
|
||||
{
|
||||
ViewerEffectPacket packet = (ViewerEffectPacket)PacketPool.Instance.GetPacket(PacketType.ViewerEffect);
|
||||
packet.Header.Reliable = false;
|
||||
packet.Header.Zerocoded = true;
|
||||
|
||||
packet.AgentData.AgentID = AgentId;
|
||||
packet.AgentData.SessionID = SessionId;
|
||||
// packet.AgentData.AgentID = AgentId;
|
||||
// packet.AgentData.SessionID = SessionId;
|
||||
|
||||
packet.Effect = effectBlocks;
|
||||
|
||||
|
||||
@@ -33,27 +33,12 @@ using OpenSim.Framework;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Region.PhysicsModules.SharedBase;
|
||||
|
||||
/*
|
||||
* Steps to add a new prioritization policy:
|
||||
*
|
||||
* - Add a new value to the UpdatePrioritizationSchemes enum.
|
||||
* - Specify this new value in the [InterestManagement] section of your
|
||||
* OpenSim.ini. The name in the config file must match the enum value name
|
||||
* (although it is not case sensitive).
|
||||
* - Write a new GetPriorityBy*() method in this class.
|
||||
* - Add a new entry to the switch statement in GetUpdatePriority() that calls
|
||||
* your method.
|
||||
*/
|
||||
|
||||
namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
public enum UpdatePrioritizationSchemes
|
||||
{
|
||||
Time = 0,
|
||||
Distance = 1,
|
||||
SimpleAngularDistance = 2,
|
||||
FrontBack = 3,
|
||||
BestAvatarResponsiveness = 4,
|
||||
SimpleAngularDistance = 0,
|
||||
BestAvatarResponsiveness = 1,
|
||||
}
|
||||
|
||||
public class Prioritizer
|
||||
@@ -68,14 +53,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the priority queue into which the update should be placed. Updates within a
|
||||
/// queue will be processed in arrival order. There are currently 12 priority queues
|
||||
/// implemented in PriorityQueue class in LLClientView. Queue 0 is generally retained
|
||||
/// for avatar updates. The fair queuing discipline for processing the priority queues
|
||||
/// assumes that the number of entities in each priority queues increases exponentially.
|
||||
/// So for example... if queue 1 contains all updates within 10m of the avatar or camera
|
||||
/// then queue 2 at 20m is about 3X bigger in space & about 3X bigger in total number
|
||||
/// of updates.
|
||||
/// Returns the priority queue into which the update should be placed.
|
||||
/// </summary>
|
||||
public uint GetUpdatePriority(IClientAPI client, ISceneEntity entity)
|
||||
{
|
||||
@@ -94,22 +72,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
switch (m_scene.UpdatePrioritizationScheme)
|
||||
{
|
||||
/*
|
||||
case UpdatePrioritizationSchemes.Time:
|
||||
priority = GetPriorityByTime(client, entity);
|
||||
break;
|
||||
case UpdatePrioritizationSchemes.Distance:
|
||||
priority = GetPriorityByDistance(client, entity);
|
||||
break;
|
||||
case UpdatePrioritizationSchemes.SimpleAngularDistance:
|
||||
priority = GetPriorityByDistance(client, entity); // TODO: Reimplement SimpleAngularDistance
|
||||
break;
|
||||
case UpdatePrioritizationSchemes.FrontBack:
|
||||
priority = GetPriorityByFrontBack(client, entity);
|
||||
break;
|
||||
*/
|
||||
case UpdatePrioritizationSchemes.SimpleAngularDistance:
|
||||
priority = GetPriorityByAngularDistance(client, entity); // TODO: Reimplement SimpleAngularDistance
|
||||
priority = GetPriorityByAngularDistance(client, entity);
|
||||
break;
|
||||
case UpdatePrioritizationSchemes.BestAvatarResponsiveness:
|
||||
default:
|
||||
@@ -120,45 +84,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return priority;
|
||||
}
|
||||
|
||||
private uint GetPriorityByTime(IClientAPI client, ISceneEntity entity)
|
||||
{
|
||||
// And anything attached to this avatar gets top priority as well
|
||||
if (entity is SceneObjectPart)
|
||||
{
|
||||
SceneObjectPart sop = (SceneObjectPart)entity;
|
||||
if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar)
|
||||
return 1;
|
||||
}
|
||||
|
||||
return PriorityQueue.NumberOfImmediateQueues; // first queue past the immediate queues
|
||||
}
|
||||
|
||||
private uint GetPriorityByDistance(IClientAPI client, ISceneEntity entity)
|
||||
{
|
||||
// And anything attached to this avatar gets top priority as well
|
||||
if (entity is SceneObjectPart)
|
||||
{
|
||||
SceneObjectPart sop = (SceneObjectPart)entity;
|
||||
if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar)
|
||||
return 1;
|
||||
}
|
||||
|
||||
return ComputeDistancePriority(client,entity,false);
|
||||
}
|
||||
|
||||
private uint GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity)
|
||||
{
|
||||
// And anything attached to this avatar gets top priority as well
|
||||
if (entity is SceneObjectPart)
|
||||
{
|
||||
SceneObjectPart sop = (SceneObjectPart)entity;
|
||||
if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar)
|
||||
return 1;
|
||||
}
|
||||
|
||||
return ComputeDistancePriority(client,entity,true);
|
||||
}
|
||||
|
||||
private uint GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity)
|
||||
{
|
||||
uint pqueue = 2; // keep compiler happy
|
||||
@@ -176,7 +101,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Attachments are high priority,
|
||||
if (sog.IsAttachment)
|
||||
return 2;
|
||||
|
||||
|
||||
if(presence.ParentPart != null)
|
||||
{
|
||||
|
||||
@@ -1115,7 +1115,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
|
||||
UpdatePrioritizationScheme = UpdatePrioritizationSchemes.Time;
|
||||
UpdatePrioritizationScheme = UpdatePrioritizationSchemes.BestAvatarResponsiveness;
|
||||
}
|
||||
|
||||
IsReprioritizationEnabled
|
||||
@@ -1196,7 +1196,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
UseBackup = true;
|
||||
|
||||
IsReprioritizationEnabled = true;
|
||||
UpdatePrioritizationScheme = UpdatePrioritizationSchemes.Time;
|
||||
UpdatePrioritizationScheme = UpdatePrioritizationSchemes.BestAvatarResponsiveness;
|
||||
ReprioritizationInterval = 5000;
|
||||
|
||||
ReprioritizationDistance = m_minReprioritizationDistance;
|
||||
@@ -1762,7 +1762,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
m_sceneGridService.InformNeighborsThatRegionisUp(
|
||||
RequestModuleInterface<INeighbourService>(), RegionInfo);
|
||||
RequestModuleInterface<INeighbourService>(), RegionInfo);
|
||||
|
||||
// Region ready should always be set
|
||||
Ready = true;
|
||||
|
||||
Reference in New Issue
Block a user