From efd90b56b761219af6425b1c7a2cdd3b6ffb4de2 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 27 Dec 2007 21:41:48 +0000 Subject: * Optimized usings * shortened references * Removed redundant 'this' * Normalized EOF --- OpenSim/Framework/ClientManager.cs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'OpenSim/Framework/ClientManager.cs') diff --git a/OpenSim/Framework/ClientManager.cs b/OpenSim/Framework/ClientManager.cs index e32c9eb..da60ed7 100644 --- a/OpenSim/Framework/ClientManager.cs +++ b/OpenSim/Framework/ClientManager.cs @@ -26,9 +26,11 @@ * */ +using System; using System.Collections.Generic; using libsecondlife; using libsecondlife.Packets; +using OpenSim.Framework.Console; namespace OpenSim.Framework { @@ -40,7 +42,6 @@ namespace OpenSim.Framework public void ForEachClient(ForEachClientDelegate whatToDo) { - // Wasteful, I know IClientAPI[] LocalClients = new IClientAPI[0]; lock (m_clients) @@ -55,9 +56,11 @@ namespace OpenSim.Framework { whatToDo(LocalClients[i]); } - catch (System.Exception e) + catch (Exception e) { - OpenSim.Framework.Console.MainLog.Instance.Warn("CLIENT", "Unable to do ForEachClient for one of the clients" + "\n Reason: " + e.ToString()); + MainLog.Instance.Warn("CLIENT", + "Unable to do ForEachClient for one of the clients" + "\n Reason: " + + e.ToString()); } } } @@ -107,20 +110,19 @@ namespace OpenSim.Framework IClientAPI client; try { - if (m_clients.TryGetValue(circuits[i], out client)) { Remove(client.CircuitCode); client.Close(false); } } - catch (System.Exception e) + catch (Exception e) { - OpenSim.Framework.Console.MainLog.Instance.Error("CLIENT", "Unable to shutdown circuit for: " + agentId.ToString() + "\n Reason: " + e.ToString()); + MainLog.Instance.Error("CLIENT", + "Unable to shutdown circuit for: " + agentId.ToString() + "\n Reason: " + + e.ToString()); } } - - } private uint[] GetAllCircuits(LLUUID agentId) @@ -135,7 +137,7 @@ namespace OpenSim.Framework } - for (int i = 0; i < LocalClients.Length; i++ ) + for (int i = 0; i < LocalClients.Length; i++) { if (LocalClients[i].AgentId == agentId) { @@ -168,7 +170,6 @@ namespace OpenSim.Framework packet.AgentData.SessionID = LocalClients[i].SessionId; LocalClients[i].OutPacket(packet, ThrottleOutPacketType.Task); } - } } -- cgit v1.1