If a client's SceneAgent is null, that client is not fully logged in or

crashed while logging out. Don't reuse it, create a new one.
avinationmerge
Melanie Thielker 2014-09-13 00:49:32 +02:00
parent ffe5ede550
commit 42b2248960
1 changed files with 14 additions and 0 deletions

View File

@ -2002,6 +2002,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo) uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo)
{ {
IClientAPI client = null; IClientAPI client = null;
bool createNew = false;
// We currently synchronize this code across the whole scene to avoid issues such as // We currently synchronize this code across the whole scene to avoid issues such as
// http://opensimulator.org/mantis/view.php?id=5365 However, once locking per agent circuit can be done // http://opensimulator.org/mantis/view.php?id=5365 However, once locking per agent circuit can be done
@ -2009,6 +2010,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
lock (this) lock (this)
{ {
if (!m_scene.TryGetClient(agentID, out client)) if (!m_scene.TryGetClient(agentID, out client))
{
createNew = true;
}
else
{
if (client.SceneAgent == null)
{
m_scene.CloseAgent(agentID, true);
createNew = true;
}
}
if (createNew)
{ {
LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO); LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);