Added some sanity checks to AddViewerAgent to prevent duplicate addition (now attempts update).

zircon^2
Adam Frisby 2007-05-14 19:31:05 +00:00
parent 20b4ecbec1
commit 7659d67fdb
1 changed files with 16 additions and 2 deletions

View File

@ -561,11 +561,25 @@ namespace OpenSim.world
}
lock (Entities)
{
this.Entities.Add(agentClient.AgentID, newAvatar);
if (!Entities.ContainsKey(agentClient.AgentID))
{
this.Entities.Add(agentClient.AgentID, newAvatar);
}
else
{
Entities[agentClient.AgentID] = newAvatar;
}
}
lock (Avatars)
{
this.Avatars.Add(agentClient.AgentID, newAvatar);
if (Avatars.ContainsKey(agentClient.AgentID))
{
Avatars[agentClient.AgentID] = newAvatar;
}
else
{
this.Avatars.Add(agentClient.AgentID, newAvatar);
}
}
}
catch (Exception e)