From b6e7e5ed424c4c26c3f86f8decbd2b15a5ab90e1 Mon Sep 17 00:00:00 2001 From: diva Date: Wed, 11 Feb 2009 21:07:41 +0000 Subject: Enforce estate bans on Teleports. --- OpenSim/Framework/AgentCircuitManager.cs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/AgentCircuitManager.cs b/OpenSim/Framework/AgentCircuitManager.cs index 09333bd..56b40bd 100644 --- a/OpenSim/Framework/AgentCircuitManager.cs +++ b/OpenSim/Framework/AgentCircuitManager.cs @@ -81,13 +81,25 @@ namespace OpenSim.Framework /// public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData) { - if (AgentCircuits.ContainsKey(circuitCode)) + lock (AgentCircuits) { - AgentCircuits[circuitCode] = agentData; + if (AgentCircuits.ContainsKey(circuitCode)) + { + AgentCircuits[circuitCode] = agentData; + } + else + { + AgentCircuits.Add(circuitCode, agentData); + } } - else + } + + public virtual void RemoveCircuit(uint circuitCode) + { + lock (AgentCircuits) { - AgentCircuits.Add(circuitCode, agentData); + if (AgentCircuits.ContainsKey(circuitCode)) + AgentCircuits.Remove(circuitCode); } } -- cgit v1.1