Esempio n. 1
0
        public BitReader(BitWriter writer)
        {
            writer.FlushBits();

            _data     = writer.RawData;
            _numBytes = writer.BytesWritten;
        }
        public void BroadcastBitStream(BitWriter bs, PacketReliability reliablity, int sequenceChannel = 0)
        {
            bs.FlushBits();

            // #todo Incomplete LiteNet support for Span :(
            server.SendToAll(bs.DataWritten.ToArray(), (byte)sequenceChannel, GetDeliveryMethod(reliablity));
        }
Esempio n. 3
0
        public void Connect(string address, ushort port, BitWriter hailMessage)
        {
            hailMessage.FlushBits();

            var msg = NetDataWriter.FromBytes(hailMessage.DataWritten.Slice(0, hailMessage.BytesWritten).ToArray(), 0, hailMessage.BytesWritten);

            client.Connect(address, port, msg);
        }
        public void Send(BitWriter bs, PacketReliability reliablity, Connection connection, int sequenceChannel = 0)
        {
            bs.FlushBits();

            var peer = server.GetPeerById((int)connection.id);

            peer.Send(bs.DataWritten, (byte)sequenceChannel, GetDeliveryMethod(reliablity));
        }
Esempio n. 5
0
        public void Send(BitWriter bs, PacketReliability reliablity, int sequenceChannel = 0)
        {
            bs.FlushBits();

            client.FirstPeer.Send(bs.DataWritten, (byte)sequenceChannel, GetDeliveryMethod(reliablity));
        }