diff options
author | Robert Adams | 2015-09-08 04:54:16 -0700 |
---|---|---|
committer | Robert Adams | 2015-09-08 04:54:16 -0700 |
commit | e5367d822be9b05e74c859afe2d2956a3e95aa33 (patch) | |
tree | e904050a30715df587aa527d7f313755177726a7 /OpenSim/Region/Application/OpenSimBase.cs | |
parent | add lost admin_reset_land method (diff) | |
parent | Deleted access control spec from [LoginService] section of standalone config.... (diff) | |
download | opensim-SC-e5367d822be9b05e74c859afe2d2956a3e95aa33.zip opensim-SC-e5367d822be9b05e74c859afe2d2956a3e95aa33.tar.gz opensim-SC-e5367d822be9b05e74c859afe2d2956a3e95aa33.tar.bz2 opensim-SC-e5367d822be9b05e74c859afe2d2956a3e95aa33.tar.xz |
Merge of ubitworkvarnew with opensim/master as of 20150905.
This integrates the OpenSim refactoring to make physics, etc into modules.
AVN physics hasn't been moved to new location.
Does not compile yet.
Merge branch 'osmaster' into mbworknew1
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 125 |
1 files changed, 24 insertions, 101 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 9108e5d..a7ebff3 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -36,17 +36,15 @@ using log4net; | |||
36 | using Nini.Config; | 36 | using Nini.Config; |
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Communications; | ||
40 | using OpenSim.Framework.Console; | 39 | using OpenSim.Framework.Console; |
41 | using OpenSim.Framework.Servers; | 40 | using OpenSim.Framework.Servers; |
42 | using OpenSim.Framework.Servers.HttpServer; | 41 | using OpenSim.Framework.Servers.HttpServer; |
43 | using OpenSim.Framework.Monitoring; | 42 | using OpenSim.Framework.Monitoring; |
44 | using OpenSim.Region.ClientStack; | ||
45 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; | 43 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; |
46 | using OpenSim.Region.Framework; | 44 | using OpenSim.Region.Framework; |
47 | using OpenSim.Region.Framework.Interfaces; | 45 | using OpenSim.Region.Framework.Interfaces; |
48 | using OpenSim.Region.Framework.Scenes; | 46 | using OpenSim.Region.Framework.Scenes; |
49 | using OpenSim.Region.Physics.Manager; | 47 | using OpenSim.Region.PhysicsModules.SharedBase; |
50 | using OpenSim.Server.Base; | 48 | using OpenSim.Server.Base; |
51 | using OpenSim.Services.Base; | 49 | using OpenSim.Services.Base; |
52 | using OpenSim.Services.Interfaces; | 50 | using OpenSim.Services.Interfaces; |
@@ -121,19 +119,12 @@ namespace OpenSim | |||
121 | /// </value> | 119 | /// </value> |
122 | public OpenSimConfigSource ConfigSource { get; private set; } | 120 | public OpenSimConfigSource ConfigSource { get; private set; } |
123 | 121 | ||
124 | public List<IClientNetworkServer> ClientServers | ||
125 | { | ||
126 | get { return m_clientServers; } | ||
127 | } | ||
128 | |||
129 | protected EnvConfigSource m_EnvConfigSource = new EnvConfigSource(); | 122 | protected EnvConfigSource m_EnvConfigSource = new EnvConfigSource(); |
130 | 123 | ||
131 | public EnvConfigSource envConfigSource | 124 | public EnvConfigSource envConfigSource |
132 | { | 125 | { |
133 | get { return m_EnvConfigSource; } | 126 | get { return m_EnvConfigSource; } |
134 | } | 127 | } |
135 | |||
136 | protected List<IClientNetworkServer> m_clientServers = new List<IClientNetworkServer>(); | ||
137 | 128 | ||
138 | public uint HttpServerPort | 129 | public uint HttpServerPort |
139 | { | 130 | { |
@@ -371,9 +362,9 @@ namespace OpenSim | |||
371 | /// <param name="regionInfo"></param> | 362 | /// <param name="regionInfo"></param> |
372 | /// <param name="portadd_flag"></param> | 363 | /// <param name="portadd_flag"></param> |
373 | /// <returns></returns> | 364 | /// <returns></returns> |
374 | public List<IClientNetworkServer> CreateRegion(RegionInfo regionInfo, bool portadd_flag, out IScene scene) | 365 | public void CreateRegion(RegionInfo regionInfo, bool portadd_flag, out IScene scene) |
375 | { | 366 | { |
376 | return CreateRegion(regionInfo, portadd_flag, false, out scene); | 367 | CreateRegion(regionInfo, portadd_flag, false, out scene); |
377 | } | 368 | } |
378 | 369 | ||
379 | /// <summary> | 370 | /// <summary> |
@@ -381,9 +372,9 @@ namespace OpenSim | |||
381 | /// </summary> | 372 | /// </summary> |
382 | /// <param name="regionInfo"></param> | 373 | /// <param name="regionInfo"></param> |
383 | /// <returns></returns> | 374 | /// <returns></returns> |
384 | public List<IClientNetworkServer> CreateRegion(RegionInfo regionInfo, out IScene scene) | 375 | public void CreateRegion(RegionInfo regionInfo, out IScene scene) |
385 | { | 376 | { |
386 | return CreateRegion(regionInfo, false, true, out scene); | 377 | CreateRegion(regionInfo, false, true, out scene); |
387 | } | 378 | } |
388 | 379 | ||
389 | /// <summary> | 380 | /// <summary> |
@@ -393,7 +384,7 @@ namespace OpenSim | |||
393 | /// <param name="portadd_flag"></param> | 384 | /// <param name="portadd_flag"></param> |
394 | /// <param name="do_post_init"></param> | 385 | /// <param name="do_post_init"></param> |
395 | /// <returns></returns> | 386 | /// <returns></returns> |
396 | public List<IClientNetworkServer> CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init, out IScene mscene) | 387 | public void CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init, out IScene mscene) |
397 | { | 388 | { |
398 | int port = regionInfo.InternalEndPoint.Port; | 389 | int port = regionInfo.InternalEndPoint.Port; |
399 | 390 | ||
@@ -418,8 +409,7 @@ namespace OpenSim | |||
418 | Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName); | 409 | Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName); |
419 | } | 410 | } |
420 | 411 | ||
421 | List<IClientNetworkServer> clientServers; | 412 | Scene scene = SetupScene(regionInfo, proxyOffset, Config); |
422 | Scene scene = SetupScene(regionInfo, proxyOffset, Config, out clientServers); | ||
423 | 413 | ||
424 | m_log.Info("[MODULES]: Loading Region's modules (old style)"); | 414 | m_log.Info("[MODULES]: Loading Region's modules (old style)"); |
425 | 415 | ||
@@ -511,14 +501,14 @@ namespace OpenSim | |||
511 | 501 | ||
512 | SceneManager.Add(scene); | 502 | SceneManager.Add(scene); |
513 | 503 | ||
514 | if (m_autoCreateClientStack) | 504 | //if (m_autoCreateClientStack) |
515 | { | 505 | //{ |
516 | foreach (IClientNetworkServer clientserver in clientServers) | 506 | // foreach (IClientNetworkServer clientserver in clientServers) |
517 | { | 507 | // { |
518 | m_clientServers.Add(clientserver); | 508 | // m_clientServers.Add(clientserver); |
519 | clientserver.Start(); | 509 | // clientserver.Start(); |
520 | } | 510 | // } |
521 | } | 511 | //} |
522 | 512 | ||
523 | if (scene.SnmpService != null) | 513 | if (scene.SnmpService != null) |
524 | { | 514 | { |
@@ -534,7 +524,7 @@ namespace OpenSim | |||
534 | scene.SnmpService.LinkUp(scene); | 524 | scene.SnmpService.LinkUp(scene); |
535 | } | 525 | } |
536 | 526 | ||
537 | return clientServers; | 527 | //return clientServers; |
538 | } | 528 | } |
539 | 529 | ||
540 | /// <summary> | 530 | /// <summary> |
@@ -673,7 +663,7 @@ namespace OpenSim | |||
673 | 663 | ||
674 | scene.DeleteAllSceneObjects(); | 664 | scene.DeleteAllSceneObjects(); |
675 | SceneManager.CloseScene(scene); | 665 | SceneManager.CloseScene(scene); |
676 | ShutdownClientServer(scene.RegionInfo); | 666 | //ShutdownClientServer(scene.RegionInfo); |
677 | 667 | ||
678 | if (!cleanup) | 668 | if (!cleanup) |
679 | return; | 669 | return; |
@@ -734,7 +724,7 @@ namespace OpenSim | |||
734 | } | 724 | } |
735 | 725 | ||
736 | SceneManager.CloseScene(scene); | 726 | SceneManager.CloseScene(scene); |
737 | ShutdownClientServer(scene.RegionInfo); | 727 | //ShutdownClientServer(scene.RegionInfo); |
738 | } | 728 | } |
739 | 729 | ||
740 | /// <summary> | 730 | /// <summary> |
@@ -755,9 +745,9 @@ namespace OpenSim | |||
755 | /// <param name="regionInfo"></param> | 745 | /// <param name="regionInfo"></param> |
756 | /// <param name="clientServer"> </param> | 746 | /// <param name="clientServer"> </param> |
757 | /// <returns></returns> | 747 | /// <returns></returns> |
758 | protected Scene SetupScene(RegionInfo regionInfo, out List<IClientNetworkServer> clientServer) | 748 | protected Scene SetupScene(RegionInfo regionInfo) |
759 | { | 749 | { |
760 | return SetupScene(regionInfo, 0, null, out clientServer); | 750 | return SetupScene(regionInfo, 0, null); |
761 | } | 751 | } |
762 | 752 | ||
763 | /// <summary> | 753 | /// <summary> |
@@ -768,55 +758,18 @@ namespace OpenSim | |||
768 | /// <param name="configSource"></param> | 758 | /// <param name="configSource"></param> |
769 | /// <param name="clientServer"> </param> | 759 | /// <param name="clientServer"> </param> |
770 | /// <returns></returns> | 760 | /// <returns></returns> |
771 | protected Scene SetupScene( | 761 | protected Scene SetupScene(RegionInfo regionInfo, int proxyOffset, IConfigSource configSource) |
772 | RegionInfo regionInfo, int proxyOffset, IConfigSource configSource, out List<IClientNetworkServer> clientServer) | ||
773 | { | 762 | { |
774 | List<IClientNetworkServer> clientNetworkServers = null; | 763 | //List<IClientNetworkServer> clientNetworkServers = null; |
775 | 764 | ||
776 | AgentCircuitManager circuitManager = new AgentCircuitManager(); | 765 | AgentCircuitManager circuitManager = new AgentCircuitManager(); |
777 | IPAddress listenIP = regionInfo.InternalEndPoint.Address; | ||
778 | //if (!IPAddress.TryParse(regionInfo.InternalEndPoint, out listenIP)) | ||
779 | // listenIP = IPAddress.Parse("0.0.0.0"); | ||
780 | |||
781 | uint port = (uint) regionInfo.InternalEndPoint.Port; | ||
782 | |||
783 | if (m_autoCreateClientStack) | ||
784 | { | ||
785 | clientNetworkServers = m_clientStackManager.CreateServers( | ||
786 | listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, configSource, | ||
787 | circuitManager); | ||
788 | } | ||
789 | else | ||
790 | { | ||
791 | clientServer = null; | ||
792 | } | ||
793 | |||
794 | regionInfo.InternalEndPoint.Port = (int) port; | ||
795 | |||
796 | Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager); | 766 | Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager); |
797 | 767 | ||
798 | if (m_autoCreateClientStack) | ||
799 | { | ||
800 | foreach (IClientNetworkServer clientnetserver in clientNetworkServers) | ||
801 | { | ||
802 | clientnetserver.AddScene(scene); | ||
803 | } | ||
804 | } | ||
805 | clientServer = clientNetworkServers; | ||
806 | scene.LoadWorldMap(); | 768 | scene.LoadWorldMap(); |
807 | 769 | ||
808 | scene.PhysicsScene.RequestAssetMethod = scene.PhysicsRequestAsset; | ||
809 | scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); | ||
810 | scene.PhysicsScene.SetWaterLevel((float) regionInfo.RegionSettings.WaterHeight); | ||
811 | |||
812 | return scene; | 770 | return scene; |
813 | } | 771 | } |
814 | 772 | ||
815 | protected override ClientStackManager CreateClientStackManager() | ||
816 | { | ||
817 | return new ClientStackManager(m_configSettings.ClientstackDll); | ||
818 | } | ||
819 | |||
820 | protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, | 773 | protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, |
821 | IEstateDataService estateDataService, AgentCircuitManager circuitManager) | 774 | IEstateDataService estateDataService, AgentCircuitManager circuitManager) |
822 | { | 775 | { |
@@ -825,42 +778,18 @@ namespace OpenSim | |||
825 | SceneCommunicationService sceneGridService = new SceneCommunicationService(); | 778 | SceneCommunicationService sceneGridService = new SceneCommunicationService(); |
826 | 779 | ||
827 | return new Scene( | 780 | return new Scene( |
828 | regionInfo, circuitManager, physicsScene, sceneGridService, | 781 | regionInfo, circuitManager, |
829 | simDataService, estateDataService, | 782 | simDataService, estateDataService, |
830 | Config, m_version); | 783 | Config, m_version); |
831 | } | 784 | } |
832 | 785 | ||
833 | protected void ShutdownClientServer(RegionInfo whichRegion) | ||
834 | { | ||
835 | // Close and remove the clientserver for a region | ||
836 | bool foundClientServer = false; | ||
837 | int clientServerElement = 0; | ||
838 | Location location = new Location(whichRegion.RegionHandle); | ||
839 | |||
840 | for (int i = 0; i < m_clientServers.Count; i++) | ||
841 | { | ||
842 | if (m_clientServers[i].HandlesRegion(location)) | ||
843 | { | ||
844 | clientServerElement = i; | ||
845 | foundClientServer = true; | ||
846 | break; | ||
847 | } | ||
848 | } | ||
849 | |||
850 | if (foundClientServer) | ||
851 | { | ||
852 | m_clientServers[clientServerElement].Stop(); | ||
853 | m_clientServers.RemoveAt(clientServerElement); | ||
854 | } | ||
855 | } | ||
856 | |||
857 | protected virtual void HandleRestartRegion(RegionInfo whichRegion) | 786 | protected virtual void HandleRestartRegion(RegionInfo whichRegion) |
858 | { | 787 | { |
859 | m_log.InfoFormat( | 788 | m_log.InfoFormat( |
860 | "[OPENSIM]: Got restart signal from SceneManager for region {0} ({1},{2})", | 789 | "[OPENSIM]: Got restart signal from SceneManager for region {0} ({1},{2})", |
861 | whichRegion.RegionName, whichRegion.RegionLocX, whichRegion.RegionLocY); | 790 | whichRegion.RegionName, whichRegion.RegionLocX, whichRegion.RegionLocY); |
862 | 791 | ||
863 | ShutdownClientServer(whichRegion); | 792 | //ShutdownClientServer(whichRegion); |
864 | IScene scene; | 793 | IScene scene; |
865 | CreateRegion(whichRegion, true, out scene); | 794 | CreateRegion(whichRegion, true, out scene); |
866 | scene.Start(); | 795 | scene.Start(); |
@@ -868,12 +797,6 @@ namespace OpenSim | |||
868 | 797 | ||
869 | # region Setup methods | 798 | # region Setup methods |
870 | 799 | ||
871 | protected override PhysicsScene GetPhysicsScene(string osSceneIdentifier, Vector3 regionExtent) | ||
872 | { | ||
873 | return GetPhysicsScene( | ||
874 | m_configSettings.PhysicsEngine, m_configSettings.MeshEngineName, Config, osSceneIdentifier, regionExtent); | ||
875 | } | ||
876 | |||
877 | /// <summary> | 800 | /// <summary> |
878 | /// Handler to supply the current status of this sim | 801 | /// Handler to supply the current status of this sim |
879 | /// </summary> | 802 | /// </summary> |