aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-10-03 19:42:35 +0000
committerJustin Clarke Casey2008-10-03 19:42:35 +0000
commit4920e52f11dadd650e5d9621968aaa60a01c8b9b (patch)
tree7ee51dbbacb9841b9176cdf3157a35e661fa0842 /OpenSim/Region
parent* Put in some infrastructure to allow tweaking of packet queue throttle value... (diff)
downloadopensim-SC-4920e52f11dadd650e5d9621968aaa60a01c8b9b.zip
opensim-SC-4920e52f11dadd650e5d9621968aaa60a01c8b9b.tar.gz
opensim-SC-4920e52f11dadd650e5d9621968aaa60a01c8b9b.tar.bz2
opensim-SC-4920e52f11dadd650e5d9621968aaa60a01c8b9b.tar.xz
* oops, fix build break.
* refactoring
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs26
-rw-r--r--OpenSim/Region/ClientStack/ClientStackManager.cs34
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs8
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs51
4 files changed, 81 insertions, 38 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 54dd51d..f845bf8 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -150,8 +150,7 @@ namespace OpenSim
150 set { m_moduleLoader = value; } 150 set { m_moduleLoader = value; }
151 } 151 }
152 152
153 public OpenSimBase(IConfigSource configSource) 153 public OpenSimBase(IConfigSource configSource) : base()
154 : base()
155 { 154 {
156 IConfig startupConfig = configSource.Configs["Startup"]; 155 IConfig startupConfig = configSource.Configs["Startup"];
157 156
@@ -179,7 +178,7 @@ namespace OpenSim
179 { 178 {
180 if (File.Exists("OpenSim.xml")) 179 if (File.Exists("OpenSim.xml"))
181 { 180 {
182 //check for a xml config file 181 // check for a xml config file
183 Application.iniFilePath = "OpenSim.xml"; 182 Application.iniFilePath = "OpenSim.xml";
184 m_config.Source = new XmlConfigSource(); 183 m_config.Source = new XmlConfigSource();
185 m_config.Source.Merge(new XmlConfigSource(Application.iniFilePath)); 184 m_config.Source.Merge(new XmlConfigSource(Application.iniFilePath));
@@ -187,9 +186,7 @@ namespace OpenSim
187 } 186 }
188 else 187 else
189 { 188 {
190 //Application.iniFilePath = "OpenSim.xml"; 189 // using OpenSim.ini instead
191 // m_config.ConfigSource = new XmlConfigSource();
192 // no default config files, so set default values, and save it
193 m_config.Source.Merge(DefaultConfig()); 190 m_config.Source.Merge(DefaultConfig());
194 m_config.Source.Merge(configSource); 191 m_config.Source.Merge(configSource);
195 m_config.Save(Application.iniFilePath); 192 m_config.Save(Application.iniFilePath);
@@ -293,7 +290,6 @@ namespace OpenSim
293 } 290 }
294 291
295 return DefaultConfig; 292 return DefaultConfig;
296
297 } 293 }
298 294
299 protected virtual void ReadConfigSettings() 295 protected virtual void ReadConfigSettings()
@@ -354,14 +350,15 @@ namespace OpenSim
354 protected void LoadPlugins() 350 protected void LoadPlugins()
355 { 351 {
356 PluginLoader<IApplicationPlugin> loader = 352 PluginLoader<IApplicationPlugin> loader =
357 new PluginLoader<IApplicationPlugin> (new ApplicationPluginInitialiser (this)); 353 new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this));
358 354
359 loader.Load ("/OpenSim/Startup"); 355 loader.Load("/OpenSim/Startup");
360 m_plugins = loader.Plugins; 356 m_plugins = loader.Plugins;
361 } 357 }
362 358
363 /// <summary> 359 /// <summary>
364 /// Performs initialisation of the scene, such as loading configuration from disk. 360 /// Performs startup specific to this region server, including initialization of the scene
361 /// such as loading configuration from disk.
365 /// </summary> 362 /// </summary>
366 protected override void StartupSpecific() 363 protected override void StartupSpecific()
367 { 364 {
@@ -501,9 +498,7 @@ namespace OpenSim
501 regionInfo.originRegionID = regionInfo.RegionID; 498 regionInfo.originRegionID = regionInfo.RegionID;
502 499
503 // set initial ServerURI 500 // set initial ServerURI
504 regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName 501 regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.InternalEndPoint.Port;
505 + ":" + regionInfo.InternalEndPoint.Port.ToString();
506
507 regionInfo.HttpPort = m_httpServerPort; 502 regionInfo.HttpPort = m_httpServerPort;
508 503
509 if ((proxyUrl.Length > 0) && (portadd_flag)) 504 if ((proxyUrl.Length > 0) && (portadd_flag))
@@ -514,11 +509,12 @@ namespace OpenSim
514 } 509 }
515 510
516 IClientNetworkServer clientServer; 511 IClientNetworkServer clientServer;
517 Scene scene = SetupScene(regionInfo, proxyOffset, out clientServer); 512 Scene scene = SetupScene(regionInfo, proxyOffset, null, out clientServer);
518 513
519 m_log.Info("[MODULES]: Loading Region's modules"); 514 m_log.Info("[MODULES]: Loading Region's modules");
520 515
521 List<IRegionModule> modules = m_moduleLoader.PickupModules(scene, "."); 516 List<IRegionModule> modules = m_moduleLoader.PickupModules(scene, ".");
517
522 // This needs to be ahead of the script engine load, so the 518 // This needs to be ahead of the script engine load, so the
523 // script module can pick up events exposed by a module 519 // script module can pick up events exposed by a module
524 m_moduleLoader.InitialiseSharedModules(scene); 520 m_moduleLoader.InitialiseSharedModules(scene);
@@ -530,7 +526,7 @@ namespace OpenSim
530 526
531 scene.StartTimer(); 527 scene.StartTimer();
532 528
533 //moved these here as the terrain texture has to be created after the modules are initialized 529 // moved these here as the terrain texture has to be created after the modules are initialized
534 // and has to happen before the region is registered with the grid. 530 // and has to happen before the region is registered with the grid.
535 scene.CreateTerrainTexture(false); 531 scene.CreateTerrainTexture(false);
536 532
diff --git a/OpenSim/Region/ClientStack/ClientStackManager.cs b/OpenSim/Region/ClientStack/ClientStackManager.cs
index 0b0c07f..2751e0a 100644
--- a/OpenSim/Region/ClientStack/ClientStackManager.cs
+++ b/OpenSim/Region/ClientStack/ClientStackManager.cs
@@ -65,11 +65,45 @@ namespace OpenSim.Region.Environment
65 } 65 }
66 } 66 }
67 } 67 }
68
69 /// <summary>
70 /// Create a server that can set up sessions for virtual world client <-> server communications
71 /// </summary>
72 /// <param name="_listenIP"></param>
73 /// <param name="port"></param>
74 /// <param name="proxyPortOffset"></param>
75 /// <param name="allow_alternate_port"></param>
76 /// <param name="assetCache"></param>
77 /// <param name="authenticateClass"></param>
78 /// <returns></returns>
79 public IClientNetworkServer CreateServer(
80 IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port,
81 AssetCache assetCache, AgentCircuitManager authenticateClass)
82 {
83 return CreateServer(
84 _listenIP, ref port, proxyPortOffset, allow_alternate_port, null, assetCache, authenticateClass);
85 }
68 86
87 /// <summary>
88 /// Create a server that can set up sessions for virtual world client <-> server communications
89 /// </summary>
90 /// <param name="_listenIP"></param>
91 /// <param name="port"></param>
92 /// <param name="proxyPortOffset"></param>
93 /// <param name="allow_alternate_port"></param>
94 /// <param name="settings">
95 /// Can be null, in which case default values are used
96 /// </param>
97 /// <param name="assetCache"></param>
98 /// <param name="authenticateClass"></param>
99 /// <returns></returns>
69 public IClientNetworkServer CreateServer( 100 public IClientNetworkServer CreateServer(
70 IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, ClientStackUserSettings settings, 101 IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, ClientStackUserSettings settings,
71 AssetCache assetCache, AgentCircuitManager authenticateClass) 102 AssetCache assetCache, AgentCircuitManager authenticateClass)
72 { 103 {
104 if (null == settings)
105 settings = new ClientStackUserSettings();
106
73 if (plugin != null) 107 if (plugin != null)
74 { 108 {
75 IClientNetworkServer server = 109 IClientNetworkServer server =
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 199954e..5aa0f2e 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -392,8 +392,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
392 /// <param name="sessionId"></param> 392 /// <param name="sessionId"></param>
393 /// <param name="circuitCode"></param> 393 /// <param name="circuitCode"></param>
394 /// <param name="proxyEP"></param> 394 /// <param name="proxyEP"></param>
395 public LLClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer, 395 public LLClientView(
396 AgentCircuitManager authenSessions, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP) 396 EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer,
397 AgentCircuitManager authenSessions, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP,
398 ClientStackUserSettings userSettings)
397 { 399 {
398 m_moneyBalance = 1000; 400 m_moneyBalance = 1000;
399 401
@@ -422,7 +424,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
422 // in it to process. It's an on-purpose threadlock though because 424 // in it to process. It's an on-purpose threadlock though because
423 // without it, the clientloop will suck up all sim resources. 425 // without it, the clientloop will suck up all sim resources.
424 426
425 m_PacketHandler = new LLPacketHandler(this, m_networkServer); 427 m_PacketHandler = new LLPacketHandler(this, m_networkServer, userSettings);
426 m_PacketHandler.SynchronizeClient = SynchronizeClient; 428 m_PacketHandler.SynchronizeClient = SynchronizeClient;
427 429
428 RegisterLocalPacketHandlers(); 430 RegisterLocalPacketHandlers();
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index 4db2907..4006066 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -70,6 +70,13 @@ namespace OpenSim.Region.ClientStack
70 { 70 {
71 get { return m_sceneManager; } 71 get { return m_sceneManager; }
72 } 72 }
73
74 protected abstract void Initialize();
75 protected abstract PhysicsScene GetPhysicsScene();
76 protected abstract StorageManager CreateStorageManager(string connectionstring, string estateconnectionstring);
77 protected abstract ClientStackManager CreateClientStackManager();
78 protected abstract Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
79 AgentCircuitManager circuitManager);
73 80
74 protected override void StartupSpecific() 81 protected override void StartupSpecific()
75 { 82 {
@@ -79,7 +86,11 @@ namespace OpenSim.Region.ClientStack
79 86
80 Initialize(); 87 Initialize();
81 88
82 m_httpServer = new BaseHttpServer(m_httpServerPort,m_networkServersInfo.HttpUsesSSL,m_networkServersInfo.httpSSLPort, m_networkServersInfo.HttpSSLCN); 89 m_httpServer
90 = new BaseHttpServer(
91 m_httpServerPort, m_networkServersInfo.HttpUsesSSL, m_networkServersInfo.httpSSLPort,
92 m_networkServersInfo.HttpSSLCN);
93
83 if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort)) 94 if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort))
84 { 95 {
85 m_log.Error("[HTTP]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports"); 96 m_log.Error("[HTTP]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports");
@@ -89,19 +100,6 @@ namespace OpenSim.Region.ClientStack
89 m_httpServer.Start(); 100 m_httpServer.Start();
90 } 101 }
91 102
92 protected abstract void Initialize();
93
94 // protected void StartConsole()
95 // {
96 // m_console = CreateConsole();
97 // MainConsole.Instance = m_console;
98 // }
99
100 // protected abstract ConsoleBase CreateConsole();
101 protected abstract PhysicsScene GetPhysicsScene();
102 protected abstract StorageManager CreateStorageManager(string connectionstring, string estateconnectionstring);
103 protected abstract ClientStackManager CreateClientStackManager();
104
105 protected PhysicsScene GetPhysicsScene(string engine, string meshEngine, IConfigSource config) 103 protected PhysicsScene GetPhysicsScene(string engine, string meshEngine, IConfigSource config)
106 { 104 {
107 PhysicsPluginManager physicsPluginManager; 105 PhysicsPluginManager physicsPluginManager;
@@ -110,12 +108,28 @@ namespace OpenSim.Region.ClientStack
110 return physicsPluginManager.GetPhysicsScene(engine, meshEngine, config); 108 return physicsPluginManager.GetPhysicsScene(engine, meshEngine, config);
111 } 109 }
112 110
111 /// <summary>
112 /// Create a scene and its initial base structures.
113 /// </summary>
114 /// <param name="regionInfo"></param>
115 /// <param name="clientServer"> </param>
116 /// <returns></returns>
113 protected Scene SetupScene(RegionInfo regionInfo, out IClientNetworkServer clientServer) 117 protected Scene SetupScene(RegionInfo regionInfo, out IClientNetworkServer clientServer)
114 { 118 {
115 return SetupScene(regionInfo, 0, out clientServer); 119 return SetupScene(regionInfo, 0, null, out clientServer);
116 } 120 }
117 121
118 protected Scene SetupScene(RegionInfo regionInfo, int proxyOffset, out IClientNetworkServer clientServer) 122 /// <summary>
123 /// Create a scene and its initial base structures.
124 /// </summary>
125 /// <param name="regionInfo"></param>
126 /// <param name="proxyOffset"></param>
127 /// <param name="clientStackUserSettings"></param>
128 /// <param name="clientServer"> </param>
129 /// <returns></returns>
130 protected Scene SetupScene(
131 RegionInfo regionInfo, int proxyOffset, ClientStackUserSettings clientStackUserSettings,
132 out IClientNetworkServer clientServer)
119 { 133 {
120 AgentCircuitManager circuitManager = new AgentCircuitManager(); 134 AgentCircuitManager circuitManager = new AgentCircuitManager();
121 IPAddress listenIP = regionInfo.InternalEndPoint.Address; 135 IPAddress listenIP = regionInfo.InternalEndPoint.Address;
@@ -126,7 +140,7 @@ namespace OpenSim.Region.ClientStack
126 140
127 clientServer 141 clientServer
128 = m_clientStackManager.CreateServer( 142 = m_clientStackManager.CreateServer(
129 listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, new ClientStackUserSettings(), 143 listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, clientStackUserSettings,
130 m_assetCache, circuitManager); 144 m_assetCache, circuitManager);
131 145
132 regionInfo.InternalEndPoint.Port = (int)port; 146 regionInfo.InternalEndPoint.Port = (int)port;
@@ -172,8 +186,5 @@ namespace OpenSim.Region.ClientStack
172 186
173 return scene; 187 return scene;
174 } 188 }
175
176 protected abstract Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
177 AgentCircuitManager circuitManager);
178 } 189 }
179} 190}