public void SendInputs(uint timestamp, byte validMask, IEnumerable <MatchInput> inputs)
        {
            int size;
            var inputArray = ArrayUtil.ConvertToArray(inputs, out size);

            if (size <= 0)
            {
                return;
            }
            Connection.Send(MessageCodes.UpdateInput, new InputSetMessage {
                StartTimestamp = timestamp,
                InputCount     = (uint)size,
                ValidMask      = MatchInput.AllValid,
                Inputs         = inputArray,
            }, NetworkReliablity.Unreliable);
        }
        public void SendInputs(uint timestamp, IEnumerable <MatchInput> inputs)
        {
            int size;
            var inputArray = ArrayUtil.ConvertToArray(inputs, out size);

            if (size <= 0)
            {
                return;
            }
            using (var rental = ObjectPool <InputSetMessage> .Shared.Borrow()) {
                var message = rental.RentedObject;
                message.StartTimestamp = timestamp;
                message.InputCount     = (uint)size;
                message.Inputs         = inputArray;
                Connection.Send(MessageCodes.UpdateInput, message, NetworkReliablity.Unreliable);
            }
        }
        public void BroadcastInput(uint startTimestamp, byte validMask, IEnumerable <MatchInput> input)
        {
            int inputCount;
            var inputs = ArrayUtil.ConvertToArray(input, out inputCount);

            if (inputCount <= 0)
            {
                return;
            }
            using (var rental = ObjectPool <InputSetMessage> .Shared.Borrow()) {
                var message = rental.RentedObject;
                message.StartTimestamp = startTimestamp;
                message.InputCount     = (uint)inputCount;
                message.ValidMask      = validMask;
                message.Inputs         = inputs;
                NetworkInterface.Connections.SendToAll(MessageCodes.UpdateInput, message, NetworkReliablity.Unreliable);
            }
        }
        public void SendInput(uint startTimestamp, byte validMask, IEnumerable <MatchInput> input)
        {
            if (Connection == null)
            {
                return;
            }
            int inputCount;
            var inputs = ArrayUtil.ConvertToArray(input, out inputCount);

            if (inputCount <= 0)
            {
                return;
            }
            Connection.Send(MessageCodes.UpdateInput, new InputSetMessage {
                StartTimestamp = startTimestamp,
                InputCount     = (uint)inputCount,
                ValidMask      = validMask,
                Inputs         = inputs
            }, NetworkReliablity.Unreliable);
        }