* Don't worry about trying to populate the other dictionaries if a client's circuitcode is already found in the first one
parent
90d69a0523
commit
4ccac88cf6
|
@ -46,12 +46,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
/// <value>
|
||||||
|
/// The client circuits established with this UDP server. If a client exists here we can also assume that
|
||||||
|
/// it is populated in clientCircuits_reverse and proxyCircuits (if relevant)
|
||||||
|
/// </value>
|
||||||
protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
|
protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
|
||||||
|
|
||||||
//public Dictionary<uint, EndPoint> clientCircuits_reverse = new Dictionary<uint, EndPoint>();
|
|
||||||
public Hashtable clientCircuits_reverse = Hashtable.Synchronized(new Hashtable());
|
public Hashtable clientCircuits_reverse = Hashtable.Synchronized(new Hashtable());
|
||||||
|
|
||||||
protected Dictionary<uint, EndPoint> proxyCircuits = new Dictionary<uint, EndPoint>();
|
protected Dictionary<uint, EndPoint> proxyCircuits = new Dictionary<uint, EndPoint>();
|
||||||
|
|
||||||
private Socket m_socket;
|
private Socket m_socket;
|
||||||
protected IPEndPoint ServerIncoming;
|
protected IPEndPoint ServerIncoming;
|
||||||
protected byte[] RecvBuffer = new byte[4096];
|
protected byte[] RecvBuffer = new byte[4096];
|
||||||
|
@ -361,6 +363,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
//Slave regions don't accept new clients
|
//Slave regions don't accept new clients
|
||||||
if (m_localScene.Region_Status != RegionStatus.SlaveScene)
|
if (m_localScene.Region_Status != RegionStatus.SlaveScene)
|
||||||
{
|
{
|
||||||
|
bool foundExistingCircuit = false;
|
||||||
|
|
||||||
lock (clientCircuits)
|
lock (clientCircuits)
|
||||||
{
|
{
|
||||||
if (!clientCircuits.ContainsKey(epSender))
|
if (!clientCircuits.ContainsKey(epSender))
|
||||||
|
@ -370,9 +374,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code);
|
useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code);
|
||||||
|
|
||||||
clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
|
clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
|
||||||
|
|
||||||
|
foundExistingCircuit = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!foundExistingCircuit)
|
||||||
|
{
|
||||||
// This doesn't need locking as it's synchronized data
|
// This doesn't need locking as it's synchronized data
|
||||||
if (!clientCircuits_reverse.ContainsKey(useCircuit.CircuitCode.Code))
|
if (!clientCircuits_reverse.ContainsKey(useCircuit.CircuitCode.Code))
|
||||||
clientCircuits_reverse.Add(useCircuit.CircuitCode.Code, epSender);
|
clientCircuits_reverse.Add(useCircuit.CircuitCode.Code, epSender);
|
||||||
|
@ -385,6 +393,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
PacketServer.AddNewClient(epSender, useCircuit, m_assetCache, m_circuitManager, epProxy);
|
PacketServer.AddNewClient(epSender, useCircuit, m_assetCache, m_circuitManager, epProxy);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Ack the UseCircuitCode packet
|
// Ack the UseCircuitCode packet
|
||||||
PacketAckPacket ack_it = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck);
|
PacketAckPacket ack_it = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck);
|
||||||
|
|
Loading…
Reference in New Issue