Esempio n. 1
0
        /// <summary>
        /// Writes the packet.
        /// </summary>
        /// <param name="packet">The packet.</param>
        public void WritePacket(Packet packet) {
            if ( startThread != Thread.CurrentThread )
                throw new IOException("You can only send packet on thread that created packet queue");

            if ( OutQueue != null )
                OutQueue.Enqueue(packet);
        }
Esempio n. 2
0
        /// <summary>
        /// Writes the packet now and flushes the packet queue.
        /// </summary>
        /// <param name="packetDisconnectPlayer">The packet disconnect player.</param>
        internal void WritePacketNowAndFlush(Packet packet) {

            if ( OutQueue != null )
                OutQueue.Clear();

            if ( PacketWriter != null )
                PacketWriter.WritePacket(packet);
        }
 public void WritePacket(Packet packet) {
     WritePacket(packet.WritePacket());
 }