diff --git a/scripts/game.mjs b/scripts/game.mjs index 5b63f3c..2e14ae5 100644 --- a/scripts/game.mjs +++ b/scripts/game.mjs @@ -7,6 +7,7 @@ export class Game { constructor(id, options) { this.id = id; this.players = []; + this.oldWorld = [] this.world = new World(options) } diff --git a/scripts/server/netcode.mjs b/scripts/server/netcode.mjs index b4ab6e0..6d4e1fc 100644 --- a/scripts/server/netcode.mjs +++ b/scripts/server/netcode.mjs @@ -19,9 +19,6 @@ function connected(client) { const roomPlayers = client.game.players; // Dont send client id's to everyone, TODO const metadata = {players: roomPlayers, roomID: roomID} io.to(client.game.id).emit('metadata', metadata) - - - const id = client.game.id client.emit('message', id) } @@ -52,25 +49,20 @@ function connected(client) { client.join(info[0].id) client.game = info[0]; client.player = info[1] - log.log(`${client.id} joined the game as ${data.name} `, 'FgMagenta'); client.emit('inGame', true) client.sync() client.sendMeta() }) - client.on('leaveGame', function(data){ log.log(client.id + ' disconnected.') client.game.removePlayerByID(client.id) - }) - client.on('clickCanvas', function(data){ if (!roomManager.getAllPlayerIDs().includes(client.id)) return new IllegalAction(client.id, 1) client.game.world.click(data.tilePosition[0],data.tilePosition[1], data.mode, client.player) - client.sync() }) } diff --git a/scripts/world/revealer.mjs b/scripts/world/revealer.mjs index abbc3d8..91442f3 100644 --- a/scripts/world/revealer.mjs +++ b/scripts/world/revealer.mjs @@ -15,7 +15,6 @@ export function reveal(x, y, data) { if (data[x][y].type === 1) { while (toSearch.length > 0) { - console.log("LoopReveal") const x = toSearch[0][0] const y = toSearch[0][1] searchedLocations.push(toSearch[0]) diff --git a/www/game.html b/www/game.html index 8250d6f..738c5bd 100644 --- a/www/game.html +++ b/www/game.html @@ -26,14 +26,26 @@