diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index c773c05..0b05ed9 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -399,6 +399,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
399 | #region Queue or Send | 399 | #region Queue or Send |
400 | 400 | ||
401 | OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category); | 401 | OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category); |
402 | outgoingPacket.Type = type; | ||
402 | 403 | ||
403 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket)) | 404 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket)) |
404 | SendPacketFinal(outgoingPacket); | 405 | SendPacketFinal(outgoingPacket); |
@@ -510,6 +511,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
510 | byte flags = buffer.Data[0]; | 511 | byte flags = buffer.Data[0]; |
511 | bool isResend = (flags & Helpers.MSG_RESENT) != 0; | 512 | bool isResend = (flags & Helpers.MSG_RESENT) != 0; |
512 | bool isReliable = (flags & Helpers.MSG_RELIABLE) != 0; | 513 | bool isReliable = (flags & Helpers.MSG_RELIABLE) != 0; |
514 | bool sendSynchronous = false; | ||
513 | LLUDPClient udpClient = outgoingPacket.Client; | 515 | LLUDPClient udpClient = outgoingPacket.Client; |
514 | 516 | ||
515 | if (!udpClient.IsConnected) | 517 | if (!udpClient.IsConnected) |
@@ -565,9 +567,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
565 | if (isReliable) | 567 | if (isReliable) |
566 | Interlocked.Add(ref udpClient.UnackedBytes, outgoingPacket.Buffer.DataLength); | 568 | Interlocked.Add(ref udpClient.UnackedBytes, outgoingPacket.Buffer.DataLength); |
567 | 569 | ||
568 | // Put the UDP payload on the wire | 570 | //Some packet types need to be sent synchonously. |
569 | AsyncBeginSend(buffer); | 571 | //Sorry, i know it's not optimal, but until the LL client |
572 | //manages packets correctly and re-orders them as required, this is necessary. | ||
573 | |||
574 | if (outgoingPacket.Type == PacketType.ImprovedTerseObjectUpdate | ||
575 | || outgoingPacket.Type == PacketType.ChatFromSimulator | ||
576 | || outgoingPacket.Type == PacketType.ObjectUpdate | ||
577 | || outgoingPacket.Type == PacketType.LayerData) | ||
578 | { | ||
579 | sendSynchronous = true; | ||
580 | } | ||
570 | 581 | ||
582 | // Put the UDP payload on the wire | ||
583 | if (sendSynchronous == true) | ||
584 | { | ||
585 | SyncBeginSend(buffer); | ||
586 | } | ||
587 | else | ||
588 | { | ||
589 | AsyncBeginSend(buffer); | ||
590 | } | ||
571 | // Keep track of when this packet was sent out (right now) | 591 | // Keep track of when this packet was sent out (right now) |
572 | outgoingPacket.TickCount = Environment.TickCount & Int32.MaxValue; | 592 | outgoingPacket.TickCount = Environment.TickCount & Int32.MaxValue; |
573 | } | 593 | } |