mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
* Spring cleaning.
* Added new generic "Location" class to handle 2D integer locations. Going to use it to replace all RegionHandle and X,Y coordinate references throughout the entire project. You have been warned.
This commit is contained in:
@@ -42,6 +42,11 @@ namespace OpenSim.Framework
|
||||
|
||||
private Dictionary<uint, IClientAPI> m_clients;
|
||||
|
||||
public ClientManager()
|
||||
{
|
||||
m_clients = new Dictionary<uint, IClientAPI>();
|
||||
}
|
||||
|
||||
public void ForEachClient(ForEachClientDelegate whatToDo)
|
||||
{
|
||||
// Wasteful, I know
|
||||
@@ -65,11 +70,6 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
public ClientManager()
|
||||
{
|
||||
m_clients = new Dictionary<uint, IClientAPI>();
|
||||
}
|
||||
|
||||
public void Remove(uint id)
|
||||
{
|
||||
//m_log.InfoFormat("[CLIENT]: Removing client with code {0}, current count {1}", id, m_clients.Count);
|
||||
@@ -94,7 +94,7 @@ namespace OpenSim.Framework
|
||||
bool tryGetRet = false;
|
||||
lock (m_clients)
|
||||
tryGetRet = m_clients.TryGetValue(circuitCode, out client);
|
||||
if(tryGetRet)
|
||||
if (tryGetRet)
|
||||
{
|
||||
client.InPacket(packet);
|
||||
}
|
||||
@@ -106,7 +106,7 @@ namespace OpenSim.Framework
|
||||
bool tryGetRet = false;
|
||||
lock (m_clients)
|
||||
tryGetRet = m_clients.TryGetValue(circuitCode, out client);
|
||||
if (tryGetRet)
|
||||
if (tryGetRet)
|
||||
{
|
||||
CloseAllCircuits(client.AgentId);
|
||||
}
|
||||
@@ -125,7 +125,7 @@ namespace OpenSim.Framework
|
||||
bool tryGetRet = false;
|
||||
lock (m_clients)
|
||||
tryGetRet = m_clients.TryGetValue(circuits[i], out client);
|
||||
if(tryGetRet)
|
||||
if (tryGetRet)
|
||||
{
|
||||
Remove(client.CircuitCode);
|
||||
client.Close(false);
|
||||
@@ -138,7 +138,7 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
public uint[] GetAllCircuits(LLUUID agentId)
|
||||
public uint[] GetAllCircuits(LLUUID agentId)
|
||||
{
|
||||
List<uint> circuits = new List<uint>();
|
||||
// Wasteful, I know
|
||||
@@ -149,7 +149,7 @@ namespace OpenSim.Framework
|
||||
m_clients.Values.CopyTo(LocalClients, 0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < LocalClients.Length; i++ )
|
||||
for (int i = 0; i < LocalClients.Length; i++)
|
||||
{
|
||||
if (LocalClients[i].AgentId == agentId)
|
||||
{
|
||||
@@ -173,7 +173,7 @@ namespace OpenSim.Framework
|
||||
|
||||
public void ViewerEffectHandler(IClientAPI sender, ViewerEffectPacket.EffectBlock[] effectBlock)
|
||||
{
|
||||
ViewerEffectPacket packet = (ViewerEffectPacket) PacketPool.Instance.GetPacket(PacketType.ViewerEffect);
|
||||
ViewerEffectPacket packet = (ViewerEffectPacket) PacketPool.Instance.GetPacket(PacketType.ViewerEffect);
|
||||
// TODO: don't create new blocks if recycling an old packet
|
||||
packet.Effect = effectBlock;
|
||||
|
||||
@@ -205,4 +205,4 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user