diff options
author | Melanie | 2010-12-03 02:36:13 +0000 |
---|---|---|
committer | Melanie | 2010-12-03 02:36:13 +0000 |
commit | 342dc532ec64642d5997f23050a9776f663facdf (patch) | |
tree | b0be3997967aa6e4d79873281f535ad436b841e4 /OpenSim/Region/ClientStack/LindenUDP | |
parent | Change the way sim health reporting reports sim startup (diff) | |
parent | Only force prim persistence before delete if the prim is the result of an unp... (diff) | |
download | opensim-SC-342dc532ec64642d5997f23050a9776f663facdf.zip opensim-SC-342dc532ec64642d5997f23050a9776f663facdf.tar.gz opensim-SC-342dc532ec64642d5997f23050a9776f663facdf.tar.bz2 opensim-SC-342dc532ec64642d5997f23050a9776f663facdf.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Also prevent god takes from ending up in Lost and Found
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 20 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 22 |
3 files changed, 50 insertions, 7 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index f99fa16..9189260 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -3598,14 +3598,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3598 | EntityUpdate update; | 3598 | EntityUpdate update; |
3599 | while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update)) | 3599 | while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update)) |
3600 | { | 3600 | { |
3601 | // If we have sent a kill packet for this object | ||
3602 | // drop any updates on the floor | ||
3603 | if (update.Entity is SceneObjectPart) | 3601 | if (update.Entity is SceneObjectPart) |
3604 | { | 3602 | { |
3605 | SceneObjectPart part = (SceneObjectPart)update.Entity; | 3603 | SceneObjectPart part = (SceneObjectPart)update.Entity; |
3606 | if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId)) | 3604 | if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId)) |
3607 | continue; | 3605 | continue; |
3608 | 3606 | ||
3607 | // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client | ||
3608 | // will never receive an update after a prim kill. Even then, keeping the kill record may be a good | ||
3609 | // safety measure. | ||
3610 | // | ||
3611 | // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update | ||
3612 | // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs | ||
3613 | // updates and kills on different threads with different scheduling strategies, hence this protection. | ||
3614 | // | ||
3615 | // This doesn't appear to apply to child prims - a client will happily ignore these updates | ||
3616 | // after the root prim has been deleted. | ||
3617 | if (m_killRecord.Contains(part.LocalId)) | ||
3618 | { | ||
3619 | // m_log.WarnFormat( | ||
3620 | // "[CLIENT]: Preventing update for prim with local id {0} after client for user {1} told it was deleted", | ||
3621 | // part.LocalId, Name); | ||
3622 | continue; | ||
3623 | } | ||
3624 | |||
3609 | if (part.ParentGroup.IsAttachment && m_disableFacelights) | 3625 | if (part.ParentGroup.IsAttachment && m_disableFacelights) |
3610 | { | 3626 | { |
3611 | if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && | 3627 | if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs index ed0e60d..5aa9b40 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs | |||
@@ -400,7 +400,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
400 | return data; | 400 | return data; |
401 | } | 401 | } |
402 | 402 | ||
403 | public bool EnqueueOutgoing(OutgoingPacket packet) | 403 | /// <summary> |
404 | /// Queue an outgoing packet if appropriate. | ||
405 | /// </summary> | ||
406 | /// <param name="packet"></param> | ||
407 | /// <param name="forceQueue">Always queue the packet if at all possible.</param> | ||
408 | /// <returns> | ||
409 | /// true if the packet has been queued, | ||
410 | /// false if the packet has not been queued and should be sent immediately. | ||
411 | /// </returns> | ||
412 | public bool EnqueueOutgoing(OutgoingPacket packet, bool forceQueue) | ||
404 | { | 413 | { |
405 | int category = (int)packet.Category; | 414 | int category = (int)packet.Category; |
406 | 415 | ||
@@ -416,14 +425,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
416 | 425 | ||
417 | TokenBucket bucket = m_throttleCategories[category]; | 426 | TokenBucket bucket = m_throttleCategories[category]; |
418 | 427 | ||
419 | if (bucket.RemoveTokens(packet.Buffer.DataLength)) | 428 | if (!forceQueue && bucket.RemoveTokens(packet.Buffer.DataLength)) |
420 | { | 429 | { |
421 | // Enough tokens were removed from the bucket, the packet will not be queued | 430 | // Enough tokens were removed from the bucket, the packet will not be queued |
422 | return false; | 431 | return false; |
423 | } | 432 | } |
424 | else | 433 | else |
425 | { | 434 | { |
426 | // Not enough tokens in the bucket, queue this packet | 435 | // Force queue specified or not enough tokens in the bucket, queue this packet |
427 | queue.Enqueue(packet); | 436 | queue.Enqueue(packet); |
428 | return true; | 437 | return true; |
429 | } | 438 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index ef0a178..6985449 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -312,6 +312,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
312 | } | 312 | } |
313 | } | 313 | } |
314 | 314 | ||
315 | /// <summary> | ||
316 | /// Start the process of sending a packet to the client. | ||
317 | /// </summary> | ||
318 | /// <param name="udpClient"></param> | ||
319 | /// <param name="packet"></param> | ||
320 | /// <param name="category"></param> | ||
321 | /// <param name="allowSplitting"></param> | ||
315 | public void SendPacket(LLUDPClient udpClient, Packet packet, ThrottleOutPacketType category, bool allowSplitting) | 322 | public void SendPacket(LLUDPClient udpClient, Packet packet, ThrottleOutPacketType category, bool allowSplitting) |
316 | { | 323 | { |
317 | // CoarseLocationUpdate packets cannot be split in an automated way | 324 | // CoarseLocationUpdate packets cannot be split in an automated way |
@@ -339,6 +346,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
339 | } | 346 | } |
340 | } | 347 | } |
341 | 348 | ||
349 | /// <summary> | ||
350 | /// Start the process of sending a packet to the client. | ||
351 | /// </summary> | ||
352 | /// <param name="udpClient"></param> | ||
353 | /// <param name="data"></param> | ||
354 | /// <param name="type"></param> | ||
355 | /// <param name="category"></param> | ||
342 | public void SendPacketData(LLUDPClient udpClient, byte[] data, PacketType type, ThrottleOutPacketType category) | 356 | public void SendPacketData(LLUDPClient udpClient, byte[] data, PacketType type, ThrottleOutPacketType category) |
343 | { | 357 | { |
344 | int dataLength = data.Length; | 358 | int dataLength = data.Length; |
@@ -396,7 +410,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
396 | 410 | ||
397 | OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category); | 411 | OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category); |
398 | 412 | ||
399 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket)) | 413 | // If a Linden Lab 1.23.5 client receives an update packet after a kill packet for an object, it will |
414 | // continue to display the deleted object until relog. Therefore, we need to always queue a kill object | ||
415 | // packet so that it isn't sent before a queued update packet. | ||
416 | bool requestQueue = type == PacketType.KillObject; | ||
417 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue)) | ||
400 | SendPacketFinal(outgoingPacket); | 418 | SendPacketFinal(outgoingPacket); |
401 | 419 | ||
402 | #endregion Queue or Send | 420 | #endregion Queue or Send |
@@ -489,7 +507,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
489 | //Interlocked.Increment(ref Stats.ResentPackets); | 507 | //Interlocked.Increment(ref Stats.ResentPackets); |
490 | 508 | ||
491 | // Requeue or resend the packet | 509 | // Requeue or resend the packet |
492 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket)) | 510 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, false)) |
493 | SendPacketFinal(outgoingPacket); | 511 | SendPacketFinal(outgoingPacket); |
494 | } | 512 | } |
495 | } | 513 | } |