From 8cc663d9a707ed8a5f272c146a89b1811818c189 Mon Sep 17 00:00:00 2001 From: biglyderv Date: Fri, 3 Jan 2025 14:54:49 -0500 Subject: [PATCH] huge optimization to network --- common/shooter.js | 4 ++-- game.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common/shooter.js b/common/shooter.js index a5cf30b..12adbc0 100644 --- a/common/shooter.js +++ b/common/shooter.js @@ -12,10 +12,10 @@ class Shooter extends Entity { this.immortal = true; this.serverProps = [ - 'type', 'pos', 'vel', 'you', 'immortal', 'dir' + 'type', 'pos', 'vel', 'immortal', 'dir' ]; - this.dir = Math.random() * 696969; + this.dir = Math.random() * 6969; } handleTick(game) { this.ticks++; diff --git a/game.js b/game.js index 3fbe7cd..fefff9f 100644 --- a/game.js +++ b/game.js @@ -181,7 +181,9 @@ class Game extends GameBasic { na.push(JSON.stringify([this.width, this.height])) - client.send(`[${na.join(',')}]`); + let dd = `[${na.join(',')}]`; + + client.send(dd); wsEnt.isYou = false; }