aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs151
1 files changed, 68 insertions, 83 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 980fa85..6e984d8 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -41,7 +41,6 @@ using OpenSim.Framework.Console;
41using OpenSim.Framework.Servers; 41using OpenSim.Framework.Servers;
42using OpenSim.Framework.Servers.HttpServer; 42using OpenSim.Framework.Servers.HttpServer;
43using OpenSim.Framework.Monitoring; 43using OpenSim.Framework.Monitoring;
44using OpenSim.Region.ClientStack;
45using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; 44using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts;
46using OpenSim.Region.Framework; 45using OpenSim.Region.Framework;
47using OpenSim.Region.Framework.Interfaces; 46using OpenSim.Region.Framework.Interfaces;
@@ -117,19 +116,12 @@ namespace OpenSim
117 /// </value> 116 /// </value>
118 public OpenSimConfigSource ConfigSource { get; private set; } 117 public OpenSimConfigSource ConfigSource { get; private set; }
119 118
120 public List<IClientNetworkServer> ClientServers
121 {
122 get { return m_clientServers; }
123 }
124
125 protected EnvConfigSource m_EnvConfigSource = new EnvConfigSource(); 119 protected EnvConfigSource m_EnvConfigSource = new EnvConfigSource();
126 120
127 public EnvConfigSource envConfigSource 121 public EnvConfigSource envConfigSource
128 { 122 {
129 get { return m_EnvConfigSource; } 123 get { return m_EnvConfigSource; }
130 } 124 }
131
132 protected List<IClientNetworkServer> m_clientServers = new List<IClientNetworkServer>();
133 125
134 public uint HttpServerPort 126 public uint HttpServerPort
135 { 127 {
@@ -359,9 +351,9 @@ namespace OpenSim
359 /// <param name="regionInfo"></param> 351 /// <param name="regionInfo"></param>
360 /// <param name="portadd_flag"></param> 352 /// <param name="portadd_flag"></param>
361 /// <returns></returns> 353 /// <returns></returns>
362 public List<IClientNetworkServer> CreateRegion(RegionInfo regionInfo, bool portadd_flag, out IScene scene) 354 public void CreateRegion(RegionInfo regionInfo, bool portadd_flag, out IScene scene)
363 { 355 {
364 return CreateRegion(regionInfo, portadd_flag, false, out scene); 356 CreateRegion(regionInfo, portadd_flag, false, out scene);
365 } 357 }
366 358
367 /// <summary> 359 /// <summary>
@@ -369,9 +361,9 @@ namespace OpenSim
369 /// </summary> 361 /// </summary>
370 /// <param name="regionInfo"></param> 362 /// <param name="regionInfo"></param>
371 /// <returns></returns> 363 /// <returns></returns>
372 public List<IClientNetworkServer> CreateRegion(RegionInfo regionInfo, out IScene scene) 364 public void CreateRegion(RegionInfo regionInfo, out IScene scene)
373 { 365 {
374 return CreateRegion(regionInfo, false, true, out scene); 366 CreateRegion(regionInfo, false, true, out scene);
375 } 367 }
376 368
377 /// <summary> 369 /// <summary>
@@ -381,7 +373,7 @@ namespace OpenSim
381 /// <param name="portadd_flag"></param> 373 /// <param name="portadd_flag"></param>
382 /// <param name="do_post_init"></param> 374 /// <param name="do_post_init"></param>
383 /// <returns></returns> 375 /// <returns></returns>
384 public List<IClientNetworkServer> CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init, out IScene mscene) 376 public void CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init, out IScene mscene)
385 { 377 {
386 int port = regionInfo.InternalEndPoint.Port; 378 int port = regionInfo.InternalEndPoint.Port;
387 379
@@ -406,8 +398,7 @@ namespace OpenSim
406 Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName); 398 Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName);
407 } 399 }
408 400
409 List<IClientNetworkServer> clientServers; 401 Scene scene = SetupScene(regionInfo, proxyOffset, Config);
410 Scene scene = SetupScene(regionInfo, proxyOffset, Config, out clientServers);
411 402
412 m_log.Info("[MODULES]: Loading Region's modules (old style)"); 403 m_log.Info("[MODULES]: Loading Region's modules (old style)");
413 404
@@ -455,20 +446,20 @@ namespace OpenSim
455 446
456 SceneManager.Add(scene); 447 SceneManager.Add(scene);
457 448
458 if (m_autoCreateClientStack) 449 //if (m_autoCreateClientStack)
459 { 450 //{
460 foreach (IClientNetworkServer clientserver in clientServers) 451 // foreach (IClientNetworkServer clientserver in clientServers)
461 { 452 // {
462 m_clientServers.Add(clientserver); 453 // m_clientServers.Add(clientserver);
463 clientserver.Start(); 454 // clientserver.Start();
464 } 455 // }
465 } 456 //}
466 457
467 scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); }; 458 scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); };
468 459
469 mscene = scene; 460 mscene = scene;
470 461
471 return clientServers; 462 //return clientServers;
472 } 463 }
473 464
474 /// <summary> 465 /// <summary>
@@ -602,7 +593,7 @@ namespace OpenSim
602 593
603 scene.DeleteAllSceneObjects(); 594 scene.DeleteAllSceneObjects();
604 SceneManager.CloseScene(scene); 595 SceneManager.CloseScene(scene);
605 ShutdownClientServer(scene.RegionInfo); 596 //ShutdownClientServer(scene.RegionInfo);
606 597
607 if (!cleanup) 598 if (!cleanup)
608 return; 599 return;
@@ -663,7 +654,7 @@ namespace OpenSim
663 } 654 }
664 655
665 SceneManager.CloseScene(scene); 656 SceneManager.CloseScene(scene);
666 ShutdownClientServer(scene.RegionInfo); 657 //ShutdownClientServer(scene.RegionInfo);
667 } 658 }
668 659
669 /// <summary> 660 /// <summary>
@@ -684,9 +675,9 @@ namespace OpenSim
684 /// <param name="regionInfo"></param> 675 /// <param name="regionInfo"></param>
685 /// <param name="clientServer"> </param> 676 /// <param name="clientServer"> </param>
686 /// <returns></returns> 677 /// <returns></returns>
687 protected Scene SetupScene(RegionInfo regionInfo, out List<IClientNetworkServer> clientServer) 678 protected Scene SetupScene(RegionInfo regionInfo)
688 { 679 {
689 return SetupScene(regionInfo, 0, null, out clientServer); 680 return SetupScene(regionInfo, 0, null);
690 } 681 }
691 682
692 /// <summary> 683 /// <summary>
@@ -697,51 +688,45 @@ namespace OpenSim
697 /// <param name="configSource"></param> 688 /// <param name="configSource"></param>
698 /// <param name="clientServer"> </param> 689 /// <param name="clientServer"> </param>
699 /// <returns></returns> 690 /// <returns></returns>
700 protected Scene SetupScene( 691 protected Scene SetupScene(RegionInfo regionInfo, int proxyOffset, IConfigSource configSource)
701 RegionInfo regionInfo, int proxyOffset, IConfigSource configSource, out List<IClientNetworkServer> clientServer)
702 { 692 {
703 List<IClientNetworkServer> clientNetworkServers = null; 693 //List<IClientNetworkServer> clientNetworkServers = null;
704 694
705 AgentCircuitManager circuitManager = new AgentCircuitManager(); 695 AgentCircuitManager circuitManager = new AgentCircuitManager();
706 IPAddress listenIP = regionInfo.InternalEndPoint.Address; 696 //IPAddress listenIP = regionInfo.InternalEndPoint.Address;
707 //if (!IPAddress.TryParse(regionInfo.InternalEndPoint, out listenIP)) 697 ////if (!IPAddress.TryParse(regionInfo.InternalEndPoint, out listenIP))
708 // listenIP = IPAddress.Parse("0.0.0.0"); 698 //// listenIP = IPAddress.Parse("0.0.0.0");
709 699
710 uint port = (uint) regionInfo.InternalEndPoint.Port; 700 //uint port = (uint) regionInfo.InternalEndPoint.Port;
711 701
712 if (m_autoCreateClientStack) 702 //if (m_autoCreateClientStack)
713 { 703 //{
714 clientNetworkServers = m_clientStackManager.CreateServers( 704 // clientNetworkServers = m_clientStackManager.CreateServers(
715 listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, configSource, 705 // listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, configSource,
716 circuitManager); 706 // circuitManager);
717 } 707 //}
718 else 708 //else
719 { 709 //{
720 clientServer = null; 710 // clientServer = null;
721 } 711 //}
722 712
723 regionInfo.InternalEndPoint.Port = (int) port; 713 //regionInfo.InternalEndPoint.Port = (int) port;
724 714
725 Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager); 715 Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager);
726 716
727 if (m_autoCreateClientStack) 717 //if (m_autoCreateClientStack)
728 { 718 //{
729 foreach (IClientNetworkServer clientnetserver in clientNetworkServers) 719 // foreach (IClientNetworkServer clientnetserver in clientNetworkServers)
730 { 720 // {
731 clientnetserver.AddScene(scene); 721 // clientnetserver.AddScene(scene);
732 } 722 // }
733 } 723 //}
734 clientServer = clientNetworkServers; 724 //clientServer = clientNetworkServers;
735 scene.LoadWorldMap(); 725 scene.LoadWorldMap();
736 726
737 return scene; 727 return scene;
738 } 728 }
739 729
740 protected override ClientStackManager CreateClientStackManager()
741 {
742 return new ClientStackManager(m_configSettings.ClientstackDll);
743 }
744
745 protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, 730 protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService,
746 IEstateDataService estateDataService, AgentCircuitManager circuitManager) 731 IEstateDataService estateDataService, AgentCircuitManager circuitManager)
747 { 732 {
@@ -751,29 +736,29 @@ namespace OpenSim
751 Config, m_version); 736 Config, m_version);
752 } 737 }
753 738
754 protected void ShutdownClientServer(RegionInfo whichRegion) 739 //protected void ShutdownClientServer(RegionInfo whichRegion)
755 { 740 //{
756 // Close and remove the clientserver for a region 741 // // Close and remove the clientserver for a region
757 bool foundClientServer = false; 742 // bool foundClientServer = false;
758 int clientServerElement = 0; 743 // int clientServerElement = 0;
759 Location location = new Location(whichRegion.RegionHandle); 744 // Location location = new Location(whichRegion.RegionHandle);
760 745
761 for (int i = 0; i < m_clientServers.Count; i++) 746 // for (int i = 0; i < m_clientServers.Count; i++)
762 { 747 // {
763 if (m_clientServers[i].HandlesRegion(location)) 748 // if (m_clientServers[i].HandlesRegion(location))
764 { 749 // {
765 clientServerElement = i; 750 // clientServerElement = i;
766 foundClientServer = true; 751 // foundClientServer = true;
767 break; 752 // break;
768 } 753 // }
769 } 754 // }
770 755
771 if (foundClientServer) 756 // if (foundClientServer)
772 { 757 // {
773 m_clientServers[clientServerElement].Stop(); 758 // m_clientServers[clientServerElement].Stop();
774 m_clientServers.RemoveAt(clientServerElement); 759 // m_clientServers.RemoveAt(clientServerElement);
775 } 760 // }
776 } 761 //}
777 762
778 protected virtual void HandleRestartRegion(RegionInfo whichRegion) 763 protected virtual void HandleRestartRegion(RegionInfo whichRegion)
779 { 764 {
@@ -781,7 +766,7 @@ namespace OpenSim
781 "[OPENSIM]: Got restart signal from SceneManager for region {0} ({1},{2})", 766 "[OPENSIM]: Got restart signal from SceneManager for region {0} ({1},{2})",
782 whichRegion.RegionName, whichRegion.RegionLocX, whichRegion.RegionLocY); 767 whichRegion.RegionName, whichRegion.RegionLocX, whichRegion.RegionLocY);
783 768
784 ShutdownClientServer(whichRegion); 769 //ShutdownClientServer(whichRegion);
785 IScene scene; 770 IScene scene;
786 CreateRegion(whichRegion, true, out scene); 771 CreateRegion(whichRegion, true, out scene);
787 scene.Start(); 772 scene.Start();