diff options
Diffstat (limited to 'OpenSim/Framework/General/ClientManager.cs')
-rw-r--r-- | OpenSim/Framework/General/ClientManager.cs | 31 |
1 files changed, 31 insertions, 0 deletions
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 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenSim.Framework.Interfaces; | ||
5 | |||
6 | namespace OpenSim.Framework | ||
7 | { | ||
8 | public delegate void ForEachClientDelegate( IClientAPI client ); | ||
9 | public class ClientManager | ||
10 | { | ||
11 | private Dictionary<uint, IClientAPI> m_clientThreads; | ||
12 | |||
13 | public void ForEachClient(ForEachClientDelegate whatToDo) | ||
14 | { | ||
15 | foreach (IClientAPI client in m_clientThreads.Values) | ||
16 | { | ||
17 | whatToDo(client); | ||
18 | } | ||
19 | } | ||
20 | |||
21 | public ClientManager() | ||
22 | { | ||
23 | m_clientThreads = new Dictionary<uint, IClientAPI>(); | ||
24 | } | ||
25 | |||
26 | public void Add(uint id, IClientAPI client ) | ||
27 | { | ||
28 | m_clientThreads.Add( id, client ); | ||
29 | } | ||
30 | } | ||
31 | } | ||