diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-09 15:31:13 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-09 15:31:13 +0200 |
commit | 545f79b03ca1fa778cfffb77ee0fbd0f5e66de44 (patch) | |
tree | a0324b8731f0042e89a6b0417837d8aa933e5aaf /server/src/game.rs | |
parent | 1da3465d7a4402760aed03ce2f450cd1b412417f (diff) | |
download | hurrycurry-545f79b03ca1fa778cfffb77ee0fbd0f5e66de44.tar hurrycurry-545f79b03ca1fa778cfffb77ee0fbd0f5e66de44.tar.bz2 hurrycurry-545f79b03ca1fa778cfffb77ee0fbd0f5e66de44.tar.zst |
adjust logging and better duplex
Diffstat (limited to 'server/src/game.rs')
-rw-r--r-- | server/src/game.rs | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/server/src/game.rs b/server/src/game.rs index 908c0b4e..5cdf8cd4 100644 --- a/server/src/game.rs +++ b/server/src/game.rs @@ -326,8 +326,6 @@ impl Game { .push_back(PacketC::Collide { player, force }); } PacketS::Interact { pos } => { - info!("interact {pos:?}"); - let pid = player; let player = self .players @@ -571,15 +569,22 @@ pub fn interact_effect( if let Some(effect) = interact(&data, edge, this_tile_kind, this, other, points, automated) { match effect { - InteractEffect::Put => packet_out.push_back(PacketC::MoveItem { - from: other_loc, - to: this_loc, - }), - InteractEffect::Take => packet_out.push_back(PacketC::MoveItem { - from: this_loc, - to: other_loc, - }), + InteractEffect::Put => { + info!("put {this_loc} <- {other_loc}"); + packet_out.push_back(PacketC::MoveItem { + from: other_loc, + to: this_loc, + }) + } + InteractEffect::Take => { + info!("take {this_loc} -> {other_loc}"); + packet_out.push_back(PacketC::MoveItem { + from: this_loc, + to: other_loc, + }) + } InteractEffect::Produce => { + info!("produce {this_loc} <~ {other_loc}"); if this_had_item { packet_out.push_back(PacketC::SetProgress { item: this_loc, |