aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-09-19 22:36:38 +0200
committermetamuffin <metamuffin@disroot.org>2024-09-19 22:36:39 +0200
commit60adc9a098920f96a3ff1aefe791c129dfc5aa3e (patch)
tree9cbee30eeb35b183e9b8b6253f192ec17d29f2c9
parent5b8ac81f412043218120bd59fcfa9e969c7eeabe (diff)
downloadhurrycurry-60adc9a098920f96a3ff1aefe791c129dfc5aa3e.tar
hurrycurry-60adc9a098920f96a3ff1aefe791c129dfc5aa3e.tar.bz2
hurrycurry-60adc9a098920f96a3ff1aefe791c129dfc5aa3e.tar.zst
send tutorial success
-rw-r--r--server/protocol/src/lib.rs1
-rw-r--r--server/src/entity/tutorial.rs6
-rw-r--r--test-client/protocol.ts2
3 files changed, 8 insertions, 1 deletions
diff --git a/server/protocol/src/lib.rs b/server/protocol/src/lib.rs
index e7b3d483..9d2879f7 100644
--- a/server/protocol/src/lib.rs
+++ b/server/protocol/src/lib.rs
@@ -243,6 +243,7 @@ pub enum PacketC {
TutorialEnded {
player: PlayerID,
item: ItemIndex,
+ success: bool,
},
/// For use in replay sessions only
diff --git a/server/src/entity/tutorial.rs b/server/src/entity/tutorial.rs
index 889815a6..b61827c1 100644
--- a/server/src/entity/tutorial.rs
+++ b/server/src/entity/tutorial.rs
@@ -41,6 +41,11 @@ impl Entity for Tutorial {
message: None,
});
}
+ c.packet_out.push_back(PacketC::TutorialEnded {
+ player: self.player,
+ item: self.target,
+ success: false,
+ });
}
fn tick(&mut self, c: EntityContext<'_>) -> Result<()> {
const TARGET_DT: f32 = 0.2;
@@ -65,6 +70,7 @@ impl Entity for Tutorial {
c.packet_out.push_back(PacketC::TutorialEnded {
item: self.target,
player: self.player,
+ success: true,
});
} else {
hint = Some((None, trm!("s.tutorial.finished")));
diff --git a/test-client/protocol.ts b/test-client/protocol.ts
index 8f20176f..6076d275 100644
--- a/test-client/protocol.ts
+++ b/test-client/protocol.ts
@@ -64,7 +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, player: PlayerID }
+ | { type: "tutorial_ended", item: ItemIndex, player: PlayerID, success: boolean }
| { type: "set_ingame", state: boolean, lobby: boolean } // Set to false when entering the game or switching maps
export type Menu =