diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs | 74 |
1 files changed, 70 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs index a6e3859..4e03e95 100644 --- a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs | |||
@@ -14,7 +14,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
14 | { | 14 | { |
15 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 15 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
16 | 16 | ||
17 | public string Name { get { return "RegionCombinerModule"; } } | 17 | public string Name { get |
18 | { | ||
19 | return "RegionCombinerModule"; | ||
20 | } } | ||
18 | public Type ReplaceableInterface | 21 | public Type ReplaceableInterface |
19 | { | 22 | { |
20 | get { return null; } | 23 | get { return null; } |
@@ -22,11 +25,15 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
22 | 25 | ||
23 | private Dictionary<UUID, RegionConnections> m_regions = new Dictionary<UUID, RegionConnections>(); | 26 | private Dictionary<UUID, RegionConnections> m_regions = new Dictionary<UUID, RegionConnections>(); |
24 | private bool enabledYN = false; | 27 | private bool enabledYN = false; |
28 | private Dictionary<UUID, Scene> m_startingScenes = new Dictionary<UUID, Scene>(); | ||
29 | |||
25 | public void Initialise(IConfigSource source) | 30 | public void Initialise(IConfigSource source) |
26 | { | 31 | { |
32 | |||
27 | IConfig myConfig = source.Configs["Startup"]; | 33 | IConfig myConfig = source.Configs["Startup"]; |
28 | enabledYN = myConfig.GetBoolean("CombineContiguousRegions", false); | 34 | enabledYN = myConfig.GetBoolean("CombineContiguousRegions", false); |
29 | //enabledYN = true; | 35 | //enabledYN = true; |
36 | |||
30 | } | 37 | } |
31 | 38 | ||
32 | public void Close() | 39 | public void Close() |
@@ -36,9 +43,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
36 | 43 | ||
37 | public void AddRegion(Scene scene) | 44 | public void AddRegion(Scene scene) |
38 | { | 45 | { |
46 | |||
39 | if (!enabledYN) | 47 | if (!enabledYN) |
40 | return; | 48 | return; |
41 | 49 | ||
50 | lock (m_startingScenes) | ||
51 | m_startingScenes.Add(scene.RegionInfo.originRegionID, scene); | ||
52 | |||
42 | Border northBorder = new Border(); | 53 | Border northBorder = new Border(); |
43 | northBorder.BorderLine = new Vector3(0, (int)Constants.RegionSize, (int)Constants.RegionSize); //<--- | 54 | northBorder.BorderLine = new Vector3(0, (int)Constants.RegionSize, (int)Constants.RegionSize); //<--- |
44 | northBorder.CrossDirection = Cardinals.N; | 55 | northBorder.CrossDirection = Cardinals.N; |
@@ -464,11 +475,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
464 | } | 475 | } |
465 | 476 | ||
466 | } | 477 | } |
478 | |||
467 | } | 479 | } |
468 | 480 | ||
469 | public void RemoveRegion(Scene scene) | 481 | public void RemoveRegion(Scene scene) |
470 | { | 482 | { |
471 | 483 | ||
484 | |||
472 | } | 485 | } |
473 | 486 | ||
474 | public void RegionLoaded(Scene scene) | 487 | public void RegionLoaded(Scene scene) |
@@ -480,9 +493,62 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
480 | { | 493 | { |
481 | 494 | ||
482 | } | 495 | } |
483 | public void OnFrame() | 496 | |
497 | // Create a set of infinite borders around the whole aabb of the combined island. | ||
498 | private void MakeLargeRegionBounds() | ||
484 | { | 499 | { |
485 | 500 | lock (m_regions) | |
501 | { | ||
502 | foreach (RegionConnections rconn in m_regions.Values) | ||
503 | { | ||
504 | Vector3 offset = Vector3.Zero; | ||
505 | rconn.RegionScene.BordersLocked = true; | ||
506 | foreach (RegionData rdata in rconn.ConnectedRegions) | ||
507 | { | ||
508 | if (rdata.Offset.X > offset.X) offset.X = rdata.Offset.X; | ||
509 | if (rdata.Offset.Y > offset.Y) offset.Y = rdata.Offset.Y; | ||
510 | |||
511 | } | ||
512 | |||
513 | lock (rconn.RegionScene.NorthBorders) | ||
514 | { | ||
515 | Border northBorder = new Border(); | ||
516 | northBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, | ||
517 | offset.Y); //<--- | ||
518 | northBorder.CrossDirection = Cardinals.N; | ||
519 | rconn.RegionScene.NorthBorders.Add(northBorder); | ||
520 | } | ||
521 | |||
522 | lock (rconn.RegionScene.SouthBorders) | ||
523 | { | ||
524 | Border southBorder = new Border(); | ||
525 | southBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, 0); //---> | ||
526 | southBorder.CrossDirection = Cardinals.S; | ||
527 | rconn.RegionScene.SouthBorders.Add(southBorder); | ||
528 | } | ||
529 | |||
530 | lock (rconn.RegionScene.EastBorders) | ||
531 | { | ||
532 | Border eastBorder = new Border(); | ||
533 | eastBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, offset.Y); | ||
534 | //<--- | ||
535 | eastBorder.CrossDirection = Cardinals.E; | ||
536 | rconn.RegionScene.EastBorders.Add(eastBorder); | ||
537 | } | ||
538 | |||
539 | lock (rconn.RegionScene.WestBorders) | ||
540 | { | ||
541 | Border westBorder = new Border(); | ||
542 | westBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, 0); //---> | ||
543 | westBorder.CrossDirection = Cardinals.W; | ||
544 | rconn.RegionScene.WestBorders.Add(westBorder); | ||
545 | } | ||
546 | |||
547 | |||
548 | |||
549 | rconn.RegionScene.BordersLocked = false; | ||
550 | } | ||
551 | } | ||
486 | } | 552 | } |
487 | 553 | ||
488 | 554 | ||