aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-12-16 01:12:16 +0100
committermetamuffin <metamuffin@disroot.org>2025-12-16 01:12:16 +0100
commitc1b9bbb5e76b88e803ba833c16337d528c1dd7be (patch)
tree93761c5f4189ece758923cab3bd2388bbcf18a8c
parente2efb15aa58477d898f92c8959242c0da3ce62bc (diff)
downloadhurrycurry-c1b9bbb5e76b88e803ba833c16337d528c1dd7be.tar
hurrycurry-c1b9bbb5e76b88e803ba833c16337d528c1dd7be.tar.bz2
hurrycurry-c1b9bbb5e76b88e803ba833c16337d528c1dd7be.tar.zst
Rename effect packet for compatiblity with older clients
-rw-r--r--Cargo.lock2
-rw-r--r--client/game.gd2
-rw-r--r--client/multiplayer.gd2
-rw-r--r--server/protocol/Cargo.toml2
-rw-r--r--server/protocol/src/lib.rs2
-rw-r--r--server/src/commands.rs2
-rw-r--r--server/src/entity/demand_sink.rs2
-rw-r--r--server/src/server.rs2
-rw-r--r--test-client/protocol.ts2
9 files changed, 9 insertions, 9 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 903985ae..5a687108 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1082,7 +1082,7 @@ dependencies = [
[[package]]
name = "hurrycurry-protocol"
-version = "12.1.0"
+version = "12.0.0"
dependencies = [
"glam",
"serde",
diff --git a/client/game.gd b/client/game.gd
index 4d759e95..13eedcda 100644
--- a/client/game.gd
+++ b/client/game.gd
@@ -293,7 +293,7 @@ func handle_packet(p):
player.clear_item_message()
player.clear_effect()
overlay_pinned_messages.clear_item(p.player)
- "effect":
+ "effect2":
if not "location" in p: return # ignore old server format
if "player" in p.location: players[p.location.player[0]].effect_message(p.name)
elif "tile" in p.location: pass # TODO create effect at tile
diff --git a/client/multiplayer.gd b/client/multiplayer.gd
index 52efce20..5ce5bb93 100644
--- a/client/multiplayer.gd
+++ b/client/multiplayer.gd
@@ -20,7 +20,7 @@ signal packet(packet: Dictionary)
signal connection_closed()
static var VERSION_MAJOR: int = 12
-static var VERSION_MINOR: int = 1
+static var VERSION_MINOR: int = 0
var connected := false
var socket := WebSocketPeer.new()
diff --git a/server/protocol/Cargo.toml b/server/protocol/Cargo.toml
index 520db1ef..f439f4fd 100644
--- a/server/protocol/Cargo.toml
+++ b/server/protocol/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "hurrycurry-protocol"
-version = "12.1.0"
+version = "12.0.0"
edition = "2024"
[dependencies]
diff --git a/server/protocol/src/lib.rs b/server/protocol/src/lib.rs
index 1fbb5e03..d7cd2cd9 100644
--- a/server/protocol/src/lib.rs
+++ b/server/protocol/src/lib.rs
@@ -267,7 +267,7 @@ pub enum PacketC {
message: Option<Message>,
timeout: Option<MessageTimeout>,
},
- Effect {
+ Effect2 {
name: String,
location: ItemLocation,
},
diff --git a/server/src/commands.rs b/server/src/commands.rs
index 7b3ce48d..6aba5f8f 100644
--- a/server/src/commands.rs
+++ b/server/src/commands.rs
@@ -275,7 +275,7 @@ impl Server {
}),
Command::Effect { name } => {
self.broadcast
- .send(PacketC::Effect {
+ .send(PacketC::Effect2 {
name,
location: ItemLocation::Player(player, Hand(0)),
})
diff --git a/server/src/entity/demand_sink.rs b/server/src/entity/demand_sink.rs
index 2955e444..173d166b 100644
--- a/server/src/entity/demand_sink.rs
+++ b/server/src/entity/demand_sink.rs
@@ -36,7 +36,7 @@ impl Entity for DemandSink {
c.game.score.demands_completed += 1;
c.game.score.points += demand.points;
*c.score_changed = true;
- c.packet_out.push_back(PacketC::Effect {
+ c.packet_out.push_back(PacketC::Effect2 {
name: "satisfied".to_string(),
location: ItemLocation::Tile(self.pos),
});
diff --git a/server/src/server.rs b/server/src/server.rs
index afeda492..b2597bc6 100644
--- a/server/src/server.rs
+++ b/server/src/server.rs
@@ -494,7 +494,7 @@ impl Server {
.push_back(PacketC::RemovePlayer { id: player })
}
PacketS::Effect { player, name } => {
- self.packet_out.push_back(PacketC::Effect {
+ self.packet_out.push_back(PacketC::Effect2 {
name,
location: ItemLocation::Player(player, Hand(0)),
});
diff --git a/test-client/protocol.ts b/test-client/protocol.ts
index a8dc2424..2f7ae259 100644
--- a/test-client/protocol.ts
+++ b/test-client/protocol.ts
@@ -66,7 +66,7 @@ export type PacketC =
| { type: "update_map", tile: Vec2, kind: TileIndex | null, neighbors: (TileIndex | null)[] } // A map tile was changed
| { type: "flush_map" }
| { type: "communicate", player: PlayerID, message?: Message, timeout?: MessageTimeout } // A player wants to communicate something, message is null when cleared
- | { type: "effect", location: ItemLocation, name: string } // Player sent an effect
+ | { type: "effect2", location: ItemLocation, name: string } // Player sent an effect
| { type: "server_message", message: Message, error: boolean } // Text message from the server
| { type: "server_hint", message?: Message, position?: Vec2, player: PlayerID } // Hint message from server with optional position. Message is unset to clear previous message
| { type: "score" } & Score // Supplies information for score OSD