From 801da4346aeb3c08969c4845f5c595135a64470a Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 12 Feb 2009 09:53:12 +0000 Subject: * optimized usings. --- OpenSim/Region/ClientStack/ClientStackManager.cs | 3 --- OpenSim/Region/ClientStack/IClientNetworkServer.cs | 1 - OpenSim/Region/ClientStack/LindenUDP/KillPacket.cs | 3 --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 30 ++++++++-------------- .../Region/ClientStack/LindenUDP/LLFileTransfer.cs | 10 +------- .../Region/ClientStack/LindenUDP/LLImageManager.cs | 8 +++--- .../ClientStack/LindenUDP/LLPacketHandler.cs | 29 +++++++++------------ .../Region/ClientStack/LindenUDP/LLPacketQueue.cs | 9 +++---- .../Region/ClientStack/LindenUDP/LLPacketServer.cs | 3 --- .../Region/ClientStack/LindenUDP/LLUDPServer.cs | 5 ++-- OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs | 1 - .../LindenUDP/Tests/BasicCircuitTests.cs | 12 +++------ .../ClientStack/LindenUDP/Tests/MockScene.cs | 2 -- .../LindenUDP/Tests/PacketHandlerTests.cs | 2 -- .../LindenUDP/Tests/TestLLPacketServer.cs | 2 -- .../ClientStack/LindenUDP/Tests/TestLLUDPServer.cs | 2 -- .../Region/ClientStack/RegionApplicationBase.cs | 5 +--- 17 files changed, 38 insertions(+), 89 deletions(-) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/ClientStackManager.cs b/OpenSim/Region/ClientStack/ClientStackManager.cs index f947d06..a7b65cb 100644 --- a/OpenSim/Region/ClientStack/ClientStackManager.cs +++ b/OpenSim/Region/ClientStack/ClientStackManager.cs @@ -31,9 +31,6 @@ using System.Reflection; using log4net; using Nini.Config; using OpenSim.Framework; -using OpenSim.Region.ClientStack; -using OpenSim.Framework.Communications; -using OpenSim.Framework.Communications.Cache; namespace OpenSim.Region.ClientStack { diff --git a/OpenSim/Region/ClientStack/IClientNetworkServer.cs b/OpenSim/Region/ClientStack/IClientNetworkServer.cs index 8bd5434..b0749c6 100644 --- a/OpenSim/Region/ClientStack/IClientNetworkServer.cs +++ b/OpenSim/Region/ClientStack/IClientNetworkServer.cs @@ -30,7 +30,6 @@ using System.Net.Sockets; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; -using OpenSim.Framework.Communications.Cache; namespace OpenSim.Region.ClientStack { diff --git a/OpenSim/Region/ClientStack/LindenUDP/KillPacket.cs b/OpenSim/Region/ClientStack/LindenUDP/KillPacket.cs index 8197ec7..df6534f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/KillPacket.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/KillPacket.cs @@ -25,9 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; -using System.Collections.Generic; -using System.Text; using OpenMetaverse.Packets; namespace OpenSim.Region.ClientStack.LindenUDP diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index a785e64..3b8b48f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -33,17 +33,16 @@ using System.Text; using System.Threading; using System.Timers; using System.Xml; +using log4net; using OpenMetaverse; using OpenMetaverse.Packets; -using OpenMetaverse.StructuredData; -using log4net; using OpenSim.Framework; using OpenSim.Framework.Client; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Statistics; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; -using Timer = System.Timers.Timer; +using Timer=System.Timers.Timer; namespace OpenSim.Region.ClientStack.LindenUDP { @@ -474,7 +473,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_PacketHandler.OnPacketStats += PopulateStats; RegisterLocalPacketHandlers(); - m_imageManager = new LLImageManager(this, m_assetCache,Scene.RequestModuleInterface()); + m_imageManager = new LLImageManager(this, m_assetCache,Scene.RequestModuleInterface()); } public void SetDebugPacketLevel(int newDebugPacketLevel) @@ -1230,7 +1229,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP fromAgent, toAgent, false, false, false); } - System.Console.WriteLine("SendInstantMessage: " + msg); + Console.WriteLine("SendInstantMessage: " + msg); } else OutPacket(msg, ThrottleOutPacketType.Task); @@ -6857,15 +6856,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP groupTitlesRequest.AgentData.GroupID); groupTitlesReply.GroupData = - new GroupTitlesReplyPacket. - GroupDataBlock[titles.Count]; + new GroupTitlesReplyPacket.GroupDataBlock[titles.Count]; int i = 0; foreach (GroupTitlesData d in titles) { groupTitlesReply.GroupData[i] = - new GroupTitlesReplyPacket. - GroupDataBlock(); + new GroupTitlesReplyPacket.GroupDataBlock(); groupTitlesReply.GroupData[i].Title = Utils.StringToBytes(d.Name); @@ -6980,8 +6977,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP groupRolesReply.AgentData.AgentID = AgentId; groupRolesReply.GroupData = - new GroupRoleDataReplyPacket. - GroupDataBlock(); + new GroupRoleDataReplyPacket.GroupDataBlock(); groupRolesReply.GroupData.GroupID = groupRolesRequest.GroupData.GroupID; @@ -6997,15 +6993,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP titles.Count; groupRolesReply.RoleData = - new GroupRoleDataReplyPacket. - RoleDataBlock[titles.Count]; + new GroupRoleDataReplyPacket.RoleDataBlock[titles.Count]; int i = 0; foreach (GroupRolesData d in titles) { groupRolesReply.RoleData[i] = - new GroupRoleDataReplyPacket. - RoleDataBlock(); + new GroupRoleDataReplyPacket.RoleDataBlock(); groupRolesReply.RoleData[i].RoleID = d.RoleID; @@ -7051,15 +7045,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP (uint)mappings.Count; groupRoleMembersReply.MemberData = - new GroupRoleMembersReplyPacket. - MemberDataBlock[mappings.Count]; + new GroupRoleMembersReplyPacket.MemberDataBlock[mappings.Count]; int i = 0; foreach (GroupRoleMembersData d in mappings) { groupRoleMembersReply.MemberData[i] = - new GroupRoleMembersReplyPacket. - MemberDataBlock(); + new GroupRoleMembersReplyPacket.MemberDataBlock(); groupRoleMembersReply.MemberData[i].RoleID = d.RoleID; diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs index b801f7a..f79f62e 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -27,16 +27,8 @@ using System; using System.Collections.Generic; -using System.Text; -using System.Xml; using OpenMetaverse; -using OpenMetaverse.Packets; using OpenSim.Framework; -using OpenSim.Framework.Client; -using OpenSim.Framework.Communications.Cache; -using OpenSim.Framework.Statistics; -using OpenSim.Region.Framework.Interfaces; -using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.ClientStack.LindenUDP { diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs index 43a2e23..6f9e5d3 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -27,13 +27,11 @@ using System; using System.Collections.Generic; +using C5; using OpenMetaverse; +using OpenMetaverse.Imaging; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; -using C5; -using OpenSim.Framework.Communications.Cache; -using OpenMetaverse.Imaging; - namespace OpenSim.Region.ClientStack.LindenUDP { diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index 97d75e1..23118a2 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs @@ -26,19 +26,14 @@ */ using System; -using System.Collections; using System.Collections.Generic; -using System.Net; using System.Net.Sockets; using System.Threading; using System.Timers; -using System.Reflection; using OpenMetaverse; using OpenMetaverse.Packets; -using Timer = System.Timers.Timer; using OpenSim.Framework; -using OpenSim.Region.ClientStack.LindenUDP; -using log4net; +using Timer=System.Timers.Timer; namespace OpenSim.Region.ClientStack.LindenUDP { @@ -96,7 +91,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private Dictionary m_DupeTracker = new Dictionary(); private uint m_DupeTrackerWindow = 30; - private int m_DupeTrackerLastCheck = System.Environment.TickCount; + private int m_DupeTrackerLastCheck = Environment.TickCount; // Values for the SimStatsReporter // @@ -164,7 +159,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { m_Client = client; m_PacketServer = server; - m_DropSafeTimeout = System.Environment.TickCount + 15000; + m_DropSafeTimeout = Environment.TickCount + 15000; m_PacketQueue = new LLPacketQueue(client.AgentId, userSettings); @@ -225,9 +220,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP // acks being appended to the payload, just don't send // any with them until libsl is fixed. // - if (packet is OpenMetaverse.Packets.ViewerEffectPacket) + if (packet is ViewerEffectPacket) return; - if (packet is OpenMetaverse.Packets.SimStatsPacket) + if (packet is SimStatsPacket) return; // Add acks to outgoing packets @@ -261,7 +256,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP item.Packet = packet; item.Incoming = false; item.throttleType = throttlePacketType; - item.TickCount = System.Environment.TickCount; + item.TickCount = Environment.TickCount; item.Identifier = id; item.Resends = 0; item.Length = packet.ToBytes().Length; @@ -272,7 +267,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private void ResendUnacked() { - int now = System.Environment.TickCount; + int now = Environment.TickCount; int intervalMs = 250; @@ -341,7 +336,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } m_NeedAck[packet.Header.Sequence].TickCount = - System.Environment.TickCount; + Environment.TickCount; QueuePacket(packet, ThrottleOutPacketType.Resend, data.Identifier); @@ -463,10 +458,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (m_DupeTracker.Count < 1024) return; - if (System.Environment.TickCount - m_DupeTrackerLastCheck < 2000) + if (Environment.TickCount - m_DupeTrackerLastCheck < 2000) return; - m_DupeTrackerLastCheck = System.Environment.TickCount; + m_DupeTrackerLastCheck = Environment.TickCount; Dictionary packs = new Dictionary(m_DupeTracker); @@ -673,7 +668,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP item.Packet = packet; item.Incoming = false; item.throttleType = 0; - item.TickCount = System.Environment.TickCount; + item.TickCount = Environment.TickCount; item.Identifier = 0; item.Resends = 0; item.Length = packet.ToBytes().Length; @@ -741,7 +736,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_UnackedBytes += item.Length; // Keep track of when this packet was sent out - item.TickCount = System.Environment.TickCount; + item.TickCount = Environment.TickCount; m_NeedAck[packet.Header.Sequence] = item; } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index 17c3f97..1c398d9 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs @@ -27,23 +27,22 @@ using System; using System.Collections.Generic; +using System.Reflection; using System.Threading; using System.Timers; +using log4net; using OpenMetaverse; -using OpenMetaverse.Packets; using OpenSim.Framework; using OpenSim.Framework.Statistics; using OpenSim.Framework.Statistics.Interfaces; -using OpenSim.Region.ClientStack; using Timer=System.Timers.Timer; - namespace OpenSim.Region.ClientStack.LindenUDP { public class LLPacketQueue : IPullStatsProvider { - private static readonly log4net.ILog m_log - = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log + = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// /// Is queueing enabled at all? diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs index a42ae04..7305f34 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs @@ -27,12 +27,9 @@ using System.Net; using System.Net.Sockets; -using System.Reflection; -using log4net; using OpenMetaverse; using OpenMetaverse.Packets; using OpenSim.Framework; -using OpenSim.Framework.Communications.Cache; namespace OpenSim.Region.ClientStack.LindenUDP { diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index eb88715..7aea9a3 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -31,11 +31,10 @@ using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Reflection; -using OpenMetaverse.Packets; using log4net; using Nini.Config; +using OpenMetaverse.Packets; using OpenSim.Framework; -using OpenSim.Framework.Communications.Cache; using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.ClientStack.LindenUDP @@ -304,7 +303,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // the next set of UDP data is for a valid client. ResetServerEndPoint(e); } - catch (System.ObjectDisposedException) + catch (ObjectDisposedException) { m_log.Info("[UDPSERVER]: UDP Object disposed. No need to worry about this if you're restarting the simulator."); } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs index d704967..ca26f5b 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs @@ -26,7 +26,6 @@ */ using OpenMetaverse; -using System; namespace OpenSim.Region.ClientStack.LindenUDP { diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs index b2cf14c..1f564b7 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs @@ -26,17 +26,13 @@ */ using System.Net; -using System.Threading; -using log4net; +using log4net.Config; using Nini.Config; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenMetaverse.Packets; using OpenSim.Framework; -using OpenSim.Framework.Communications; -using OpenSim.Region.ClientStack; -using OpenSim.Region.ClientStack.LindenUDP; namespace OpenSim.Region.ClientStack.LindenUDP.Tests { @@ -51,7 +47,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests { try { - log4net.Config.XmlConfigurator.Configure(); + XmlConfigurator.Configure(); } catch { @@ -118,7 +114,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests UseCircuitCodePacket uccp = new UseCircuitCodePacket(); UseCircuitCodePacket.CircuitCodeBlock uccpCcBlock - = new OpenMetaverse.Packets.UseCircuitCodePacket.CircuitCodeBlock(); + = new UseCircuitCodePacket.CircuitCodeBlock(); uccpCcBlock.Code = circuitCode; uccpCcBlock.ID = agentId; uccpCcBlock.SessionID = sessionId; @@ -169,7 +165,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests UseCircuitCodePacket uccp = new UseCircuitCodePacket(); UseCircuitCodePacket.CircuitCodeBlock uccpCcBlock - = new OpenMetaverse.Packets.UseCircuitCodePacket.CircuitCodeBlock(); + = new UseCircuitCodePacket.CircuitCodeBlock(); uccpCcBlock.Code = myCircuitCode; uccpCcBlock.ID = myAgentUuid; uccpCcBlock.SessionID = mySessionUuid; diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs index 90d7d63..d4e906a 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs @@ -25,8 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System.Xml; -using Nini.Config; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs index d421f82..6e429a4 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs @@ -25,14 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System.Threading; using Nini.Config; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenMetaverse.Packets; using OpenSim.Framework; -using OpenSim.Region.ClientStack.LindenUDP; using OpenSim.Tests.Common.Mock; namespace OpenSim.Region.ClientStack.LindenUDP.Tests diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLPacketServer.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLPacketServer.cs index 507fe82..667014e 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLPacketServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLPacketServer.cs @@ -26,9 +26,7 @@ */ using System.Collections.Generic; -using OpenMetaverse; using OpenMetaverse.Packets; -using OpenSim.Region.ClientStack.LindenUDP; namespace OpenSim.Region.ClientStack.LindenUDP.Tests { diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs index 91fadba..53506d3 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs @@ -30,8 +30,6 @@ using System.Collections.Generic; using System.Net; using System.Net.Sockets; using OpenMetaverse.Packets; -using OpenSim.Framework; -using OpenSim.Framework.Communications.Cache; namespace OpenSim.Region.ClientStack.LindenUDP.Tests { diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 24ebd7e..55cf1ae 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -26,19 +26,16 @@ */ using System.Collections.Generic; -using System.IO; using System.Net; using System.Reflection; -using OpenMetaverse; using log4net; using Nini.Config; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; -using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Servers; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Scenes; -using OpenSim.Region.CoreModules; using OpenSim.Region.Physics.Manager; namespace OpenSim.Region.ClientStack -- cgit v1.1