summaryrefslogtreecommitdiff
path: root/test-client/main.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-21 09:48:34 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-21 09:48:34 +0200
commit15c0d3f4236d43c43178f4cc1fc32171ebb732f7 (patch)
tree23456a1ad14b3b54da9e3db5e9d7e8bc40f15acc /test-client/main.ts
parent55da31ebea01103f9002800a309474ae5242d769 (diff)
downloadhurrycurry-15c0d3f4236d43c43178f4cc1fc32171ebb732f7.tar
hurrycurry-15c0d3f4236d43c43178f4cc1fc32171ebb732f7.tar.bz2
hurrycurry-15c0d3f4236d43c43178f4cc1fc32171ebb732f7.tar.zst
add menu to test-client
Diffstat (limited to 'test-client/main.ts')
-rw-r--r--test-client/main.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/test-client/main.ts b/test-client/main.ts
index b497ee36..db474784 100644
--- a/test-client/main.ts
+++ b/test-client/main.ts
@@ -235,6 +235,13 @@ function packet(p: PacketC) {
case "movement_sync":
players.get(my_id)!.position = last_server_sent_position
break;
+ case "menu":
+ switch (p.menu) {
+ case "book": open("https://s.metamuffin.org/static/hurrycurry/book.pdf"); break
+ case "score": alert("Your score: " + JSON.stringify(p.data)); break
+ default: console.warn("unknown menu");
+ }
+ break;
default:
console.warn("unknown packet", p);
}