diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Prioritizer.cs | 84 | ||||
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/Scene.cs | 6 |
3 files changed, 11 insertions, 91 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 516c1e5..bbaa0e2 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -627,10 +627,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
627 | ImageManager.Close(); | 627 | ImageManager.Close(); |
628 | ImageManager = null; | 628 | ImageManager = null; |
629 | 629 | ||
630 | // m_entityUpdates.Close(); | 630 | m_entityUpdates.Close(); |
631 | // m_entityProps.Close(); | 631 | m_entityProps.Close(); |
632 | m_entityUpdates = new PriorityQueue(1); | ||
633 | m_entityProps = new PriorityQueue(1); | ||
634 | m_killRecord.Clear(); | 632 | m_killRecord.Clear(); |
635 | GroupsInView.Clear(); | 633 | GroupsInView.Clear(); |
636 | 634 | ||
@@ -2683,11 +2681,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2683 | public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks) | 2681 | public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks) |
2684 | { | 2682 | { |
2685 | ViewerEffectPacket packet = (ViewerEffectPacket)PacketPool.Instance.GetPacket(PacketType.ViewerEffect); | 2683 | ViewerEffectPacket packet = (ViewerEffectPacket)PacketPool.Instance.GetPacket(PacketType.ViewerEffect); |
2686 | packet.Header.Reliable = false; | ||
2687 | packet.Header.Zerocoded = true; | ||
2688 | 2684 | ||
2689 | packet.AgentData.AgentID = AgentId; | 2685 | // packet.AgentData.AgentID = AgentId; |
2690 | packet.AgentData.SessionID = SessionId; | 2686 | // packet.AgentData.SessionID = SessionId; |
2691 | 2687 | ||
2692 | packet.Effect = effectBlocks; | 2688 | packet.Effect = effectBlocks; |
2693 | 2689 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index 53ca849..cc4df17 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs | |||
@@ -33,27 +33,12 @@ using OpenSim.Framework; | |||
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Region.PhysicsModules.SharedBase; | 34 | using OpenSim.Region.PhysicsModules.SharedBase; |
35 | 35 | ||
36 | /* | ||
37 | * Steps to add a new prioritization policy: | ||
38 | * | ||
39 | * - Add a new value to the UpdatePrioritizationSchemes enum. | ||
40 | * - Specify this new value in the [InterestManagement] section of your | ||
41 | * OpenSim.ini. The name in the config file must match the enum value name | ||
42 | * (although it is not case sensitive). | ||
43 | * - Write a new GetPriorityBy*() method in this class. | ||
44 | * - Add a new entry to the switch statement in GetUpdatePriority() that calls | ||
45 | * your method. | ||
46 | */ | ||
47 | |||
48 | namespace OpenSim.Region.Framework.Scenes | 36 | namespace OpenSim.Region.Framework.Scenes |
49 | { | 37 | { |
50 | public enum UpdatePrioritizationSchemes | 38 | public enum UpdatePrioritizationSchemes |
51 | { | 39 | { |
52 | Time = 0, | 40 | SimpleAngularDistance = 0, |
53 | Distance = 1, | 41 | BestAvatarResponsiveness = 1, |
54 | SimpleAngularDistance = 2, | ||
55 | FrontBack = 3, | ||
56 | BestAvatarResponsiveness = 4, | ||
57 | } | 42 | } |
58 | 43 | ||
59 | public class Prioritizer | 44 | public class Prioritizer |
@@ -68,14 +53,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
68 | } | 53 | } |
69 | 54 | ||
70 | /// <summary> | 55 | /// <summary> |
71 | /// Returns the priority queue into which the update should be placed. Updates within a | 56 | /// Returns the priority queue into which the update should be placed. |
72 | /// queue will be processed in arrival order. There are currently 12 priority queues | ||
73 | /// implemented in PriorityQueue class in LLClientView. Queue 0 is generally retained | ||
74 | /// for avatar updates. The fair queuing discipline for processing the priority queues | ||
75 | /// assumes that the number of entities in each priority queues increases exponentially. | ||
76 | /// So for example... if queue 1 contains all updates within 10m of the avatar or camera | ||
77 | /// then queue 2 at 20m is about 3X bigger in space & about 3X bigger in total number | ||
78 | /// of updates. | ||
79 | /// </summary> | 57 | /// </summary> |
80 | public uint GetUpdatePriority(IClientAPI client, ISceneEntity entity) | 58 | public uint GetUpdatePriority(IClientAPI client, ISceneEntity entity) |
81 | { | 59 | { |
@@ -94,22 +72,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
94 | 72 | ||
95 | switch (m_scene.UpdatePrioritizationScheme) | 73 | switch (m_scene.UpdatePrioritizationScheme) |
96 | { | 74 | { |
97 | /* | ||
98 | case UpdatePrioritizationSchemes.Time: | ||
99 | priority = GetPriorityByTime(client, entity); | ||
100 | break; | ||
101 | case UpdatePrioritizationSchemes.Distance: | ||
102 | priority = GetPriorityByDistance(client, entity); | ||
103 | break; | ||
104 | case UpdatePrioritizationSchemes.SimpleAngularDistance: | ||
105 | priority = GetPriorityByDistance(client, entity); // TODO: Reimplement SimpleAngularDistance | ||
106 | break; | ||
107 | case UpdatePrioritizationSchemes.FrontBack: | ||
108 | priority = GetPriorityByFrontBack(client, entity); | ||
109 | break; | ||
110 | */ | ||
111 | case UpdatePrioritizationSchemes.SimpleAngularDistance: | 75 | case UpdatePrioritizationSchemes.SimpleAngularDistance: |
112 | priority = GetPriorityByAngularDistance(client, entity); // TODO: Reimplement SimpleAngularDistance | 76 | priority = GetPriorityByAngularDistance(client, entity); |
113 | break; | 77 | break; |
114 | case UpdatePrioritizationSchemes.BestAvatarResponsiveness: | 78 | case UpdatePrioritizationSchemes.BestAvatarResponsiveness: |
115 | default: | 79 | default: |
@@ -120,45 +84,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
120 | return priority; | 84 | return priority; |
121 | } | 85 | } |
122 | 86 | ||
123 | private uint GetPriorityByTime(IClientAPI client, ISceneEntity entity) | ||
124 | { | ||
125 | // And anything attached to this avatar gets top priority as well | ||
126 | if (entity is SceneObjectPart) | ||
127 | { | ||
128 | SceneObjectPart sop = (SceneObjectPart)entity; | ||
129 | if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar) | ||
130 | return 1; | ||
131 | } | ||
132 | |||
133 | return PriorityQueue.NumberOfImmediateQueues; // first queue past the immediate queues | ||
134 | } | ||
135 | |||
136 | private uint GetPriorityByDistance(IClientAPI client, ISceneEntity entity) | ||
137 | { | ||
138 | // And anything attached to this avatar gets top priority as well | ||
139 | if (entity is SceneObjectPart) | ||
140 | { | ||
141 | SceneObjectPart sop = (SceneObjectPart)entity; | ||
142 | if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar) | ||
143 | return 1; | ||
144 | } | ||
145 | |||
146 | return ComputeDistancePriority(client,entity,false); | ||
147 | } | ||
148 | |||
149 | private uint GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity) | ||
150 | { | ||
151 | // And anything attached to this avatar gets top priority as well | ||
152 | if (entity is SceneObjectPart) | ||
153 | { | ||
154 | SceneObjectPart sop = (SceneObjectPart)entity; | ||
155 | if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar) | ||
156 | return 1; | ||
157 | } | ||
158 | |||
159 | return ComputeDistancePriority(client,entity,true); | ||
160 | } | ||
161 | |||
162 | private uint GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity) | 87 | private uint GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity) |
163 | { | 88 | { |
164 | uint pqueue = 2; // keep compiler happy | 89 | uint pqueue = 2; // keep compiler happy |
@@ -176,7 +101,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
176 | // Attachments are high priority, | 101 | // Attachments are high priority, |
177 | if (sog.IsAttachment) | 102 | if (sog.IsAttachment) |
178 | return 2; | 103 | return 2; |
179 | |||
180 | 104 | ||
181 | if(presence.ParentPart != null) | 105 | if(presence.ParentPart != null) |
182 | { | 106 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a21b4f7..2e14a20 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1115,7 +1115,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1115 | catch (Exception) | 1115 | catch (Exception) |
1116 | { | 1116 | { |
1117 | m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time"); | 1117 | m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time"); |
1118 | UpdatePrioritizationScheme = UpdatePrioritizationSchemes.Time; | 1118 | UpdatePrioritizationScheme = UpdatePrioritizationSchemes.BestAvatarResponsiveness; |
1119 | } | 1119 | } |
1120 | 1120 | ||
1121 | IsReprioritizationEnabled | 1121 | IsReprioritizationEnabled |
@@ -1196,7 +1196,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1196 | UseBackup = true; | 1196 | UseBackup = true; |
1197 | 1197 | ||
1198 | IsReprioritizationEnabled = true; | 1198 | IsReprioritizationEnabled = true; |
1199 | UpdatePrioritizationScheme = UpdatePrioritizationSchemes.Time; | 1199 | UpdatePrioritizationScheme = UpdatePrioritizationSchemes.BestAvatarResponsiveness; |
1200 | ReprioritizationInterval = 5000; | 1200 | ReprioritizationInterval = 5000; |
1201 | 1201 | ||
1202 | ReprioritizationDistance = m_minReprioritizationDistance; | 1202 | ReprioritizationDistance = m_minReprioritizationDistance; |
@@ -1762,7 +1762,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1762 | } | 1762 | } |
1763 | 1763 | ||
1764 | m_sceneGridService.InformNeighborsThatRegionisUp( | 1764 | m_sceneGridService.InformNeighborsThatRegionisUp( |
1765 | RequestModuleInterface<INeighbourService>(), RegionInfo); | 1765 | RequestModuleInterface<INeighbourService>(), RegionInfo); |
1766 | 1766 | ||
1767 | // Region ready should always be set | 1767 | // Region ready should always be set |
1768 | Ready = true; | 1768 | Ready = true; |