aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ThirdParty/3Di
diff options
context:
space:
mode:
authorJohan Berntsson2008-03-04 09:39:58 +0000
committerJohan Berntsson2008-03-04 09:39:58 +0000
commitc78eebfdfc64929d70b23e793475e89dc2f46de2 (patch)
treeeaf6acecf3ff4ead352b14aabc5ce2ccd63e8c38 /ThirdParty/3Di
parentFixed SQL update error (diff)
downloadopensim-SC_OLD-c78eebfdfc64929d70b23e793475e89dc2f46de2.zip
opensim-SC_OLD-c78eebfdfc64929d70b23e793475e89dc2f46de2.tar.gz
opensim-SC_OLD-c78eebfdfc64929d70b23e793475e89dc2f46de2.tar.bz2
opensim-SC_OLD-c78eebfdfc64929d70b23e793475e89dc2f46de2.tar.xz
Fixed a region split synchronization bug
Diffstat (limited to 'ThirdParty/3Di')
-rw-r--r--ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs54
1 files changed, 24 insertions, 30 deletions
diff --git a/ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs b/ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs
index f58e0ee..267fe3c 100644
--- a/ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs
+++ b/ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs
@@ -525,21 +525,6 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
525 udpserv = SearchUDPServerFromPortNum(scene.RegionInfo.InternalEndPoint.Port); 525 udpserv = SearchUDPServerFromPortNum(scene.RegionInfo.InternalEndPoint.Port);
526 526
527 // restore the scene presence 527 // restore the scene presence
528/*
529 files = Directory.GetFiles(import_dir, "Presence_*.bin");
530 Array.Sort(files);
531
532 foreach (string filename in files)
533 {
534 sp = (ScenePresence)Util.DeserializeFromFile(filename);
535 Console.WriteLine("agent id = {0}", sp.m_uuid);
536
537 scene.m_restorePresences.Add(sp.m_uuid, sp);
538 File.Delete(filename);
539
540 m_log.InfoFormat("[BALANCER] "+"scene presence deserialized [{0}]", sp.m_uuid);
541 }
542*/
543 for (int i = 0; ; i++) 528 for (int i = 0; ; i++)
544 { 529 {
545 string filename = import_dir + "Presence_" + String.Format("{0:0000}", i) + ".bin"; 530 string filename = import_dir + "Presence_" + String.Format("{0:0000}", i) + ".bin";
@@ -746,25 +731,34 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
746 // Disabling half of the avatars in master, and the other half in slave 731 // Disabling half of the avatars in master, and the other half in slave
747 732
748 int i = 0; 733 int i = 0;
749 List<ScenePresence> presences = scene.GetScenePresences();
750 presences.Sort();
751 foreach (ScenePresence pre in presences)
752 {
753 // Divide the presences evenly over the set of subscenes
754 ClientView client = (ClientView) pre.ControllingClient;
755 client.PacketProcessingEnabled = (( (i + myID) % sceneURL.Length) == 0);
756 734
757 m_log.InfoFormat("[SPLITSCENE] === SplitRegion {0}: SP.PacketEnabled {1}", region.RegionID, client.PacketProcessingEnabled); 735 List<uint> circuits = scene.ClientManager.GetAllCircuitCodes();
736 circuits.Sort();
758 737
759 if (!client.PacketProcessingEnabled) 738 IClientAPI controller = null;
760 {
761 // stopping clientview thread
762 client.Stop();
763 }
764 739
765 ++i; 740 foreach (uint code in circuits)
766 } 741 {
742 m_log.InfoFormat("[BALANCER] "+"circuit code : {0}", code);
743
744 if (scene.ClientManager.TryGetClient(code, out controller))
745 {
746 // Divide the presences evenly over the set of subscenes
747 ClientView client = (ClientView) controller;
748 client.PacketProcessingEnabled = (( (i + myID) % sceneURL.Length) == 0);
749
750 m_log.InfoFormat("[SPLITSCENE] === SplitRegion {0}: SP.PacketEnabled {1}", region.RegionID, client.PacketProcessingEnabled);
751
752 if (!client.PacketProcessingEnabled)
753 {
754 // stopping clientview thread
755 client.Stop();
756 }
767 757
758 ++i;
759 }
760 }
761
768 scene.splitID = myID; 762 scene.splitID = myID;
769 scene.SynchronizeScene = new Scene.SynchronizeSceneHandler(SynchronizeScenes); 763 scene.SynchronizeScene = new Scene.SynchronizeSceneHandler(SynchronizeScenes);
770 isSplit = true; 764 isSplit = true;