aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
authorDiva Canto2015-09-03 15:59:06 -0700
committerDiva Canto2015-09-03 15:59:06 -0700
commitdac8edd5dddb5f3d2a2447fb479144429e32ea68 (patch)
tree5a68dcaa0f4cd75c97d16abb0a3c0bcb65b49d51 /OpenSim/Region/Application
parentMoved ExtendedPhysics from OptionalModules to Bullet project, because it's ve... (diff)
downloadopensim-SC-dac8edd5dddb5f3d2a2447fb479144429e32ea68.zip
opensim-SC-dac8edd5dddb5f3d2a2447fb479144429e32ea68.tar.gz
opensim-SC-dac8edd5dddb5f3d2a2447fb479144429e32ea68.tar.bz2
opensim-SC-dac8edd5dddb5f3d2a2447fb479144429e32ea68.tar.xz
Transformed the LLUDP ad-hoc plugin into a region module. It works.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSimBackground.cs2
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs151
-rw-r--r--OpenSim/Region/Application/RegionApplicationBase.cs (renamed from OpenSim/Region/ClientStack/RegionApplicationBase.cs)5
3 files changed, 70 insertions, 88 deletions
diff --git a/OpenSim/Region/Application/OpenSimBackground.cs b/OpenSim/Region/Application/OpenSimBackground.cs
index 008c6b0..15d9065 100644
--- a/OpenSim/Region/Application/OpenSimBackground.cs
+++ b/OpenSim/Region/Application/OpenSimBackground.cs
@@ -55,7 +55,7 @@ namespace OpenSim
55 base.Startup(); 55 base.Startup();
56 56
57 m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}", 57 m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}",
58 m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : ""); 58 SceneManager.Scenes.Count, SceneManager.Scenes.Count > 1 ? "s" : "");
59 59
60 WorldHasComeToAnEnd.WaitOne(); 60 WorldHasComeToAnEnd.WaitOne();
61 WorldHasComeToAnEnd.Close(); 61 WorldHasComeToAnEnd.Close();
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();
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/Application/RegionApplicationBase.cs
index 343780b..b58c998 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/Application/RegionApplicationBase.cs
@@ -41,7 +41,7 @@ using OpenSim.Region.Framework.Scenes;
41using OpenSim.Region.PhysicsModules.SharedBase; 41using OpenSim.Region.PhysicsModules.SharedBase;
42using OpenSim.Services.Interfaces; 42using OpenSim.Services.Interfaces;
43 43
44namespace OpenSim.Region.ClientStack 44namespace OpenSim
45{ 45{
46 public abstract class RegionApplicationBase : BaseOpenSimServer 46 public abstract class RegionApplicationBase : BaseOpenSimServer
47 { 47 {
@@ -53,7 +53,6 @@ namespace OpenSim.Region.ClientStack
53 protected uint m_httpServerPort; 53 protected uint m_httpServerPort;
54 protected ISimulationDataService m_simulationDataService; 54 protected ISimulationDataService m_simulationDataService;
55 protected IEstateDataService m_estateDataService; 55 protected IEstateDataService m_estateDataService;
56 protected ClientStackManager m_clientStackManager;
57 56
58 public SceneManager SceneManager { get; protected set; } 57 public SceneManager SceneManager { get; protected set; }
59 public NetworkServersInfo NetServersInfo { get { return m_networkServersInfo; } } 58 public NetworkServersInfo NetServersInfo { get { return m_networkServersInfo; } }
@@ -62,13 +61,11 @@ namespace OpenSim.Region.ClientStack
62 61
63 protected abstract void Initialize(); 62 protected abstract void Initialize();
64 63
65 protected abstract ClientStackManager CreateClientStackManager();
66 protected abstract Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager); 64 protected abstract Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager);
67 65
68 protected override void StartupSpecific() 66 protected override void StartupSpecific()
69 { 67 {
70 SceneManager = SceneManager.Instance; 68 SceneManager = SceneManager.Instance;
71 m_clientStackManager = CreateClientStackManager();
72 69
73 Initialize(); 70 Initialize();
74 71