diff options
author | Teravus Ovares (Dan Olivares) | 2010-05-15 23:22:07 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2010-05-15 23:22:07 -0400 |
commit | 019925bb2f87695cd16d1bebff4ef300b16e67f1 (patch) | |
tree | b596598ebde44e1bd69c64898f4236d515303871 /OpenSim/Framework/AgentCircuitManager.cs | |
parent | * Add User Friendly Configuration File Exists check. If OpenSim.ini and eith... (diff) | |
parent | Almost, but not quite. Commenting verification again, until I understand wher... (diff) | |
download | opensim-SC_OLD-019925bb2f87695cd16d1bebff4ef300b16e67f1.zip opensim-SC_OLD-019925bb2f87695cd16d1bebff4ef300b16e67f1.tar.gz opensim-SC_OLD-019925bb2f87695cd16d1bebff4ef300b16e67f1.tar.bz2 opensim-SC_OLD-019925bb2f87695cd16d1bebff4ef300b16e67f1.tar.xz |
Merge branch 'master' of ssh://MyConnection/var/git/opensim
Diffstat (limited to 'OpenSim/Framework/AgentCircuitManager.cs')
-rw-r--r-- | OpenSim/Framework/AgentCircuitManager.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/OpenSim/Framework/AgentCircuitManager.cs b/OpenSim/Framework/AgentCircuitManager.cs index e5dbb5a..49d7822 100644 --- a/OpenSim/Framework/AgentCircuitManager.cs +++ b/OpenSim/Framework/AgentCircuitManager.cs | |||
@@ -36,6 +36,7 @@ namespace OpenSim.Framework | |||
36 | public class AgentCircuitManager | 36 | public class AgentCircuitManager |
37 | { | 37 | { |
38 | public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>(); | 38 | public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>(); |
39 | public Dictionary<UUID, AgentCircuitData> AgentCircuitsByUUID = new Dictionary<UUID, AgentCircuitData>(); | ||
39 | 40 | ||
40 | public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode) | 41 | public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode) |
41 | { | 42 | { |
@@ -86,10 +87,12 @@ namespace OpenSim.Framework | |||
86 | if (AgentCircuits.ContainsKey(circuitCode)) | 87 | if (AgentCircuits.ContainsKey(circuitCode)) |
87 | { | 88 | { |
88 | AgentCircuits[circuitCode] = agentData; | 89 | AgentCircuits[circuitCode] = agentData; |
90 | AgentCircuitsByUUID[agentData.AgentID] = agentData; | ||
89 | } | 91 | } |
90 | else | 92 | else |
91 | { | 93 | { |
92 | AgentCircuits.Add(circuitCode, agentData); | 94 | AgentCircuits.Add(circuitCode, agentData); |
95 | AgentCircuitsByUUID.Add(agentData.AgentID, agentData); | ||
93 | } | 96 | } |
94 | } | 97 | } |
95 | } | 98 | } |
@@ -99,10 +102,26 @@ namespace OpenSim.Framework | |||
99 | lock (AgentCircuits) | 102 | lock (AgentCircuits) |
100 | { | 103 | { |
101 | if (AgentCircuits.ContainsKey(circuitCode)) | 104 | if (AgentCircuits.ContainsKey(circuitCode)) |
105 | { | ||
106 | UUID agentID = AgentCircuits[circuitCode].AgentID; | ||
102 | AgentCircuits.Remove(circuitCode); | 107 | AgentCircuits.Remove(circuitCode); |
108 | AgentCircuitsByUUID.Remove(agentID); | ||
109 | } | ||
103 | } | 110 | } |
104 | } | 111 | } |
105 | 112 | ||
113 | public virtual void RemoveCircuit(UUID agentID) | ||
114 | { | ||
115 | lock (AgentCircuits) | ||
116 | { | ||
117 | if (AgentCircuitsByUUID.ContainsKey(agentID)) | ||
118 | { | ||
119 | uint circuitCode = AgentCircuitsByUUID[agentID].circuitcode; | ||
120 | AgentCircuits.Remove(circuitCode); | ||
121 | AgentCircuitsByUUID.Remove(agentID); | ||
122 | } | ||
123 | } | ||
124 | } | ||
106 | public AgentCircuitData GetAgentCircuitData(uint circuitCode) | 125 | public AgentCircuitData GetAgentCircuitData(uint circuitCode) |
107 | { | 126 | { |
108 | AgentCircuitData agentCircuit = null; | 127 | AgentCircuitData agentCircuit = null; |
@@ -110,6 +129,13 @@ namespace OpenSim.Framework | |||
110 | return agentCircuit; | 129 | return agentCircuit; |
111 | } | 130 | } |
112 | 131 | ||
132 | public AgentCircuitData GetAgentCircuitData(UUID agentID) | ||
133 | { | ||
134 | AgentCircuitData agentCircuit = null; | ||
135 | AgentCircuitsByUUID.TryGetValue(agentID, out agentCircuit); | ||
136 | return agentCircuit; | ||
137 | } | ||
138 | |||
113 | public void UpdateAgentData(AgentCircuitData agentData) | 139 | public void UpdateAgentData(AgentCircuitData agentData) |
114 | { | 140 | { |
115 | if (AgentCircuits.ContainsKey((uint) agentData.circuitcode)) | 141 | if (AgentCircuits.ContainsKey((uint) agentData.circuitcode)) |