mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 01:35:46 +08:00
* Introduced ClientManager for great justice.
This commit is contained in:
31
OpenSim/Framework/General/ClientManager.cs
Normal file
31
OpenSim/Framework/General/ClientManager.cs
Normal file
@@ -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<uint, IClientAPI> m_clientThreads;
|
||||
|
||||
public void ForEachClient(ForEachClientDelegate whatToDo)
|
||||
{
|
||||
foreach (IClientAPI client in m_clientThreads.Values)
|
||||
{
|
||||
whatToDo(client);
|
||||
}
|
||||
}
|
||||
|
||||
public ClientManager()
|
||||
{
|
||||
m_clientThreads = new Dictionary<uint, IClientAPI>();
|
||||
}
|
||||
|
||||
public void Add(uint id, IClientAPI client )
|
||||
{
|
||||
m_clientThreads.Add( id, client );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user