add emotes and npcs. this really needs a cleanup

This commit is contained in:
biglyderv 2024-11-25 14:14:20 -05:00
parent da4b0f5df8
commit f8b014507f
11 changed files with 267 additions and 85 deletions

View file

@ -21,9 +21,9 @@ app.ws('/', function (ws, req) {
game.entities[playerI] = player;
ws.active = true;
console.log(`A player ${player.you} joined under IP ${req.headers["x-real-ip"]}`)
// This will only work under NGINX.
console.log(`A player ${player.you} joined under IP ${req.headers["x-real-ip"]}`)
ws.on('message', function message(msg) {
let data = {};
@ -33,8 +33,8 @@ app.ws('/', function (ws, req) {
console.log(err);
data = {};
}
let { vel, dir, you, ticks } = data;
let data2 = { vel, dir, you, ticks };
let { vel, dir, you, ticks, isMenu, r, playing } = data;
let data2 = { vel, dir, you, ticks, isMenu, r, playing };
let you2 = game.entities[playerI].you;