diff options
author | Justin Clarke Casey | 2008-11-03 18:33:35 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-03 18:33:35 +0000 |
commit | 8c71954e0892958da444ef5c82173262daa3f46c (patch) | |
tree | 6e06070ae11dbfd6a84b1ae7995e6df6275f892e /OpenSim/Region/ClientStack | |
parent | completing move to refactored multi-channel capable IRCBridgeModule (diff) | |
download | opensim-SC-8c71954e0892958da444ef5c82173262daa3f46c.zip opensim-SC-8c71954e0892958da444ef5c82173262daa3f46c.tar.gz opensim-SC-8c71954e0892958da444ef5c82173262daa3f46c.tar.bz2 opensim-SC-8c71954e0892958da444ef5c82173262daa3f46c.tar.xz |
* Use nini to pass config information to the client stack, rather than the ClientStackUserSettings class
* This conforms better to other module usage
Diffstat (limited to '')
7 files changed, 33 insertions, 19 deletions
diff --git a/OpenSim/Region/ClientStack/ClientStackManager.cs b/OpenSim/Region/ClientStack/ClientStackManager.cs index 2751e0a..5723739 100644 --- a/OpenSim/Region/ClientStack/ClientStackManager.cs +++ b/OpenSim/Region/ClientStack/ClientStackManager.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Net; | 29 | using System.Net; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using log4net; | 31 | using log4net; |
32 | using Nini.Config; | ||
32 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
33 | using OpenSim.Region.ClientStack; | 34 | using OpenSim.Region.ClientStack; |
34 | using OpenSim.Framework.Communications; | 35 | using OpenSim.Framework.Communications; |
@@ -91,26 +92,24 @@ namespace OpenSim.Region.Environment | |||
91 | /// <param name="port"></param> | 92 | /// <param name="port"></param> |
92 | /// <param name="proxyPortOffset"></param> | 93 | /// <param name="proxyPortOffset"></param> |
93 | /// <param name="allow_alternate_port"></param> | 94 | /// <param name="allow_alternate_port"></param> |
94 | /// <param name="settings"> | 95 | /// <param name="configSource"> |
95 | /// Can be null, in which case default values are used | 96 | /// Can be null, in which case default values are used |
96 | /// </param> | 97 | /// </param> |
97 | /// <param name="assetCache"></param> | 98 | /// <param name="assetCache"></param> |
98 | /// <param name="authenticateClass"></param> | 99 | /// <param name="authenticateClass"></param> |
99 | /// <returns></returns> | 100 | /// <returns></returns> |
100 | public IClientNetworkServer CreateServer( | 101 | public IClientNetworkServer CreateServer( |
101 | IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, ClientStackUserSettings settings, | 102 | IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, IConfigSource configSource, |
102 | AssetCache assetCache, AgentCircuitManager authenticateClass) | 103 | AssetCache assetCache, AgentCircuitManager authenticateClass) |
103 | { | 104 | { |
104 | if (null == settings) | ||
105 | settings = new ClientStackUserSettings(); | ||
106 | |||
107 | if (plugin != null) | 105 | if (plugin != null) |
108 | { | 106 | { |
109 | IClientNetworkServer server = | 107 | IClientNetworkServer server = |
110 | (IClientNetworkServer) Activator.CreateInstance(pluginAssembly.GetType(plugin.ToString())); | 108 | (IClientNetworkServer)Activator.CreateInstance(pluginAssembly.GetType(plugin.ToString())); |
111 | 109 | ||
112 | server.Initialise( | 110 | server.Initialise( |
113 | _listenIP, ref port, proxyPortOffset, allow_alternate_port, settings, assetCache, authenticateClass); | 111 | _listenIP, ref port, proxyPortOffset, allow_alternate_port, |
112 | configSource, assetCache, authenticateClass); | ||
114 | 113 | ||
115 | return server; | 114 | return server; |
116 | } | 115 | } |
diff --git a/OpenSim/Region/ClientStack/IClientNetworkServer.cs b/OpenSim/Region/ClientStack/IClientNetworkServer.cs index fcec1b8..2d0630b 100644 --- a/OpenSim/Region/ClientStack/IClientNetworkServer.cs +++ b/OpenSim/Region/ClientStack/IClientNetworkServer.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System.Net; | 28 | using System.Net; |
29 | using System.Net.Sockets; | 29 | using System.Net.Sockets; |
30 | using Nini.Config; | ||
30 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
31 | using OpenSim.Region.Environment.Scenes; | 32 | using OpenSim.Region.Environment.Scenes; |
32 | using OpenSim.Framework.Communications.Cache; | 33 | using OpenSim.Framework.Communications.Cache; |
@@ -36,7 +37,7 @@ namespace OpenSim.Region.ClientStack | |||
36 | public interface IClientNetworkServer | 37 | public interface IClientNetworkServer |
37 | { | 38 | { |
38 | void Initialise( | 39 | void Initialise( |
39 | IPAddress _listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, ClientStackUserSettings settings, | 40 | IPAddress _listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, |
40 | AssetCache assetCache, AgentCircuitManager authenticateClass); | 41 | AssetCache assetCache, AgentCircuitManager authenticateClass); |
41 | 42 | ||
42 | Socket Server { get; } | 43 | Socket Server { get; } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index d272667..dee5d80 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -1961,7 +1961,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1961 | 1961 | ||
1962 | public void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) | 1962 | public void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) |
1963 | { | 1963 | { |
1964 | |||
1965 | m_activeGroupID = activegroupid; | 1964 | m_activeGroupID = activegroupid; |
1966 | m_activeGroupName = groupname; | 1965 | m_activeGroupName = groupname; |
1967 | m_activeGroupPowers = grouppowers; | 1966 | m_activeGroupPowers = grouppowers; |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index bf95045..9abde5d 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs | |||
@@ -322,6 +322,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
322 | TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); | 322 | TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); |
323 | ResendThrottle.AddBytes(qpack.Packet.ToBytes().Length); | 323 | ResendThrottle.AddBytes(qpack.Packet.ToBytes().Length); |
324 | } | 324 | } |
325 | |||
325 | if (LandThrottle.UnderLimit() && LandOutgoingPacketQueue.Count > 0) | 326 | if (LandThrottle.UnderLimit() && LandOutgoingPacketQueue.Count > 0) |
326 | { | 327 | { |
327 | LLQueItem qpack = LandOutgoingPacketQueue.Dequeue(); | 328 | LLQueItem qpack = LandOutgoingPacketQueue.Dequeue(); |
@@ -330,6 +331,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
330 | TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); | 331 | TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); |
331 | LandThrottle.AddBytes(qpack.Packet.ToBytes().Length); | 332 | LandThrottle.AddBytes(qpack.Packet.ToBytes().Length); |
332 | } | 333 | } |
334 | |||
333 | if (WindThrottle.UnderLimit() && WindOutgoingPacketQueue.Count > 0) | 335 | if (WindThrottle.UnderLimit() && WindOutgoingPacketQueue.Count > 0) |
334 | { | 336 | { |
335 | LLQueItem qpack = WindOutgoingPacketQueue.Dequeue(); | 337 | LLQueItem qpack = WindOutgoingPacketQueue.Dequeue(); |
@@ -338,6 +340,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
338 | TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); | 340 | TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); |
339 | WindThrottle.AddBytes(qpack.Packet.ToBytes().Length); | 341 | WindThrottle.AddBytes(qpack.Packet.ToBytes().Length); |
340 | } | 342 | } |
343 | |||
341 | if (CloudThrottle.UnderLimit() && CloudOutgoingPacketQueue.Count > 0) | 344 | if (CloudThrottle.UnderLimit() && CloudOutgoingPacketQueue.Count > 0) |
342 | { | 345 | { |
343 | LLQueItem qpack = CloudOutgoingPacketQueue.Dequeue(); | 346 | LLQueItem qpack = CloudOutgoingPacketQueue.Dequeue(); |
@@ -346,6 +349,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
346 | TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); | 349 | TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); |
347 | CloudThrottle.AddBytes(qpack.Packet.ToBytes().Length); | 350 | CloudThrottle.AddBytes(qpack.Packet.ToBytes().Length); |
348 | } | 351 | } |
352 | |||
349 | if (TaskThrottle.UnderLimit() && (TaskOutgoingPacketQueue.Count > 0 || TaskLowpriorityPacketQueue.Count > 0)) | 353 | if (TaskThrottle.UnderLimit() && (TaskOutgoingPacketQueue.Count > 0 || TaskLowpriorityPacketQueue.Count > 0)) |
350 | { | 354 | { |
351 | LLQueItem qpack; | 355 | LLQueItem qpack; |
@@ -362,6 +366,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
362 | TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); | 366 | TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); |
363 | TaskThrottle.AddBytes(qpack.Packet.ToBytes().Length); | 367 | TaskThrottle.AddBytes(qpack.Packet.ToBytes().Length); |
364 | } | 368 | } |
369 | |||
365 | if (TextureThrottle.UnderLimit() && TextureOutgoingPacketQueue.Count > 0) | 370 | if (TextureThrottle.UnderLimit() && TextureOutgoingPacketQueue.Count > 0) |
366 | { | 371 | { |
367 | LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue(); | 372 | LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue(); |
@@ -370,6 +375,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
370 | TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); | 375 | TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); |
371 | TextureThrottle.AddBytes(qpack.Packet.ToBytes().Length); | 376 | TextureThrottle.AddBytes(qpack.Packet.ToBytes().Length); |
372 | } | 377 | } |
378 | |||
373 | if (AssetThrottle.UnderLimit() && AssetOutgoingPacketQueue.Count > 0) | 379 | if (AssetThrottle.UnderLimit() && AssetOutgoingPacketQueue.Count > 0) |
374 | { | 380 | { |
375 | LLQueItem qpack = AssetOutgoingPacketQueue.Dequeue(); | 381 | LLQueItem qpack = AssetOutgoingPacketQueue.Dequeue(); |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index ba4e18b..cbe6eff 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -33,6 +33,7 @@ using System.Net.Sockets; | |||
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using OpenMetaverse.Packets; | 34 | using OpenMetaverse.Packets; |
35 | using log4net; | 35 | using log4net; |
36 | using Nini.Config; | ||
36 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Communications.Cache; | 38 | using OpenSim.Framework.Communications.Cache; |
38 | using OpenSim.Region.Environment.Scenes; | 39 | using OpenSim.Region.Environment.Scenes; |
@@ -127,10 +128,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
127 | } | 128 | } |
128 | 129 | ||
129 | public LLUDPServer( | 130 | public LLUDPServer( |
130 | IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, ClientStackUserSettings userSettings, | 131 | IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, IConfigSource configSource, |
131 | AssetCache assetCache, AgentCircuitManager authenticateClass) | 132 | AssetCache assetCache, AgentCircuitManager authenticateClass) |
132 | { | 133 | { |
133 | Initialise(_listenIP, ref port, proxyPortOffset, allow_alternate_port, userSettings, assetCache, authenticateClass); | 134 | Initialise(_listenIP, ref port, proxyPortOffset, allow_alternate_port, configSource, assetCache, authenticateClass); |
134 | } | 135 | } |
135 | 136 | ||
136 | /// <summary> | 137 | /// <summary> |
@@ -140,13 +141,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
140 | /// <param name="port"></param> | 141 | /// <param name="port"></param> |
141 | /// <param name="proxyPortOffsetParm"></param> | 142 | /// <param name="proxyPortOffsetParm"></param> |
142 | /// <param name="allow_alternate_port"></param> | 143 | /// <param name="allow_alternate_port"></param> |
143 | /// <param name="userSettings"></param> | 144 | /// <param name="configSource"></param> |
144 | /// <param name="assetCache"></param> | 145 | /// <param name="assetCache"></param> |
145 | /// <param name="circuitManager"></param> | 146 | /// <param name="circuitManager"></param> |
146 | public void Initialise( | 147 | public void Initialise( |
147 | IPAddress _listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, ClientStackUserSettings userSettings, | 148 | IPAddress _listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, |
148 | AssetCache assetCache, AgentCircuitManager circuitManager) | 149 | AssetCache assetCache, AgentCircuitManager circuitManager) |
149 | { | 150 | { |
151 | // XXX Temporary until we start unpacking the config source | ||
152 | // TODO: Don't forget to account for the null possibility | ||
153 | ClientStackUserSettings userSettings = new ClientStackUserSettings(); | ||
154 | |||
150 | proxyPortOffset = proxyPortOffsetParm; | 155 | proxyPortOffset = proxyPortOffsetParm; |
151 | listenPort = (uint) (port + proxyPortOffsetParm); | 156 | listenPort = (uint) (port + proxyPortOffsetParm); |
152 | listenIP = _listenIP; | 157 | listenIP = _listenIP; |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs index 352f697..d55f423 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System.Net; | 28 | using System.Net; |
29 | using log4net; | 29 | using log4net; |
30 | using Nini.Config; | ||
30 | using NUnit.Framework; | 31 | using NUnit.Framework; |
31 | using NUnit.Framework.SyntaxHelpers; | 32 | using NUnit.Framework.SyntaxHelpers; |
32 | using OpenMetaverse; | 33 | using OpenMetaverse; |
@@ -68,12 +69,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
68 | IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer, | 69 | IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer, |
69 | out AgentCircuitManager acm) | 70 | out AgentCircuitManager acm) |
70 | { | 71 | { |
72 | IConfigSource configSource = new IniConfigSource(); | ||
71 | ClientStackUserSettings userSettings = new ClientStackUserSettings(); | 73 | ClientStackUserSettings userSettings = new ClientStackUserSettings(); |
72 | testLLUDPServer = new TestLLUDPServer(); | 74 | testLLUDPServer = new TestLLUDPServer(); |
73 | acm = new AgentCircuitManager(); | 75 | acm = new AgentCircuitManager(); |
74 | 76 | ||
75 | uint port = 666; | 77 | uint port = 666; |
76 | testLLUDPServer.Initialise(null, ref port, 0, false, userSettings, null, acm); | 78 | testLLUDPServer.Initialise(null, ref port, 0, false, configSource, null, acm); |
77 | testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings); | 79 | testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings); |
78 | testLLUDPServer.LocalScene = scene; | 80 | testLLUDPServer.LocalScene = scene; |
79 | } | 81 | } |
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 4006066..b671fc5 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs | |||
@@ -122,14 +122,16 @@ namespace OpenSim.Region.ClientStack | |||
122 | /// <summary> | 122 | /// <summary> |
123 | /// Create a scene and its initial base structures. | 123 | /// Create a scene and its initial base structures. |
124 | /// </summary> | 124 | /// </summary> |
125 | /// TODO: Really configSource shouldn't be passed in here, but should be moved up to BaseOpenSimServer and | ||
126 | /// made common to all the servers. | ||
127 | /// | ||
125 | /// <param name="regionInfo"></param> | 128 | /// <param name="regionInfo"></param> |
126 | /// <param name="proxyOffset"></param> | 129 | /// <param name="proxyOffset"></param> |
127 | /// <param name="clientStackUserSettings"></param> | 130 | /// <param name="configSource"></param> |
128 | /// <param name="clientServer"> </param> | 131 | /// <param name="clientServer"> </param> |
129 | /// <returns></returns> | 132 | /// <returns></returns> |
130 | protected Scene SetupScene( | 133 | protected Scene SetupScene( |
131 | RegionInfo regionInfo, int proxyOffset, ClientStackUserSettings clientStackUserSettings, | 134 | RegionInfo regionInfo, int proxyOffset, IConfigSource configSource, out IClientNetworkServer clientServer) |
132 | out IClientNetworkServer clientServer) | ||
133 | { | 135 | { |
134 | AgentCircuitManager circuitManager = new AgentCircuitManager(); | 136 | AgentCircuitManager circuitManager = new AgentCircuitManager(); |
135 | IPAddress listenIP = regionInfo.InternalEndPoint.Address; | 137 | IPAddress listenIP = regionInfo.InternalEndPoint.Address; |
@@ -140,7 +142,7 @@ namespace OpenSim.Region.ClientStack | |||
140 | 142 | ||
141 | clientServer | 143 | clientServer |
142 | = m_clientStackManager.CreateServer( | 144 | = m_clientStackManager.CreateServer( |
143 | listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, clientStackUserSettings, | 145 | listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, configSource, |
144 | m_assetCache, circuitManager); | 146 | m_assetCache, circuitManager); |
145 | 147 | ||
146 | regionInfo.InternalEndPoint.Port = (int)port; | 148 | regionInfo.InternalEndPoint.Port = (int)port; |