aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs
diff options
context:
space:
mode:
authorAdam Frisby2008-05-02 18:26:19 +0000
committerAdam Frisby2008-05-02 18:26:19 +0000
commit67bbfadc06f36b5175cd5f7268ba876769667dca (patch)
treebd4f485b5f72ef7a702af067d8656745f0dc3986 /ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs
parentadding a few more prep parts for this object (diff)
downloadopensim-SC_OLD-67bbfadc06f36b5175cd5f7268ba876769667dca.zip
opensim-SC_OLD-67bbfadc06f36b5175cd5f7268ba876769667dca.tar.gz
opensim-SC_OLD-67bbfadc06f36b5175cd5f7268ba876769667dca.tar.bz2
opensim-SC_OLD-67bbfadc06f36b5175cd5f7268ba876769667dca.tar.xz
* More refactorings of UDPServer.
* Removed all references where possible. * Renamed lots of variables from UDPServerXYZ to clientServerXYZ
Diffstat (limited to 'ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs')
-rw-r--r--ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs22
1 files changed, 10 insertions, 12 deletions
diff --git a/ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs b/ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs
index 668b413..9bccc0b 100644
--- a/ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs
+++ b/ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs
@@ -39,7 +39,6 @@ using Mono.Addins;
39using Nwc.XmlRpc; 39using Nwc.XmlRpc;
40using OpenSim.Framework; 40using OpenSim.Framework;
41using OpenSim.Framework.Servers; 41using OpenSim.Framework.Servers;
42//using OpenSim.Region.ClientStack.LindenUDP;
43using OpenSim.Region.ClientStack; 42using OpenSim.Region.ClientStack;
44using OpenSim.Region.ClientStack.LindenUDP; 43using OpenSim.Region.ClientStack.LindenUDP;
45using OpenSim.Region.Environment.Scenes; 44using OpenSim.Region.Environment.Scenes;
@@ -88,7 +87,7 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
88 AsynchronousSocketListener.PacketHandler = new AsynchronousSocketListener.PacketRecieveHandler(SynchronizePacketRecieve); 87 AsynchronousSocketListener.PacketHandler = new AsynchronousSocketListener.PacketRecieveHandler(SynchronizePacketRecieve);
89 88
90 sceneManager = openSim.SceneManager; 89 sceneManager = openSim.SceneManager;
91 m_clientServers = openSim.UdpServers; 90 m_clientServers = openSim.ClientServers;
92 regionData = openSim.RegionData; 91 regionData = openSim.RegionData;
93 simMain = openSim; 92 simMain = openSim;
94 commandServer = openSim.HttpServer; 93 commandServer = openSim.HttpServer;
@@ -390,7 +389,7 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
390 return result; 389 return result;
391 } 390 }
392 391
393 private IClientNetworkServer SearchUDPServerFromPortNum(int portnum) 392 private IClientNetworkServer SearchClientServerFromPortNum(int portnum)
394 { 393 {
395 return m_clientServers.Find(delegate(IClientNetworkServer server) { return (portnum + proxyOffset == ((IPEndPoint)server.Server.LocalEndPoint).Port); }); 394 return m_clientServers.Find(delegate(IClientNetworkServer server) { return (portnum + proxyOffset == ((IPEndPoint)server.Server.LocalEndPoint).Port); });
396 } 395 }
@@ -522,12 +521,11 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
522 Scene scene = null; 521 Scene scene = null;
523 string[] files = null; 522 string[] files = null;
524 IClientAPI controller = null; 523 IClientAPI controller = null;
525 IClientNetworkServer udpserv = null; 524 IClientNetworkServer clientserv = null;
526 525
527 if (sceneManager.TryGetScene(dst_region.RegionID, out scene)) 526 if (sceneManager.TryGetScene(dst_region.RegionID, out scene))
528 { 527 {
529 // search udpserver 528 clientserv = SearchClientServerFromPortNum(scene.RegionInfo.InternalEndPoint.Port);
530 udpserv = SearchUDPServerFromPortNum(scene.RegionInfo.InternalEndPoint.Port);
531 529
532 // restore the scene presence 530 // restore the scene presence
533 for (int i = 0;; i++) 531 for (int i = 0;; i++)
@@ -565,9 +563,9 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
565 563
566 // BUG: Will only work with LLUDPServer. 564 // BUG: Will only work with LLUDPServer.
567 // TODO: This needs to be abstracted and converted into IClientNetworkServer 565 // TODO: This needs to be abstracted and converted into IClientNetworkServer
568 if (udpserv is LLUDPServer) 566 if (clientserv is LLUDPServer)
569 { 567 {
570 ((LLUDPServer) udpserv).RestoreClient(agentdata, data.userEP, data.proxyEP); 568 ((LLUDPServer) clientserv).RestoreClient(agentdata, data.userEP, data.proxyEP);
571 } 569 }
572 570
573 // waiting for the scene-presense restored 571 // waiting for the scene-presense restored
@@ -627,12 +625,12 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
627 } 625 }
628 626
629 // Shutting down the UDP server 627 // Shutting down the UDP server
630 IClientNetworkServer udpsvr = SearchUDPServerFromPortNum(port); 628 IClientNetworkServer clientsvr = SearchClientServerFromPortNum(port);
631 629
632 if (udpsvr != null) 630 if (clientsvr != null)
633 { 631 {
634 udpsvr.Server.Close(); 632 clientsvr.Server.Close();
635 m_clientServers.Remove(udpsvr); 633 m_clientServers.Remove(clientsvr);
636 } 634 }
637 } 635 }
638 636