From 08a1fa3f96eee5e067475da453a3770ff15780f9 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 9 Jul 2007 21:03:36 +0000 Subject: * Introduced ClientManager for great justice. --- OpenSim/Framework/General/ClientManager.cs | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 OpenSim/Framework/General/ClientManager.cs (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/ClientManager.cs b/OpenSim/Framework/General/ClientManager.cs new file mode 100644 index 0000000..5b6e7b3 --- /dev/null +++ b/OpenSim/Framework/General/ClientManager.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework.Interfaces; + +namespace OpenSim.Framework +{ + public delegate void ForEachClientDelegate( IClientAPI client ); + public class ClientManager + { + private Dictionary m_clientThreads; + + public void ForEachClient(ForEachClientDelegate whatToDo) + { + foreach (IClientAPI client in m_clientThreads.Values) + { + whatToDo(client); + } + } + + public ClientManager() + { + m_clientThreads = new Dictionary(); + } + + public void Add(uint id, IClientAPI client ) + { + m_clientThreads.Add( id, client ); + } + } +} -- cgit v1.1