aboutsummaryrefslogtreecommitdiff
path: root/server/bot/src
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-10-19 00:38:09 +0200
committermetamuffin <metamuffin@disroot.org>2025-10-19 00:38:09 +0200
commit62d918e5feeaf5b3add982a5baaffb201a1f2ece (patch)
treeb14a0fa01f9df692592bf5d16543f43b6eb933d6 /server/bot/src
parent6b156bea343a0fd9a043dcfe7113986855a89aab (diff)
downloadhurrycurry-62d918e5feeaf5b3add982a5baaffb201a1f2ece.tar
hurrycurry-62d918e5feeaf5b3add982a5baaffb201a1f2ece.tar.bz2
hurrycurry-62d918e5feeaf5b3add982a5baaffb201a1f2ece.tar.zst
Implement interaction with other players through id instead of tile pos
Diffstat (limited to 'server/bot/src')
-rw-r--r--server/bot/src/algos/customer.rs10
-rw-r--r--server/bot/src/main.rs4
2 files changed, 7 insertions, 7 deletions
diff --git a/server/bot/src/algos/customer.rs b/server/bot/src/algos/customer.rs
index 010ef48a..bd757d9e 100644
--- a/server/bot/src/algos/customer.rs
+++ b/server/bot/src/algos/customer.rs
@@ -24,7 +24,7 @@ use crate::{
};
use hurrycurry_client_lib::Game;
use hurrycurry_protocol::{
- DemandIndex, Hand, Message, PacketS, PlayerClass, PlayerID, Score,
+ DemandIndex, Hand, ItemLocation, Message, PacketS, PlayerClass, PlayerID, Score,
glam::{IVec2, Vec2},
};
use log::debug;
@@ -314,7 +314,7 @@ impl CustomerState {
player: me,
},
PacketS::Interact {
- pos: Some(pos),
+ target: Some(ItemLocation::Tile(pos)),
player: me,
hand: Hand(0),
},
@@ -324,7 +324,7 @@ impl CustomerState {
..Default::default()
}),
PacketS::Interact {
- pos: None,
+ target: None,
player: me,
hand: Hand(0),
},
@@ -393,12 +393,12 @@ impl CustomerState {
extra: vec![
PacketS::Interact {
player: me,
- pos: Some(*table),
+ target: Some(ItemLocation::Tile(*table)),
hand: Hand(0),
},
PacketS::Interact {
player: me,
- pos: None,
+ target: None,
hand: Hand(0),
},
],
diff --git a/server/bot/src/main.rs b/server/bot/src/main.rs
index d2bd10c5..22dc2e3f 100644
--- a/server/bot/src/main.rs
+++ b/server/bot/src/main.rs
@@ -19,7 +19,7 @@ use anyhow::Result;
use clap::Parser;
use hurrycurry_bot::{BotAlgo, BotInput, algos::ALGO_CONSTRUCTORS};
use hurrycurry_client_lib::{Game, network::sync::Network};
-use hurrycurry_protocol::{Character, Hand, PacketC, PacketS, PlayerClass, PlayerID};
+use hurrycurry_protocol::{Character, Hand, ItemLocation, PacketC, PacketS, PlayerClass, PlayerID};
use log::warn;
use std::{thread::sleep, time::Duration};
@@ -119,7 +119,7 @@ fn main() -> Result<()> {
b.interacting = interact.is_some();
network.queue_out.push_back(PacketS::Interact {
player: b.id,
- pos: interact,
+ target: interact.map(ItemLocation::Tile),
hand: Hand(0),
})
}