diff options
Diffstat (limited to 'OpenSim/Framework/General/ClientManager.cs')
-rw-r--r-- | OpenSim/Framework/General/ClientManager.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Framework/General/ClientManager.cs b/OpenSim/Framework/General/ClientManager.cs new file mode 100644 index 0000000..b560ca8 --- /dev/null +++ b/OpenSim/Framework/General/ClientManager.cs | |||
@@ -0,0 +1,36 @@ | |||
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_clients; | ||
12 | |||
13 | public void ForEachClient(ForEachClientDelegate whatToDo) | ||
14 | { | ||
15 | foreach (IClientAPI client in m_clients.Values) | ||
16 | { | ||
17 | whatToDo(client); | ||
18 | } | ||
19 | } | ||
20 | |||
21 | public ClientManager() | ||
22 | { | ||
23 | m_clients = new Dictionary<uint, IClientAPI>(); | ||
24 | } | ||
25 | |||
26 | public void Remove(uint id) | ||
27 | { | ||
28 | m_clients.Remove(id); | ||
29 | } | ||
30 | |||
31 | public void Add(uint id, IClientAPI client ) | ||
32 | { | ||
33 | m_clients.Add( id, client ); | ||
34 | } | ||
35 | } | ||
36 | } | ||