Exemple #1
0
        public void SendGamePacket(ISerializable gamePacket, RemoteConnectionType remoteConnectionType, uint packetId, string destinationAddress, ushort destinationPort)
        {
            WriteOnlyBitStream packetStream = new WriteOnlyBitStream();

            packetStream.Write((byte)83);
            packetStream.Write((ushort)remoteConnectionType);
            packetStream.Write(packetId);
            packetStream.Write((byte)0);

            gamePacket.ToBitStream(packetStream);

            OutgoingDatagramPacket packet = new OutgoingDatagramPacket(packetStream.ToByteArray(), destinationAddress, destinationPort);

            outgoingPacketQueue.Enqueue(packet);
        }