aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
authorRobert Adams2015-09-08 04:54:16 -0700
committerRobert Adams2015-09-08 04:54:16 -0700
commite5367d822be9b05e74c859afe2d2956a3e95aa33 (patch)
treee904050a30715df587aa527d7f313755177726a7 /OpenSim/Region/Application
parentadd lost admin_reset_land method (diff)
parentDeleted access control spec from [LoginService] section of standalone config.... (diff)
downloadopensim-SC_OLD-e5367d822be9b05e74c859afe2d2956a3e95aa33.zip
opensim-SC_OLD-e5367d822be9b05e74c859afe2d2956a3e95aa33.tar.gz
opensim-SC_OLD-e5367d822be9b05e74c859afe2d2956a3e95aa33.tar.bz2
opensim-SC_OLD-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 '')
-rw-r--r--OpenSim/Region/Application/OpenSimBackground.cs2
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs125
-rw-r--r--OpenSim/Region/Application/RegionApplicationBase.cs (renamed from OpenSim/Region/ClientStack/RegionApplicationBase.cs)36
3 files changed, 27 insertions, 136 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 9108e5d..a7ebff3 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -36,17 +36,15 @@ using log4net;
36using Nini.Config; 36using Nini.Config;
37using OpenMetaverse; 37using OpenMetaverse;
38using OpenSim.Framework; 38using OpenSim.Framework;
39using OpenSim.Framework.Communications;
40using OpenSim.Framework.Console; 39using OpenSim.Framework.Console;
41using OpenSim.Framework.Servers; 40using OpenSim.Framework.Servers;
42using OpenSim.Framework.Servers.HttpServer; 41using OpenSim.Framework.Servers.HttpServer;
43using OpenSim.Framework.Monitoring; 42using OpenSim.Framework.Monitoring;
44using OpenSim.Region.ClientStack;
45using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; 43using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts;
46using OpenSim.Region.Framework; 44using OpenSim.Region.Framework;
47using OpenSim.Region.Framework.Interfaces; 45using OpenSim.Region.Framework.Interfaces;
48using OpenSim.Region.Framework.Scenes; 46using OpenSim.Region.Framework.Scenes;
49using OpenSim.Region.Physics.Manager; 47using OpenSim.Region.PhysicsModules.SharedBase;
50using OpenSim.Server.Base; 48using OpenSim.Server.Base;
51using OpenSim.Services.Base; 49using OpenSim.Services.Base;
52using OpenSim.Services.Interfaces; 50using 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>
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/Application/RegionApplicationBase.cs
index 332bff9..ba92fd6 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/Application/RegionApplicationBase.cs
@@ -32,16 +32,15 @@ using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenMetaverse; 33using OpenMetaverse;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Communications;
36using OpenSim.Framework.Servers; 35using OpenSim.Framework.Servers;
37using OpenSim.Framework.Servers.HttpServer; 36using OpenSim.Framework.Servers.HttpServer;
38using OpenSim.Region.Framework; 37using OpenSim.Region.Framework;
39using OpenSim.Region.Framework.Interfaces; 38using OpenSim.Region.Framework.Interfaces;
40using OpenSim.Region.Framework.Scenes; 39using OpenSim.Region.Framework.Scenes;
41using OpenSim.Region.Physics.Manager; 40using OpenSim.Region.PhysicsModules.SharedBase;
42using OpenSim.Services.Interfaces; 41using OpenSim.Services.Interfaces;
43 42
44namespace OpenSim.Region.ClientStack 43namespace OpenSim
45{ 44{
46 public abstract class RegionApplicationBase : BaseOpenSimServer 45 public abstract class RegionApplicationBase : BaseOpenSimServer
47 { 46 {
@@ -53,7 +52,6 @@ namespace OpenSim.Region.ClientStack
53 protected uint m_httpServerPort; 52 protected uint m_httpServerPort;
54 protected ISimulationDataService m_simulationDataService; 53 protected ISimulationDataService m_simulationDataService;
55 protected IEstateDataService m_estateDataService; 54 protected IEstateDataService m_estateDataService;
56 protected ClientStackManager m_clientStackManager;
57 55
58 public SceneManager SceneManager { get; protected set; } 56 public SceneManager SceneManager { get; protected set; }
59 public NetworkServersInfo NetServersInfo { get { return m_networkServersInfo; } } 57 public NetworkServersInfo NetServersInfo { get { return m_networkServersInfo; } }
@@ -62,23 +60,11 @@ namespace OpenSim.Region.ClientStack
62 60
63 protected abstract void Initialize(); 61 protected abstract void Initialize();
64 62
65 /// <summary>
66 /// Get a new physics scene.
67 /// </summary>
68 ///
69 /// <param name="osSceneIdentifier">
70 /// The name of the OpenSim scene this physics scene is serving. This will be used in log messages.
71 /// </param>
72 /// <returns></returns>
73 protected abstract PhysicsScene GetPhysicsScene(string osSceneIdentifier, Vector3 regionExtent);
74
75 protected abstract ClientStackManager CreateClientStackManager();
76 protected abstract Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager); 63 protected abstract Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager);
77 64
78 protected override void StartupSpecific() 65 protected override void StartupSpecific()
79 { 66 {
80 SceneManager = SceneManager.Instance; 67 SceneManager = SceneManager.Instance;
81 m_clientStackManager = CreateClientStackManager();
82 68
83 Initialize(); 69 Initialize();
84 70
@@ -125,23 +111,5 @@ namespace OpenSim.Region.ClientStack
125 base.StartupSpecific(); 111 base.StartupSpecific();
126 } 112 }
127 113
128 /// <summary>
129 /// Get a new physics scene.
130 /// </summary>
131 /// <param name="engine">The name of the physics engine to use</param>
132 /// <param name="meshEngine">The name of the mesh engine to use</param>
133 /// <param name="config">The configuration data to pass to the physics and mesh engines</param>
134 /// <param name="osSceneIdentifier">
135 /// The name of the OpenSim scene this physics scene is serving. This will be used in log messages.
136 /// </param>
137 /// <returns></returns>
138 protected PhysicsScene GetPhysicsScene(
139 string engine, string meshEngine, IConfigSource config, string osSceneIdentifier, Vector3 regionExtent)
140 {
141 PhysicsPluginManager physicsPluginManager;
142 physicsPluginManager = new PhysicsPluginManager();
143 physicsPluginManager.LoadPluginsFromAssemblies("Physics");
144 return physicsPluginManager.GetPhysicsScene(engine, meshEngine, config, osSceneIdentifier, regionExtent);
145 }
146 } 114 }
147} 115}