aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
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/ClientStack
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/ClientStack')
-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
3 files changed, 70 insertions, 23 deletions
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}