Protogame.MxReliability.UpdateSendActiveMessages C# (CSharp) Метод

UpdateSendActiveMessages() приватный Метод

Attempt to queue packets for the current active messages that need sending and returns whether it queued anything. If it didn't, then we return false and the caller (UpdateSend) can pick up another active message.
private UpdateSendActiveMessages ( ) : bool
Результат bool
        private bool UpdateSendActiveMessages()
        {
            foreach (var message in this.m_ActiveMessages)
            {
                if (message.HasPendingSends())
                {
                    // Iterate through all of the fragments in the list, and call Send() on the client.
                    // Since the client is in reliable mode, it will send exactly one fragment at a time, thus
                    // reducing the loss over UDP.
                    foreach (var fragment in message.CurrentSendFragments)
                    {
                        if (fragment.Status == FragmentStatus.WaitingOnSend)
                        {
                            this.m_Client.EnqueueSend(fragment.Data, MxMessage.ReliableProtocol);
                            fragment.Status = FragmentStatus.WaitingOnAcknowledgement;
                        }
                    }

                    // Re-evaluate the active messages to find and finalize any that
                    // have been full acknowledged.
                    this.CheckForFullAcknowledgement();

                    // We only deal with one active message per update.
                    return true;
                }
            }

            // We didn't send any message this update.
            return false;
        }