TryAddPacket() публичный Метод

Try to add a packet into the buffer. Returns true if the packet was successfully copied.
public TryAddPacket ( IPacketBase packet ) : bool
packet IPacketBase
Результат bool
Пример #1
0
 /// <summary>
 /// Queues a packet to be send on the next update. Will coalesce these packets together.
 /// </summary>
 public void DeferredSendPacket(IPacketBase packet)
 {
     if (!m_currentDeferredPacket.TryAddPacket(packet))
     {
         m_deferredSendList.Add(m_currentDeferredPacket);
         m_currentDeferredPacket = PacketFactory.CreatePacket<CoalescedData>();
         m_currentDeferredPacket.TryAddPacket(packet);
     }
 }