aboutsummaryrefslogtreecommitdiff
path: root/server/protocol/src
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-10-11 22:53:52 +0200
committermetamuffin <metamuffin@disroot.org>2025-10-11 22:53:52 +0200
commit6c72cc28bcbad679d66fa3eb22b16b9a745d85c6 (patch)
tree1fe621563d3eb1a734492941469d75dbc4c9f526 /server/protocol/src
parent516546c3d20e1715370073acf2e6b8114351f8e9 (diff)
downloadhurrycurry-6c72cc28bcbad679d66fa3eb22b16b9a745d85c6.tar
hurrycurry-6c72cc28bcbad679d66fa3eb22b16b9a745d85c6.tar.bz2
hurrycurry-6c72cc28bcbad679d66fa3eb22b16b9a745d85c6.tar.zst
even better server logging
Diffstat (limited to 'server/protocol/src')
-rw-r--r--server/protocol/src/helpers.rs17
1 files changed, 11 insertions, 6 deletions
diff --git a/server/protocol/src/helpers.rs b/server/protocol/src/helpers.rs
index 098767b5..31e68d02 100644
--- a/server/protocol/src/helpers.rs
+++ b/server/protocol/src/helpers.rs
@@ -105,29 +105,34 @@ impl Recipe {
impl Display for ItemLocation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
- ItemLocation::Tile(pos) => write!(f, "tile({pos})"),
- ItemLocation::Player(PlayerID(id), hand) => write!(f, "{id}-{hand}"),
+ ItemLocation::Tile(pos) => write!(f, "tile({}, {})", pos.x, pos.y),
+ ItemLocation::Player(player, hand) => write!(f, "{player}-{hand}"),
}
}
}
impl Display for Hand {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- write!(f, "hand({})", self.0)
+ write!(f, "hand#{}", self.0)
}
}
impl Display for PlayerID {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- write!(f, "player({})", self.0)
+ write!(f, "player#{}", self.0)
}
}
impl Display for TileIndex {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- write!(f, "tile({})", self.0)
+ write!(f, "tile#{}", self.0)
}
}
impl Display for ItemIndex {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- write!(f, "item({})", self.0)
+ write!(f, "item#{}", self.0)
+ }
+}
+impl Display for RecipeIndex {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ write!(f, "recipe#{}", self.0)
}
}