Example #1
0
        private void DestructToPlayer(ushort networkId, Session playerSession)
        {
            WriteOnlyBitStream packetStream = new WriteOnlyBitStream();

            packetStream.Write((byte)37);
            packetStream.Write(networkId);

            outgoingPacketQueue.Enqueue(new OutgoingDatagramPacket(packetStream.ToByteArray(), playerSession.Address, playerSession.Port));
        }
Example #2
0
        private void SerializeToPlayer(Replica replica, ushort networkId, Session playerSession)
        {
            WriteOnlyBitStream packetStream = new WriteOnlyBitStream();

            packetStream.Write((byte)39);
            packetStream.Write(networkId);

            replica.Serialize(packetStream, false);

            outgoingPacketQueue.Enqueue(new OutgoingDatagramPacket(packetStream.ToByteArray(), playerSession.Address, playerSession.Port));
        }
Example #3
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);
        }