From 8c71954e0892958da444ef5c82173262daa3f46c Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 3 Nov 2008 18:33:35 +0000 Subject: * Use nini to pass config information to the client stack, rather than the ClientStackUserSettings class * This conforms better to other module usage --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 1 - OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs | 6 ++++++ OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 13 +++++++++---- .../Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs | 4 +++- 4 files changed, 18 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP') 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 public void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) { - m_activeGroupID = activegroupid; m_activeGroupName = groupname; 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 TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); ResendThrottle.AddBytes(qpack.Packet.ToBytes().Length); } + if (LandThrottle.UnderLimit() && LandOutgoingPacketQueue.Count > 0) { LLQueItem qpack = LandOutgoingPacketQueue.Dequeue(); @@ -330,6 +331,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); LandThrottle.AddBytes(qpack.Packet.ToBytes().Length); } + if (WindThrottle.UnderLimit() && WindOutgoingPacketQueue.Count > 0) { LLQueItem qpack = WindOutgoingPacketQueue.Dequeue(); @@ -338,6 +340,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); WindThrottle.AddBytes(qpack.Packet.ToBytes().Length); } + if (CloudThrottle.UnderLimit() && CloudOutgoingPacketQueue.Count > 0) { LLQueItem qpack = CloudOutgoingPacketQueue.Dequeue(); @@ -346,6 +349,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); CloudThrottle.AddBytes(qpack.Packet.ToBytes().Length); } + if (TaskThrottle.UnderLimit() && (TaskOutgoingPacketQueue.Count > 0 || TaskLowpriorityPacketQueue.Count > 0)) { LLQueItem qpack; @@ -362,6 +366,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); TaskThrottle.AddBytes(qpack.Packet.ToBytes().Length); } + if (TextureThrottle.UnderLimit() && TextureOutgoingPacketQueue.Count > 0) { LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue(); @@ -370,6 +375,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); TextureThrottle.AddBytes(qpack.Packet.ToBytes().Length); } + if (AssetThrottle.UnderLimit() && AssetOutgoingPacketQueue.Count > 0) { 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; using System.Reflection; using OpenMetaverse.Packets; using log4net; +using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; using OpenSim.Region.Environment.Scenes; @@ -127,10 +128,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP } public LLUDPServer( - IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, ClientStackUserSettings userSettings, + IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, IConfigSource configSource, AssetCache assetCache, AgentCircuitManager authenticateClass) { - Initialise(_listenIP, ref port, proxyPortOffset, allow_alternate_port, userSettings, assetCache, authenticateClass); + Initialise(_listenIP, ref port, proxyPortOffset, allow_alternate_port, configSource, assetCache, authenticateClass); } /// @@ -140,13 +141,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// /// - /// + /// /// /// public void Initialise( - IPAddress _listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, ClientStackUserSettings userSettings, + IPAddress _listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AssetCache assetCache, AgentCircuitManager circuitManager) { + // XXX Temporary until we start unpacking the config source + // TODO: Don't forget to account for the null possibility + ClientStackUserSettings userSettings = new ClientStackUserSettings(); + proxyPortOffset = proxyPortOffsetParm; listenPort = (uint) (port + proxyPortOffsetParm); 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 @@ using System.Net; using log4net; +using Nini.Config; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; @@ -68,12 +69,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer, out AgentCircuitManager acm) { + IConfigSource configSource = new IniConfigSource(); ClientStackUserSettings userSettings = new ClientStackUserSettings(); testLLUDPServer = new TestLLUDPServer(); acm = new AgentCircuitManager(); uint port = 666; - testLLUDPServer.Initialise(null, ref port, 0, false, userSettings, null, acm); + testLLUDPServer.Initialise(null, ref port, 0, false, configSource, null, acm); testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings); testLLUDPServer.LocalScene = scene; } -- cgit v1.1