mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 22:26:09 +08:00
Added some sanity checks to AddViewerAgent to prevent duplicate addition (now attempts update).
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user