diff options
author | Adam Frisby | 2007-05-14 19:31:05 +0000 |
---|---|---|
committer | Adam Frisby | 2007-05-14 19:31:05 +0000 |
commit | 7659d67fdb40d34997725e31e2ea8c201aadbd95 (patch) | |
tree | 47db54ebb3bf8ceb7d25b3a37b4e75f1a2dca52a | |
parent | Added Alien World Terrain Dataset to /bin/TerrainDatafiles (3x3) (diff) | |
download | opensim-SC_OLD-7659d67fdb40d34997725e31e2ea8c201aadbd95.zip opensim-SC_OLD-7659d67fdb40d34997725e31e2ea8c201aadbd95.tar.gz opensim-SC_OLD-7659d67fdb40d34997725e31e2ea8c201aadbd95.tar.bz2 opensim-SC_OLD-7659d67fdb40d34997725e31e2ea8c201aadbd95.tar.xz |
Added some sanity checks to AddViewerAgent to prevent duplicate addition (now attempts update).
Diffstat (limited to '')
-rw-r--r-- | OpenSim.RegionServer/world/World.cs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim.RegionServer/world/World.cs index 445df1d..e89f8f4 100644 --- a/OpenSim.RegionServer/world/World.cs +++ b/OpenSim.RegionServer/world/World.cs | |||
@@ -561,11 +561,25 @@ namespace OpenSim.world | |||
561 | } | 561 | } |
562 | lock (Entities) | 562 | lock (Entities) |
563 | { | 563 | { |
564 | this.Entities.Add(agentClient.AgentID, newAvatar); | 564 | if (!Entities.ContainsKey(agentClient.AgentID)) |
565 | { | ||
566 | this.Entities.Add(agentClient.AgentID, newAvatar); | ||
567 | } | ||
568 | else | ||
569 | { | ||
570 | Entities[agentClient.AgentID] = newAvatar; | ||
571 | } | ||
565 | } | 572 | } |
566 | lock (Avatars) | 573 | lock (Avatars) |
567 | { | 574 | { |
568 | this.Avatars.Add(agentClient.AgentID, newAvatar); | 575 | if (Avatars.ContainsKey(agentClient.AgentID)) |
576 | { | ||
577 | Avatars[agentClient.AgentID] = newAvatar; | ||
578 | } | ||
579 | else | ||
580 | { | ||
581 | this.Avatars.Add(agentClient.AgentID, newAvatar); | ||
582 | } | ||
569 | } | 583 | } |
570 | } | 584 | } |
571 | catch (Exception e) | 585 | catch (Exception e) |