28 using System.Collections.Generic;
31 namespace OpenSim.Framework
44 private Dictionary<uint, AgentCircuitData> m_agentCircuits =
new Dictionary<uint, AgentCircuitData>();
49 private Dictionary<UUID, AgentCircuitData> m_agentCircuitsByUUID =
new Dictionary<UUID, AgentCircuitData>();
55 lock (m_agentCircuits)
57 if (m_agentCircuits.ContainsKey(circuitcode))
58 validcircuit = m_agentCircuits[circuitcode];
63 if (validcircuit == null)
66 user.Authorised =
false;
70 if ((sessionID == validcircuit.
SessionID) && (agentID == validcircuit.
AgentID))
72 user.Authorised =
true;
73 user.LoginInfo =
new Login();
74 user.LoginInfo.Agent = agentID;
75 user.LoginInfo.Session = sessionID;
76 user.LoginInfo.SecureSession = validcircuit.SecureSessionID;
77 user.LoginInfo.First = validcircuit.firstname;
78 user.LoginInfo.Last = validcircuit.lastname;
79 user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder;
80 user.LoginInfo.BaseFolder = validcircuit.BaseFolder;
81 user.LoginInfo.StartPos = validcircuit.startpos;
86 user.Authorised =
false;
99 lock (m_agentCircuits)
101 if (m_agentCircuits.ContainsKey(circuitCode))
103 m_agentCircuits[circuitCode] = agentData;
104 m_agentCircuitsByUUID[agentData.AgentID] = agentData;
108 m_agentCircuits.Add(circuitCode, agentData);
109 m_agentCircuitsByUUID[agentData.AgentID] = agentData;
116 lock (m_agentCircuits)
118 if (m_agentCircuits.ContainsKey(circuitCode))
120 UUID agentID = m_agentCircuits[circuitCode].AgentID;
121 m_agentCircuits.Remove(circuitCode);
122 m_agentCircuitsByUUID.Remove(agentID);
129 lock (m_agentCircuits)
131 if (m_agentCircuitsByUUID.ContainsKey(agentID))
133 uint circuitCode = m_agentCircuitsByUUID[agentID].circuitcode;
134 m_agentCircuits.Remove(circuitCode);
135 m_agentCircuitsByUUID.Remove(agentID);
144 lock (m_agentCircuits)
145 m_agentCircuits.TryGetValue(circuitCode, out agentCircuit);
154 lock (m_agentCircuits)
155 m_agentCircuitsByUUID.TryGetValue(agentID, out agentCircuit);
166 lock (m_agentCircuits)
167 return new Dictionary<UUID, AgentCircuitData>(m_agentCircuitsByUUID);
172 lock (m_agentCircuits)
174 if (m_agentCircuits.ContainsKey((uint) agentData.
circuitcode))
177 m_agentCircuits[(uint) agentData.circuitcode].lastname = agentData.lastname;
181 m_agentCircuits[(uint) agentData.circuitcode].SecureSessionID = agentData.SecureSessionID;
196 lock (m_agentCircuits)
198 if (m_agentCircuits.ContainsKey((uint)circuitcode) && !m_agentCircuits.ContainsKey((uint)newcircuitcode))
202 agentData.circuitcode = newcircuitcode;
204 m_agentCircuits.Remove((uint)circuitcode);
205 m_agentCircuits.Add(newcircuitcode, agentData);
215 lock (m_agentCircuits)
216 if (m_agentCircuits.ContainsKey(circuitcode))
217 m_agentCircuits[circuitcode].child = childstatus;
222 lock (m_agentCircuits)
223 if (m_agentCircuits.ContainsKey(circuitcode))
224 return m_agentCircuits[circuitcode].child;
uint circuitcode
Number given to the client when they log-in that they provide as credentials to the UDP server ...
AgentCircuitData GetAgentCircuitData(uint circuitCode)
virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData)
Add information about a new circuit so that later on we can authenticate a new client session...
bool GetAgentChildStatus(uint circuitcode)
Vector3 startpos
Position the Agent's Avatar starts in the region
virtual void RemoveCircuit(UUID agentID)
AgentCircuitData GetAgentCircuitData(UUID agentID)
bool TryChangeCiruitCode(uint circuitcode, uint newcircuitcode)
Sometimes the circuitcode may not be known before setting up the connection
virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode)
UUID SessionID
Non secure Session ID
string firstname
Agent's account first name
Circuit data for an agent. Connection information shared between regions that accept UDP connections ...
Dictionary< UUID, AgentCircuitData > GetAgentCircuits()
Get all current agent circuits indexed by agent UUID.
UUID AgentID
Avatar Unique Agent Identifier
virtual void RemoveCircuit(uint circuitCode)
void UpdateAgentData(AgentCircuitData agentData)
void UpdateAgentChildStatus(uint circuitcode, bool childstatus)