diff options
author | metamuffin <metamuffin@disroot.org> | 2024-09-19 19:07:24 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-09-19 19:07:29 +0200 |
commit | 1bc21d167e19c04049c003c371ba6dc55e5e682c (patch) | |
tree | b35723bc87980c07d046f042c0170aba735c853f | |
parent | fd6dcda54288c5c5fa6d5419f1924ad92b392fc0 (diff) | |
download | hurrycurry-1bc21d167e19c04049c003c371ba6dc55e5e682c.tar hurrycurry-1bc21d167e19c04049c003c371ba6dc55e5e682c.tar.bz2 hurrycurry-1bc21d167e19c04049c003c371ba6dc55e5e682c.tar.zst |
send tutorial end packet
-rw-r--r-- | server/protocol/src/lib.rs | 3 | ||||
-rw-r--r-- | server/src/entity/tutorial.rs | 4 | ||||
-rw-r--r-- | test-client/protocol.ts | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/server/protocol/src/lib.rs b/server/protocol/src/lib.rs index fb6ad46e..4ec2ec37 100644 --- a/server/protocol/src/lib.rs +++ b/server/protocol/src/lib.rs @@ -240,6 +240,9 @@ pub enum PacketC { Environment { effects: HashSet<String>, }, + TutorialEnded { + item: ItemIndex, + }, /// For use in replay sessions only ReplayStart, diff --git a/server/src/entity/tutorial.rs b/server/src/entity/tutorial.rs index 7aa1578a..5ec1281d 100644 --- a/server/src/entity/tutorial.rs +++ b/server/src/entity/tutorial.rs @@ -58,7 +58,9 @@ impl Entity for Tutorial { if hint.is_none() { self.delete_timer -= TARGET_DT; if self.delete_timer <= 0. { - hint = None + hint = None; + c.packet_out + .push_back(PacketC::TutorialEnded { item: self.target }); } else { hint = Some((None, trm!("s.tutorial.finished"))); } diff --git a/test-client/protocol.ts b/test-client/protocol.ts index b6ef9046..1c7e30cd 100644 --- a/test-client/protocol.ts +++ b/test-client/protocol.ts @@ -64,6 +64,7 @@ export type PacketC = | { type: "score" } & Score // Supplies information for score OSD | { type: "menu" } & Menu // Open a menu on the client-side | { type: "environment", effects: string[] } + | { type: "tutorial_ended", item: ItemIndex } | { type: "set_ingame", state: boolean, lobby: boolean } // Set to false when entering the game or switching maps export type Menu = |