aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorMW2007-09-06 14:15:16 +0000
committerMW2007-09-06 14:15:16 +0000
commit804e87861b95f08590cff8a84a4b9955f1750452 (patch)
tree2a9c6fcdf1ae6236f495f8f8012ae069c1011f5f /OpenSim/Region/Environment/Scenes/ScenePresence.cs
parentfixed mantis bug 375 (copy broken with physics/ODE enabled) (diff)
downloadopensim-SC-804e87861b95f08590cff8a84a4b9955f1750452.zip
opensim-SC-804e87861b95f08590cff8a84a4b9955f1750452.tar.gz
opensim-SC-804e87861b95f08590cff8a84a4b9955f1750452.tar.bz2
opensim-SC-804e87861b95f08590cff8a84a4b9955f1750452.tar.xz
added experimental method of trying to relieve missing prim problem (by adding a limit of the number of prim update packets sent in each update loop).
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs60
1 files changed, 58 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index e094ac6..285c691 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -88,6 +88,12 @@ namespace OpenSim.Region.Environment.Scenes
88 public delegate void SignificantClientMovement(IClientAPI remote_client); 88 public delegate void SignificantClientMovement(IClientAPI remote_client);
89 public event SignificantClientMovement OnSignificantClientMovement; 89 public event SignificantClientMovement OnSignificantClientMovement;
90 90
91 // private Queue<SceneObjectGroup> m_fullGroupUpdates = new Queue<SceneObjectGroup>();
92 // private Queue<SceneObjectGroup> m_terseGroupUpdates = new Queue<SceneObjectGroup>();
93
94 private Queue<SceneObjectPart> m_fullPartUpdates = new Queue<SceneObjectPart>();
95 private Queue<SceneObjectPart> m_teserPartUpdates = new Queue<SceneObjectPart>();
96
91 #region Properties 97 #region Properties
92 /// <summary> 98 /// <summary>
93 /// 99 ///
@@ -193,6 +199,54 @@ namespace OpenSim.Region.Environment.Scenes
193 } 199 }
194 #endregion 200 #endregion
195 201
202 public void AddTersePart(SceneObjectPart part)
203 {
204 m_teserPartUpdates.Enqueue(part);
205 }
206
207 public void AddFullPart(SceneObjectPart part)
208 {
209 m_fullPartUpdates.Enqueue(part);
210 }
211
212 public void SendPrimUpdates()
213 {
214 if (m_teserPartUpdates.Count > 0)
215 {
216 bool terse = true;
217 int terseCount = 0;
218
219 while (terse)
220 {
221 SceneObjectPart part = m_teserPartUpdates.Dequeue();
222 part.SendTerseUpdate(this.ControllingClient);
223 terseCount++;
224
225 if ((m_teserPartUpdates.Count < 1) |(terseCount > 30))
226 {
227 terse = false;
228 }
229 }
230 }
231 if (m_fullPartUpdates.Count > 0)
232 {
233 bool full = true;
234 int fullCount = 0;
235
236 while (full)
237 {
238 SceneObjectPart part = m_fullPartUpdates.Dequeue();
239 part.SendFullUpdate(this.ControllingClient);
240 fullCount++;
241 if ((m_fullPartUpdates.Count < 1) | (fullCount > 40))
242 {
243 full = false;
244 }
245
246 }
247 }
248 }
249
196 #region Status Methods 250 #region Status Methods
197 /// <summary> 251 /// <summary>
198 /// Not Used, most likely can be deleted 252 /// Not Used, most likely can be deleted
@@ -221,7 +275,7 @@ namespace OpenSim.Region.Environment.Scenes
221 this._physActor.Flying = isFlying; 275 this._physActor.Flying = isFlying;
222 this.newAvatar = true; 276 this.newAvatar = true;
223 this.childAgent = false; 277 this.childAgent = false;
224 this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient); 278 this.m_scene.SendAllSceneObjectsToClient(this);
225 } 279 }
226 280
227 protected void MakeChildAgent() 281 protected void MakeChildAgent()
@@ -399,6 +453,8 @@ namespace OpenSim.Region.Environment.Scenes
399 /// </summary> 453 /// </summary>
400 public override void Update() 454 public override void Update()
401 { 455 {
456 this.SendPrimUpdates();
457
402 if (this.childAgent == false) 458 if (this.childAgent == false)
403 { 459 {
404 if (this.newForce) 460 if (this.newForce)
@@ -500,7 +556,7 @@ namespace OpenSim.Region.Environment.Scenes
500 //this.SendFullUpdateToALLClients(); 556 //this.SendFullUpdateToALLClients();
501 //this.SendArrearanceToAllOtherAgents(); 557 //this.SendArrearanceToAllOtherAgents();
502 558
503 this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient); 559 this.m_scene.SendAllSceneObjectsToClient(this);
504 this.ControllingClient.SendViewerTime(this.m_scene.TimePhase); 560 this.ControllingClient.SendViewerTime(this.m_scene.TimePhase);
505 561
506 //Please don't remove the following code (at least not yet), just leave it commented out 562 //Please don't remove the following code (at least not yet), just leave it commented out