repl
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m37s
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m37s
This commit is contained in:
@@ -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;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user