예제 #1
0
 void WritePacket()
 {
     Packet.WriteI16((short)index, data, 1);
     data[1027] = chunkValue;
     player.SendNow(new Packet(data));
     index = 0;
 }
예제 #2
0
        void SendOldSMPKick(string data)
        {
            // send SMP KICK packet
            byte[] packet = new byte[3 + data.Length * 2];
            packet[0] = 255; // kick opcode
            Packet.WriteI16((short)data.Length, packet, 1);
            Encoding.BigEndianUnicode.GetBytes(data, 0, data.Length, packet, 3);

            writer.Write(packet);
            BytesSent += packet.Length;
            writer.Flush();
        }