chore cleanup
This commit is contained in:
@@ -4,8 +4,8 @@ export default class WetSock {
|
|||||||
#clients = new Map();
|
#clients = new Map();
|
||||||
#plugins = new Map();
|
#plugins = new Map();
|
||||||
constructor(config) {
|
constructor(config) {
|
||||||
this.config = config;
|
this.#config = config;
|
||||||
this.server = null;
|
this.#server = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
start(server) {
|
start(server) {
|
||||||
@@ -36,7 +36,6 @@ export default class WetSock {
|
|||||||
if(plugin.onMessage(ws.data.clientId, message)) break; // plugin consumes message by returning a truthy value
|
if(plugin.onMessage(ws.data.clientId, message)) break; // plugin consumes message by returning a truthy value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleOpen(ws) {
|
handleOpen(ws) {
|
||||||
const client = this.#clients.get(ws.data.clientId);
|
const client = this.#clients.get(ws.data.clientId);
|
||||||
this.#plugins.forEach((plugin) => plugin.onOpen(ws.data.clientId));
|
this.#plugins.forEach((plugin) => plugin.onOpen(ws.data.clientId));
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import WetSock from './WetSock';
|
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
|
|
||||||
|
import WetSock from './WetSock';
|
||||||
|
|
||||||
|
|
||||||
const wetsock = new WetSock();
|
const wetsock = new WetSock();
|
||||||
|
|
||||||
const server = Bun.serve({
|
const server = Bun.serve({
|
||||||
|
|||||||
Reference in New Issue
Block a user