2025-10-25 22:04:41 +02:00
|
|
|
/*!
|
|
|
|
|
* Buttplug JS Source Code File - Visit https://buttplug.io for more info about
|
|
|
|
|
* the project. Licensed under the BSD 3-Clause license. See LICENSE file in the
|
|
|
|
|
* project root for full license information.
|
|
|
|
|
*
|
|
|
|
|
* @copyright Copyright (c) Nonpolynomial Labs LLC. All rights reserved.
|
|
|
|
|
*/
|
|
|
|
|
|
2026-03-04 22:27:54 +01:00
|
|
|
"use strict";
|
2025-10-25 22:04:41 +02:00
|
|
|
|
2026-03-08 13:28:59 +01:00
|
|
|
import { type IButtplugClientConnector } from "./IButtplugClientConnector";
|
|
|
|
|
import { type ButtplugMessage } from "../core/Messages";
|
2026-03-04 22:27:54 +01:00
|
|
|
import { ButtplugBrowserWebsocketConnector } from "../utils/ButtplugBrowserWebsocketConnector";
|
2025-10-25 22:04:41 +02:00
|
|
|
|
|
|
|
|
export class ButtplugBrowserWebsocketClientConnector
|
2026-02-06 14:46:47 +01:00
|
|
|
extends ButtplugBrowserWebsocketConnector
|
|
|
|
|
implements IButtplugClientConnector
|
2025-10-25 22:04:41 +02:00
|
|
|
{
|
2026-02-06 14:46:47 +01:00
|
|
|
public send = (msg: ButtplugMessage): void => {
|
|
|
|
|
if (!this.Connected) {
|
2026-03-04 22:27:54 +01:00
|
|
|
throw new Error("ButtplugClient not connected");
|
2026-02-06 14:46:47 +01:00
|
|
|
}
|
|
|
|
|
this.sendMessage(msg);
|
|
|
|
|
};
|
2025-10-25 22:04:41 +02:00
|
|
|
}
|