Fixed a region split synchronization bug
parent
fe56c18795
commit
c78eebfdfc
|
@ -158,6 +158,17 @@ namespace OpenSim.Framework
|
||||||
return circuits.ToArray();
|
return circuits.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<uint> GetAllCircuitCodes()
|
||||||
|
{
|
||||||
|
List<uint> circuits;
|
||||||
|
|
||||||
|
lock (m_clients)
|
||||||
|
{
|
||||||
|
circuits = new List<uint>(m_clients.Keys);
|
||||||
|
}
|
||||||
|
|
||||||
|
return circuits;
|
||||||
|
}
|
||||||
|
|
||||||
public void ViewerEffectHandler(IClientAPI sender, ViewerEffectPacket.EffectBlock[] effectBlock)
|
public void ViewerEffectHandler(IClientAPI sender, ViewerEffectPacket.EffectBlock[] effectBlock)
|
||||||
{
|
{
|
||||||
|
|
|
@ -525,21 +525,6 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
|
||||||
udpserv = SearchUDPServerFromPortNum(scene.RegionInfo.InternalEndPoint.Port);
|
udpserv = SearchUDPServerFromPortNum(scene.RegionInfo.InternalEndPoint.Port);
|
||||||
|
|
||||||
// restore the scene presence
|
// restore the scene presence
|
||||||
/*
|
|
||||||
files = Directory.GetFiles(import_dir, "Presence_*.bin");
|
|
||||||
Array.Sort(files);
|
|
||||||
|
|
||||||
foreach (string filename in files)
|
|
||||||
{
|
|
||||||
sp = (ScenePresence)Util.DeserializeFromFile(filename);
|
|
||||||
Console.WriteLine("agent id = {0}", sp.m_uuid);
|
|
||||||
|
|
||||||
scene.m_restorePresences.Add(sp.m_uuid, sp);
|
|
||||||
File.Delete(filename);
|
|
||||||
|
|
||||||
m_log.InfoFormat("[BALANCER] "+"scene presence deserialized [{0}]", sp.m_uuid);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
for (int i = 0; ; i++)
|
for (int i = 0; ; i++)
|
||||||
{
|
{
|
||||||
string filename = import_dir + "Presence_" + String.Format("{0:0000}", i) + ".bin";
|
string filename = import_dir + "Presence_" + String.Format("{0:0000}", i) + ".bin";
|
||||||
|
@ -746,12 +731,20 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
|
||||||
// Disabling half of the avatars in master, and the other half in slave
|
// Disabling half of the avatars in master, and the other half in slave
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
List<ScenePresence> presences = scene.GetScenePresences();
|
|
||||||
presences.Sort();
|
List<uint> circuits = scene.ClientManager.GetAllCircuitCodes();
|
||||||
foreach (ScenePresence pre in presences)
|
circuits.Sort();
|
||||||
|
|
||||||
|
IClientAPI controller = null;
|
||||||
|
|
||||||
|
foreach (uint code in circuits)
|
||||||
|
{
|
||||||
|
m_log.InfoFormat("[BALANCER] "+"circuit code : {0}", code);
|
||||||
|
|
||||||
|
if (scene.ClientManager.TryGetClient(code, out controller))
|
||||||
{
|
{
|
||||||
// Divide the presences evenly over the set of subscenes
|
// Divide the presences evenly over the set of subscenes
|
||||||
ClientView client = (ClientView) pre.ControllingClient;
|
ClientView client = (ClientView) controller;
|
||||||
client.PacketProcessingEnabled = (( (i + myID) % sceneURL.Length) == 0);
|
client.PacketProcessingEnabled = (( (i + myID) % sceneURL.Length) == 0);
|
||||||
|
|
||||||
m_log.InfoFormat("[SPLITSCENE] === SplitRegion {0}: SP.PacketEnabled {1}", region.RegionID, client.PacketProcessingEnabled);
|
m_log.InfoFormat("[SPLITSCENE] === SplitRegion {0}: SP.PacketEnabled {1}", region.RegionID, client.PacketProcessingEnabled);
|
||||||
|
@ -764,6 +757,7 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
|
||||||
|
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
scene.splitID = myID;
|
scene.splitID = myID;
|
||||||
scene.SynchronizeScene = new Scene.SynchronizeSceneHandler(SynchronizeScenes);
|
scene.SynchronizeScene = new Scene.SynchronizeSceneHandler(SynchronizeScenes);
|
||||||
|
|
Loading…
Reference in New Issue