aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs39
1 files changed, 37 insertions, 2 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)