* 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:
Adam Frisby
2008-04-29 14:04:55 +00:00
parent 9907c0fd10
commit 375163a6fe
64 changed files with 1283 additions and 1475 deletions

View File

@@ -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
}
}
}
}
}