aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-10-09 20:02:40 +0000
committerJustin Clarke Casey2008-10-09 20:02:40 +0000
commit997eec671a6914e7e110a846f9ddba030c7b718d (patch)
tree7c474d3f02fabde30cfcc1f4d88c141fc4092314 /OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
parent* Put tests dll *after* the code it relies on. (repeat to self: always do na... (diff)
downloadopensim-SC_OLD-997eec671a6914e7e110a846f9ddba030c7b718d.zip
opensim-SC_OLD-997eec671a6914e7e110a846f9ddba030c7b718d.tar.gz
opensim-SC_OLD-997eec671a6914e7e110a846f9ddba030c7b718d.tar.bz2
opensim-SC_OLD-997eec671a6914e7e110a846f9ddba030c7b718d.tar.xz
* minor: get rid of an unecessary casting and logic check
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs15
1 files changed, 5 insertions, 10 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index 34481df..71f854a 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -281,9 +281,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
281 } 281 }
282 else if (packet.Type == PacketType.UseCircuitCode) 282 else if (packet.Type == PacketType.UseCircuitCode)
283 { 283 {
284 AddNewClient(packet);
285
286 UseCircuitCodePacket p = (UseCircuitCodePacket)packet; 284 UseCircuitCodePacket p = (UseCircuitCodePacket)packet;
285
286 AddNewClient(p);
287 287
288 // Ack the first UseCircuitCode packet 288 // Ack the first UseCircuitCode packet
289 PacketAckPacket ack_it = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck); 289 PacketAckPacket ack_it = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck);
@@ -292,7 +292,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
292 ack_it.Packets[0] = new PacketAckPacket.PacketsBlock(); 292 ack_it.Packets[0] = new PacketAckPacket.PacketsBlock();
293 ack_it.Packets[0].ID = packet.Header.Sequence; 293 ack_it.Packets[0].ID = packet.Header.Sequence;
294 ack_it.Header.Reliable = false; 294 ack_it.Header.Reliable = false;
295 SendPacketTo(ack_it.ToBytes(),ack_it.ToBytes().Length,SocketFlags.None,p.CircuitCode.Code); 295 SendPacketTo(ack_it.ToBytes(), ack_it.ToBytes().Length, SocketFlags.None, p.CircuitCode.Code);
296 } 296 }
297 } 297 }
298 catch (Exception e) 298 catch (Exception e)
@@ -359,16 +359,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
359 /// Add a new client circuit. 359 /// Add a new client circuit.
360 /// </summary> 360 /// </summary>
361 /// <param name="packet"></param> 361 /// <param name="packet"></param>
362 protected virtual void AddNewClient(Packet packet) 362 protected virtual void AddNewClient(UseCircuitCodePacket useCircuit)
363 { 363 {
364 //Slave regions don't accept new clients 364 //Slave regions don't accept new clients
365 if (m_localScene.Region_Status != RegionStatus.SlaveScene) 365 if (m_localScene.Region_Status != RegionStatus.SlaveScene)
366 { 366 {
367 if (!(packet is UseCircuitCodePacket))
368 return;
369
370 UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet;
371
372 m_log.DebugFormat("[CLIENT]: Adding new circuit for agent {0}, circuit code {1}", useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code); 367 m_log.DebugFormat("[CLIENT]: Adding new circuit for agent {0}, circuit code {1}", useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code);
373 368
374 lock (clientCircuits) 369 lock (clientCircuits)
@@ -400,7 +395,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
400 useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code); 395 useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code);
401 } 396 }
402 397
403 PacketPool.Instance.ReturnPacket(packet); 398 PacketPool.Instance.ReturnPacket(useCircuit);
404 } 399 }
405 400
406 public void ServerListener() 401 public void ServerListener()