aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/ClientManager.cs
diff options
context:
space:
mode:
authorAdam Frisby2008-04-29 14:04:55 +0000
committerAdam Frisby2008-04-29 14:04:55 +0000
commit375163a6fece8b3a57c7555246abe8338223a599 (patch)
tree163001ca96a4b4d08589e9772f78510677d5d0dc /OpenSim/Framework/ClientManager.cs
parentPatch from Melanie: 0001087: Crash to bash de-linking objects. Thanks Melanie! (diff)
downloadopensim-SC_OLD-375163a6fece8b3a57c7555246abe8338223a599.zip
opensim-SC_OLD-375163a6fece8b3a57c7555246abe8338223a599.tar.gz
opensim-SC_OLD-375163a6fece8b3a57c7555246abe8338223a599.tar.bz2
opensim-SC_OLD-375163a6fece8b3a57c7555246abe8338223a599.tar.xz
* Spring cleaning.
* Added new generic "Location" class to handle 2D integer locations. Going to use it to replace all RegionHandle and X,Y coordinate references throughout the entire project. You have been warned.
Diffstat (limited to 'OpenSim/Framework/ClientManager.cs')
-rw-r--r--OpenSim/Framework/ClientManager.cs24
1 files changed, 12 insertions, 12 deletions
diff --git a/OpenSim/Framework/ClientManager.cs b/OpenSim/Framework/ClientManager.cs
index 160d5b6..35c9319 100644
--- a/OpenSim/Framework/ClientManager.cs
+++ b/OpenSim/Framework/ClientManager.cs
@@ -42,6 +42,11 @@ namespace OpenSim.Framework
42 42
43 private Dictionary<uint, IClientAPI> m_clients; 43 private Dictionary<uint, IClientAPI> m_clients;
44 44
45 public ClientManager()
46 {
47 m_clients = new Dictionary<uint, IClientAPI>();
48 }
49
45 public void ForEachClient(ForEachClientDelegate whatToDo) 50 public void ForEachClient(ForEachClientDelegate whatToDo)
46 { 51 {
47 // Wasteful, I know 52 // Wasteful, I know
@@ -65,11 +70,6 @@ namespace OpenSim.Framework
65 } 70 }
66 } 71 }
67 72
68 public ClientManager()
69 {
70 m_clients = new Dictionary<uint, IClientAPI>();
71 }
72
73 public void Remove(uint id) 73 public void Remove(uint id)
74 { 74 {
75 //m_log.InfoFormat("[CLIENT]: Removing client with code {0}, current count {1}", id, m_clients.Count); 75 //m_log.InfoFormat("[CLIENT]: Removing client with code {0}, current count {1}", id, m_clients.Count);
@@ -94,7 +94,7 @@ namespace OpenSim.Framework
94 bool tryGetRet = false; 94 bool tryGetRet = false;
95 lock (m_clients) 95 lock (m_clients)
96 tryGetRet = m_clients.TryGetValue(circuitCode, out client); 96 tryGetRet = m_clients.TryGetValue(circuitCode, out client);
97 if(tryGetRet) 97 if (tryGetRet)
98 { 98 {
99 client.InPacket(packet); 99 client.InPacket(packet);
100 } 100 }
@@ -106,7 +106,7 @@ namespace OpenSim.Framework
106 bool tryGetRet = false; 106 bool tryGetRet = false;
107 lock (m_clients) 107 lock (m_clients)
108 tryGetRet = m_clients.TryGetValue(circuitCode, out client); 108 tryGetRet = m_clients.TryGetValue(circuitCode, out client);
109 if (tryGetRet) 109 if (tryGetRet)
110 { 110 {
111 CloseAllCircuits(client.AgentId); 111 CloseAllCircuits(client.AgentId);
112 } 112 }
@@ -125,7 +125,7 @@ namespace OpenSim.Framework
125 bool tryGetRet = false; 125 bool tryGetRet = false;
126 lock (m_clients) 126 lock (m_clients)
127 tryGetRet = m_clients.TryGetValue(circuits[i], out client); 127 tryGetRet = m_clients.TryGetValue(circuits[i], out client);
128 if(tryGetRet) 128 if (tryGetRet)
129 { 129 {
130 Remove(client.CircuitCode); 130 Remove(client.CircuitCode);
131 client.Close(false); 131 client.Close(false);
@@ -138,7 +138,7 @@ namespace OpenSim.Framework
138 } 138 }
139 } 139 }
140 140
141 public uint[] GetAllCircuits(LLUUID agentId) 141 public uint[] GetAllCircuits(LLUUID agentId)
142 { 142 {
143 List<uint> circuits = new List<uint>(); 143 List<uint> circuits = new List<uint>();
144 // Wasteful, I know 144 // Wasteful, I know
@@ -149,7 +149,7 @@ namespace OpenSim.Framework
149 m_clients.Values.CopyTo(LocalClients, 0); 149 m_clients.Values.CopyTo(LocalClients, 0);
150 } 150 }
151 151
152 for (int i = 0; i < LocalClients.Length; i++ ) 152 for (int i = 0; i < LocalClients.Length; i++)
153 { 153 {
154 if (LocalClients[i].AgentId == agentId) 154 if (LocalClients[i].AgentId == agentId)
155 { 155 {
@@ -173,7 +173,7 @@ namespace OpenSim.Framework
173 173
174 public void ViewerEffectHandler(IClientAPI sender, ViewerEffectPacket.EffectBlock[] effectBlock) 174 public void ViewerEffectHandler(IClientAPI sender, ViewerEffectPacket.EffectBlock[] effectBlock)
175 { 175 {
176 ViewerEffectPacket packet = (ViewerEffectPacket) PacketPool.Instance.GetPacket(PacketType.ViewerEffect); 176 ViewerEffectPacket packet = (ViewerEffectPacket) PacketPool.Instance.GetPacket(PacketType.ViewerEffect);
177 // TODO: don't create new blocks if recycling an old packet 177 // TODO: don't create new blocks if recycling an old packet
178 packet.Effect = effectBlock; 178 packet.Effect = effectBlock;
179 179
@@ -205,4 +205,4 @@ namespace OpenSim.Framework
205 } 205 }
206 } 206 }
207 } 207 }
208} 208} \ No newline at end of file