Added some sanity checks to AddViewerAgent to prevent duplicate addition (now attempts update).
parent
20b4ecbec1
commit
7659d67fdb
|
@ -560,14 +560,28 @@ namespace OpenSim.world
|
|||
}
|
||||
}
|
||||
lock (Entities)
|
||||
{
|
||||
if (!Entities.ContainsKey(agentClient.AgentID))
|
||||
{
|
||||
this.Entities.Add(agentClient.AgentID, newAvatar);
|
||||
}
|
||||
else
|
||||
{
|
||||
Entities[agentClient.AgentID] = newAvatar;
|
||||
}
|
||||
}
|
||||
lock (Avatars)
|
||||
{
|
||||
if (Avatars.ContainsKey(agentClient.AgentID))
|
||||
{
|
||||
Avatars[agentClient.AgentID] = newAvatar;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Avatars.Add(agentClient.AgentID, newAvatar);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"World.cs: AddViewerAgent() - Failed with exception " + e.ToString());
|
||||
|
|
Loading…
Reference in New Issue