aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-13 06:05:45 +0000
committerTeravus Ovares2008-05-13 06:05:45 +0000
commitbfce23dcf4f902d6967bc483433eae3d2077c447 (patch)
treeed54edbb286ab44340bba304bfa20c3a69982460
parent* Fixed directory not found when saving Mesh previews (my bad, I was testing) (diff)
downloadopensim-SC_OLD-bfce23dcf4f902d6967bc483433eae3d2077c447.zip
opensim-SC_OLD-bfce23dcf4f902d6967bc483433eae3d2077c447.tar.gz
opensim-SC_OLD-bfce23dcf4f902d6967bc483433eae3d2077c447.tar.bz2
opensim-SC_OLD-bfce23dcf4f902d6967bc483433eae3d2077c447.tar.xz
* Implemented ChildAgentDataUpdate throttle multiplier based on an inaccurate count of neighbors.
* The neighbor count is always lower then the actual number of neighbors unless your region was up the longest. * The region you're in is un-affected by this, though, you'll get less packet loss, maybe not get logged off immediately when you log in, and possibly see more prim if your internet connection is semi-unreliable.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs39
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs7
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs19
3 files changed, 62 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index e18c467..f0a0921 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -361,11 +361,12 @@ namespace OpenSim.Region.Environment.Scenes
361 // If the RegionInfo isn't exact but is for the same XY World location, 361 // If the RegionInfo isn't exact but is for the same XY World location,
362 // then the above loop will fix that. 362 // then the above loop will fix that.
363 363
364 if (!(m_neighbours.Contains(otherRegion))) 364 if (!(CheckNeighborRegion(otherRegion)))
365 { 365 {
366 lock (m_neighbours) 366 lock (m_neighbours)
367 { 367 {
368 m_neighbours.Add(otherRegion); 368 m_neighbours.Add(otherRegion);
369 //m_log.Info("[UP]: " + otherRegion.RegionHandle.ToString());
369 } 370 }
370 } 371 }
371 // If these are cast to INT because long + negative values + abs returns invalid data 372 // If these are cast to INT because long + negative values + abs returns invalid data
@@ -407,7 +408,36 @@ namespace OpenSim.Region.Environment.Scenes
407 } 408 }
408 409
409 // Given float seconds, this will restart the region. 410 // Given float seconds, this will restart the region.
411 public void AddNeighborRegion(RegionInfo region)
412 {
413 lock (m_neighbours)
414 {
415 if (!CheckNeighborRegion(region))
416 {
417 m_neighbours.Add(region);
418
419 }
420 }
421 }
410 422
423 public bool CheckNeighborRegion(RegionInfo region)
424 {
425 bool found = false;
426 lock (m_neighbours)
427 {
428 foreach (RegionInfo reg in m_neighbours)
429 {
430 if (reg.RegionHandle == region.RegionHandle)
431 {
432 found = true;
433 break;
434 }
435 }
436 }
437 return found;
438
439
440 }
411 public virtual void Restart(float seconds) 441 public virtual void Restart(float seconds)
412 { 442 {
413 // notifications are done in 15 second increments 443 // notifications are done in 15 second increments
@@ -556,7 +586,11 @@ namespace OpenSim.Region.Environment.Scenes
556 } 586 }
557 587
558 } 588 }
559 589 public int GetInaccurateNeighborCount()
590 {
591 lock (m_neighbours)
592 return m_neighbours.Count;
593 }
560 // This is the method that shuts down the scene. 594 // This is the method that shuts down the scene.
561 public override void Close() 595 public override void Close()
562 { 596 {
@@ -647,6 +681,7 @@ namespace OpenSim.Region.Environment.Scenes
647 // Aquire a lock so only one update call happens at once 681 // Aquire a lock so only one update call happens at once
648 updateLock.WaitOne(); 682 updateLock.WaitOne();
649 float physicsFPS = 0; 683 float physicsFPS = 0;
684 //m_log.Info("sadfadf" + m_neighbours.Count.ToString());
650 int agentsInScene = m_innerScene.GetRootAgentCount() + m_innerScene.GetChildAgentCount(); 685 int agentsInScene = m_innerScene.GetRootAgentCount() + m_innerScene.GetChildAgentCount();
651 686
652 if (agentsInScene > 21) 687 if (agentsInScene > 21)
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index 5ef4a7d..c9274dd 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -361,6 +361,13 @@ namespace OpenSim.Region.Environment.Scenes
361 if (regionAccepted) 361 if (regionAccepted)
362 { 362 {
363 m_log.Info("[INTERGRID]: Completed informing neighbors that I'm here"); 363 m_log.Info("[INTERGRID]: Completed informing neighbors that I'm here");
364 handlerRegionUp = OnRegionUp;
365
366 // yes, we're notifying ourselves.
367 if (handlerRegionUp != null)
368 handlerRegionUp(region);
369
370
364 } 371 }
365 else 372 else
366 { 373 {
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 5b10bfc..3189b10 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -1568,7 +1568,24 @@ namespace OpenSim.Region.Environment.Scenes
1568 cadu.GroupAccess = 0; 1568 cadu.GroupAccess = 0;
1569 cadu.Position = new sLLVector3(AbsolutePosition); 1569 cadu.Position = new sLLVector3(AbsolutePosition);
1570 cadu.regionHandle = m_scene.RegionInfo.RegionHandle; 1570 cadu.regionHandle = m_scene.RegionInfo.RegionHandle;
1571 cadu.throttles = ControllingClient.GetThrottlesPacked(1f); 1571 float multiplier = 1;
1572 int innacurateNeighbors = m_scene.GetInaccurateNeighborCount();
1573 if (innacurateNeighbors != 0)
1574 {
1575 multiplier = 1f / (float)innacurateNeighbors;
1576 }
1577 if (multiplier <= 0f)
1578 {
1579 multiplier = 0.25f;
1580 }
1581
1582 //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString());
1583 cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier);
1584
1585
1586
1587
1588
1572 cadu.Velocity = new sLLVector3(Velocity); 1589 cadu.Velocity = new sLLVector3(Velocity);
1573 m_scene.SendOutChildAgentUpdates(cadu,this); 1590 m_scene.SendOutChildAgentUpdates(cadu,this);
1574 m_LastChildAgentUpdatePosition.X = AbsolutePosition.X; 1591 m_LastChildAgentUpdatePosition.X = AbsolutePosition.X;