aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ClientStack/UDPServer.cs83
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs9
2 files changed, 58 insertions, 34 deletions
diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs
index 73f2ac1..7b32490 100644
--- a/OpenSim/Region/ClientStack/UDPServer.cs
+++ b/OpenSim/Region/ClientStack/UDPServer.cs
@@ -224,39 +224,6 @@ namespace OpenSim.Region.ClientStack
224 m_log.Debug("[UDPSERVER]: " + e.ToString()); 224 m_log.Debug("[UDPSERVER]: " + e.ToString());
225 } 225 }
226 226
227 if (packet != null)
228 {
229 // do we already have a circuit for this endpoint
230 uint circuit;
231 if (clientCircuits.TryGetValue(epSender, out circuit))
232 {
233 //if so then send packet to the packetserver
234 //m_log.Warn("[UDPSERVER]: ALREADY HAVE Circuit!");
235 m_packetServer.InPacket(circuit, packet);
236 }
237 else if (packet.Type == PacketType.UseCircuitCode)
238 {
239 // new client
240 m_log.Debug("[UDPSERVER]: Adding New Client");
241 try
242 {
243 AddNewClient(packet);
244 }
245 catch (Exception e3)
246 {
247 m_log.Error("[UDPSERVER]: Adding New Client threw exception " + e3.ToString());
248 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender,
249 ReceivedData, null);
250 }
251 }
252 else
253 {
254 // invalid client
255 //CFK: This message seems to have served its usefullness as of 12-15 so I am commenting it out for now
256 //m_log.Warn("[UDPSERVER]: Got a packet from an invalid client - " + packet.ToString());
257
258 }
259 }
260 try 227 try
261 { 228 {
262 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); 229 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
@@ -289,6 +256,56 @@ namespace OpenSim.Region.ClientStack
289 } 256 }
290 257
291 } 258 }
259
260 if (packet != null)
261 {
262 try
263 {
264 // do we already have a circuit for this endpoint
265 uint circuit;
266
267 bool ret = false;
268 lock (clientCircuits)
269 {
270 ret = clientCircuits.TryGetValue(epSender, out circuit);
271 }
272 if (ret)
273 {
274 //if so then send packet to the packetserver
275 //m_log.Warn("[UDPSERVER]: ALREADY HAVE Circuit!");
276 m_packetServer.InPacket(circuit, packet);
277 }
278 else if (packet.Type == PacketType.UseCircuitCode)
279 {
280 // new client
281 m_log.Debug("[UDPSERVER]: Adding New Client");
282 AddNewClient(packet);
283 }
284 else
285 {
286 // invalid client
287 //CFK: This message seems to have served its usefullness as of 12-15 so I am commenting it out for now
288 //m_log.Warn("[UDPSERVER]: Got a packet from an invalid client - " + packet.ToString());
289
290 }
291 }
292 catch (Exception ex)
293 {
294 m_log.Error("[UDPSERVER]: Exception in processing packet.");
295 m_log.Debug("[UDPSERVER]: Adding New Client");
296 try
297 {
298 AddNewClient(packet);
299 }
300 catch (Exception e3)
301 {
302 m_log.Error("[UDPSERVER]: Adding New Client threw exception " + e3.ToString());
303 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender,
304 ReceivedData, null);
305 }
306 }
307 }
308
292 } 309 }
293 310
294 private void CloseEndPoint(EndPoint sender) 311 private void CloseEndPoint(EndPoint sender)
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 84ee9c4..8e5907c 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -750,7 +750,14 @@ namespace OpenSim.Region.Environment.Scenes
750 if ((flags & (uint) DCF) != 0) 750 if ((flags & (uint) DCF) != 0)
751 { 751 {
752 DCFlagKeyPressed = true; 752 DCFlagKeyPressed = true;
753 agent_control_v3 += Dir_Vectors[i]; 753 try
754 {
755 agent_control_v3 += Dir_Vectors[i];
756 }
757 catch (IndexOutOfRangeException)
758 {
759 // Why did I get this?
760 }
754 if ((m_movementflag & (uint) DCF) == 0) 761 if ((m_movementflag & (uint) DCF) == 0)
755 { 762 {
756 m_movementflag += (byte) (uint) DCF; 763 m_movementflag += (byte) (uint) DCF;