aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-12-14 20:55:32 +0100
committermetamuffin <metamuffin@disroot.org>2025-12-14 20:55:32 +0100
commitc6f3e492d3e5a58fca683ceac0282381b5e066f9 (patch)
tree065d5e83828e76a2e717f68868a389b72826bd64 /server
parent6d982e3ccb990ab8fd45d97a2a6bba77a78d4e2a (diff)
downloadhurrycurry-c6f3e492d3e5a58fca683ceac0282381b5e066f9.tar
hurrycurry-c6f3e492d3e5a58fca683ceac0282381b5e066f9.tar.bz2
hurrycurry-c6f3e492d3e5a58fca683ceac0282381b5e066f9.tar.zst
Effect packet for tile locations (close #534)
Diffstat (limited to 'server')
-rw-r--r--server/protocol/Cargo.toml2
-rw-r--r--server/protocol/src/lib.rs2
-rw-r--r--server/src/commands.rs11
-rw-r--r--server/src/server.rs5
4 files changed, 15 insertions, 5 deletions
diff --git a/server/protocol/Cargo.toml b/server/protocol/Cargo.toml
index f439f4fd..520db1ef 100644
--- a/server/protocol/Cargo.toml
+++ b/server/protocol/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "hurrycurry-protocol"
-version = "12.0.0"
+version = "12.1.0"
edition = "2024"
[dependencies]
diff --git a/server/protocol/src/lib.rs b/server/protocol/src/lib.rs
index 6b4e97f1..1fbb5e03 100644
--- a/server/protocol/src/lib.rs
+++ b/server/protocol/src/lib.rs
@@ -269,7 +269,7 @@ pub enum PacketC {
},
Effect {
name: String,
- player: PlayerID,
+ location: ItemLocation,
},
ServerMessage {
message: Message,
diff --git a/server/src/commands.rs b/server/src/commands.rs
index f5ec6ff5..7b3ce48d 100644
--- a/server/src/commands.rs
+++ b/server/src/commands.rs
@@ -23,7 +23,9 @@ use anyhow::Result;
use clap::{Parser, ValueEnum};
use hurrycurry_bot::algos::ALGO_CONSTRUCTORS;
use hurrycurry_locale::{TrError, tre, trm};
-use hurrycurry_protocol::{Character, Menu, Message, PacketC, PlayerClass, PlayerID};
+use hurrycurry_protocol::{
+ Character, Hand, ItemLocation, Menu, Message, PacketC, PlayerClass, PlayerID,
+};
use std::fmt::Write;
#[cfg(feature = "cheats")]
use std::time::Duration;
@@ -272,7 +274,12 @@ impl Server {
error: false,
}),
Command::Effect { name } => {
- self.broadcast.send(PacketC::Effect { name, player }).ok();
+ self.broadcast
+ .send(PacketC::Effect {
+ name,
+ location: ItemLocation::Player(player, Hand(0)),
+ })
+ .ok();
}
Command::Item { name } => {
let item = self
diff --git a/server/src/server.rs b/server/src/server.rs
index 918058f8..afeda492 100644
--- a/server/src/server.rs
+++ b/server/src/server.rs
@@ -494,7 +494,10 @@ impl Server {
.push_back(PacketC::RemovePlayer { id: player })
}
PacketS::Effect { player, name } => {
- self.packet_out.push_back(PacketC::Effect { name, player });
+ self.packet_out.push_back(PacketC::Effect {
+ name,
+ location: ItemLocation::Player(player, Hand(0)),
+ });
}
PacketS::Movement {
pos,