How to use the buttplug.ButtplugMessageException function in buttplug

To help you get started, we’ve selected a few buttplug examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github buttplugio / buttplug-js / packages / buttplug-node-websockets / src / ButtplugNodeWebsocketClientConnector.ts View on Github external
private ParseIncomingMessage = (aMsg: WebSocket.Data) => {
    if (typeof (aMsg) === "string") {
      const msgs = FromJSON(aMsg);
      const emitMsgs = this._sorter.ParseIncomingMessages(msgs);
      this.emit("message", emitMsgs);
    } else {
      throw new ButtplugMessageException("Unknown message transfer type");
    }
  }