示例#1
0
        protected ButtplugClient(string aClientName, ButtplugCallback aCallback)
        {
            Name = aClientName;
            SorterCallbackDelegate = aCallback;
            var context     = new WeakReference(this);
            var clientIndex = _clientCounter;

            // Since we can pass the handle, I don't *think* this needs to be pinned?
            _indexHandle = GCHandle.Alloc(clientIndex);
            _clientStorage.Add(_clientCounter, context);
            _clientHandle = ButtplugFFI.SendCreateClient(aClientName, SorterCallbackDelegate, GCHandle.ToIntPtr(_indexHandle));
        }
        protected ButtplugClient(string aClientName, ButtplugCallback aCallback)
        {
            Name = aClientName;
            _sorterCallbackDelegate = aCallback;
            _disposeLock            = new object();

            _messageSorter = new ButtplugFFIMessageSorter();
            _devices       = new Dictionary <uint, ButtplugClientDevice>();

            var context     = new WeakReference(this);
            var clientIndex = _clientCounter;

            _clientCounter += 1;

            // Since we can pass the handle, I don't *think* this needs to be pinned?
            _indexHandle = GCHandle.Alloc(clientIndex);
            _clientStorage.Add(clientIndex, context);
            _clientHandle = ButtplugFFI.SendCreateClient(aClientName, _sorterCallbackDelegate, GCHandle.ToIntPtr(_indexHandle));
        }
示例#3
0
 public ButtplugClient(string aClientName)
 {
     Name = aClientName;
     SorterCallbackDelegate = SorterCallback;
     _clientHandle          = ButtplugFFI.SendCreateClient(aClientName, SorterCallbackDelegate);
 }