Beispiel #1
0
        public void SendPacket(RailResource resource, IRailNetPeer peer, RailPacketOutgoing packet)
        {
            bitBuffer.Clear();
            packet.Encode(resource, bitBuffer);
            int length = bitBuffer.Store(bytes);

            RailDebug.Assert(length <= RailConfig.PACKCAP_MESSAGE_TOTAL);
            peer.SendPayload(new ArraySegment <byte>(bytes, 0, length));
        }