repl
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m37s

This commit is contained in:
Smile Rex
2026-01-22 17:22:00 +03:00
parent a54b315e5d
commit 2459262cef

View File

@@ -30,13 +30,12 @@ export class GameSocket {
this.socket.onmessage = (e) => { this.socket.onmessage = (e) => {
const msg = JSON.parse(e.data); const msg = JSON.parse(e.data);
switch (msg.type) { if (msg.type === "init") {
case "init": this.playerId = msg.payload.id;
this.playerId = msg.payload.id; }
break;
case "input": if (msg.type === "input") {
this.onState?.(msg.payload); this.onState?.(msg.payload);
break;
} }
}; };