diff --git a/web/static/js/Socket.js b/web/static/js/Socket.js deleted file mode 100644 index 74ac9f2..0000000 --- a/web/static/js/Socket.js +++ /dev/null @@ -1,47 +0,0 @@ -class Socket { - constructor(url) { - this.url = url; - this.socket = null; - } - - connect(player) { - this.socket = io.connect(this.url); - - this.socket.on('connect', () => { - console.log("Connected to server!"); - }); - - this.socket.on('disconnect', () => { - player.init(); - console.log("Disconnected from server!"); - }); - - this.socket.on('error', (e) => { - console.log(e); - }) - } - - disconnect() { - if (this.socket) { - this.socket.disconnect(); - } - } - - send(msg) { - if (this.socket) { - this.socket.emit('message', msg); - } - } - - addMessageListener(callback) { - if (this.socket) { - this.socket.on('message', callback); - } - } - - removeMessageListener(callback) { - if (this.socket) { - this.socket.off('message', callback); - } - } -} \ No newline at end of file