aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-09-30 01:19:01 +0200
committermetamuffin <metamuffin@disroot.org>2025-09-30 01:19:09 +0200
commit5033c326094edc1ff4234b994e95d987cb937fc4 (patch)
tree5fa426a77109722df163c15ce8d647170cd8fcea
parent727752b87bbe7146adb0f9e9e27d6e64b785ec2f (diff)
downloadhurrycurry-5033c326094edc1ff4234b994e95d987cb937fc4.tar
hurrycurry-5033c326094edc1ff4234b994e95d987cb937fc4.tar.bz2
hurrycurry-5033c326094edc1ff4234b994e95d987cb937fc4.tar.zst
Implement tile placeable items for server-side (#433)
-rw-r--r--Cargo.lock821
-rw-r--r--Cargo.toml2
-rw-r--r--client/game.gd19
-rw-r--r--data/maps/debug.yaml1
-rw-r--r--server/bot/src/algos/customer.rs16
-rw-r--r--server/bot/src/algos/simple.rs41
-rw-r--r--server/bot/src/algos/waiter.rs2
-rw-r--r--server/client-lib/src/gamedata_index.rs (renamed from server/src/data/index.rs)8
-rw-r--r--server/client-lib/src/lib.rs6
-rw-r--r--server/editor/src/main.rs6
-rw-r--r--server/protocol/src/helpers.rs6
-rw-r--r--server/protocol/src/lib.rs11
-rw-r--r--server/registry/src/lobby.rs6
-rw-r--r--server/src/data/mod.rs31
-rw-r--r--server/src/interaction.rs179
-rw-r--r--server/src/server.rs19
16 files changed, 205 insertions, 969 deletions
diff --git a/Cargo.lock b/Cargo.lock
index cae64eda..f9debc40 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -27,15 +27,6 @@ dependencies = [
]
[[package]]
-name = "aligned-vec"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b"
-dependencies = [
- "equator",
-]
-
-[[package]]
name = "anstream"
version = "0.6.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -92,29 +83,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
[[package]]
-name = "arbitrary"
-version = "1.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1"
-
-[[package]]
-name = "arg_enum_proc_macro"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "arrayvec"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
-
-[[package]]
name = "async-compression"
version = "0.4.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -200,29 +168,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
[[package]]
-name = "av1-grain"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4f3efb2ca85bc610acfa917b5aaa36f3fcbebed5b3182d7f877b02531c4b80c8"
-dependencies = [
- "anyhow",
- "arrayvec",
- "log",
- "nom",
- "num-rational",
- "v_frame",
-]
-
-[[package]]
-name = "avif-serialize"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47c8fbc0f831f4519fe8b810b6a7a91410ec83031b8233f730a0480029f6a23f"
-dependencies = [
- "arrayvec",
-]
-
-[[package]]
name = "aws-lc-rs"
version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -278,10 +223,10 @@ version = "0.72.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895"
dependencies = [
- "bitflags 2.9.4",
+ "bitflags",
"cexpr",
"clang-sys",
- "itertools 0.13.0",
+ "itertools",
"log",
"prettyplease",
"proc-macro2",
@@ -293,30 +238,12 @@ dependencies = [
]
[[package]]
-name = "bit_field"
-version = "0.10.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6"
-
-[[package]]
-name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
name = "bitflags"
version = "2.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394"
[[package]]
-name = "bitstream-io"
-version = "2.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6099cdc01846bc367c4e7dd630dc5966dccf36b652fae7a74e17b640411a91b2"
-
-[[package]]
name = "block-buffer"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -326,12 +253,6 @@ dependencies = [
]
[[package]]
-name = "built"
-version = "0.7.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56ed6191a7e78c36abdb16ab65341eefd73d64d303fffccdbb00d51e4205967b"
-
-[[package]]
name = "bumpalo"
version = "3.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -344,12 +265,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3995eaeebcdf32f91f980d360f78732ddc061097ab4e39991ae7a6ace9194677"
[[package]]
-name = "byteorder-lite"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"
-
-[[package]]
name = "bytes"
version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -362,12 +277,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b"
[[package]]
-name = "c_vec"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fdd7a427adc0135366d99db65b36dae9237130997e560ed61118041fb72be6e8"
-
-[[package]]
name = "cc"
version = "1.2.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -389,16 +298,6 @@ dependencies = [
]
[[package]]
-name = "cfg-expr"
-version = "0.15.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02"
-dependencies = [
- "smallvec",
- "target-lexicon",
-]
-
-[[package]]
name = "cfg-if"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -471,12 +370,6 @@ dependencies = [
]
[[package]]
-name = "color_quant"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
-
-[[package]]
name = "colorchoice"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -546,46 +439,6 @@ dependencies = [
]
[[package]]
-name = "crc32fast"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "crossbeam-deque"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51"
-dependencies = [
- "crossbeam-epoch",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-epoch"
-version = "0.9.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
-dependencies = [
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-utils"
-version = "0.8.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
-
-[[package]]
-name = "crunchy"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
-
-[[package]]
name = "crypto-common"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -636,7 +489,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b035a542cf7abf01f2e3c4d5a7acbaebfefe120ae4efc7bde3df98186e4b8af7"
dependencies = [
- "bitflags 2.9.4",
+ "bitflags",
"proc-macro2",
"proc-macro2-diagnostics",
"quote",
@@ -730,26 +583,6 @@ dependencies = [
]
[[package]]
-name = "equator"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc"
-dependencies = [
- "equator-macro",
-]
-
-[[package]]
-name = "equator-macro"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
name = "equivalent"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -766,56 +599,12 @@ dependencies = [
]
[[package]]
-name = "exr"
-version = "1.73.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f83197f59927b46c04a183a619b7c29df34e63e63c7869320862268c0ef687e0"
-dependencies = [
- "bit_field",
- "half",
- "lebe",
- "miniz_oxide",
- "rayon-core",
- "smallvec",
- "zune-inflate",
-]
-
-[[package]]
name = "fastrand"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
[[package]]
-name = "fax"
-version = "0.2.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f05de7d48f37cd6730705cbca900770cab77a89f413d23e100ad7fad7795a0ab"
-dependencies = [
- "fax_derive",
-]
-
-[[package]]
-name = "fax_derive"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0aca10fb742cb43f9e7bb8467c91aa9bcb8e3ffbc6a6f7389bb93ffc920577d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "fdeflate"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c"
-dependencies = [
- "simd-adler32",
-]
-
-[[package]]
name = "figment"
version = "0.10.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -824,7 +613,7 @@ dependencies = [
"atomic 0.6.1",
"pear",
"serde",
- "toml 0.8.23",
+ "toml",
"uncased",
"version_check",
]
@@ -836,16 +625,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fd99930f64d146689264c637b5af2f0233a933bef0d8570e2526bf9e083192d"
[[package]]
-name = "flate2"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d"
-dependencies = [
- "crc32fast",
- "miniz_oxide",
-]
-
-[[package]]
name = "flume"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1045,16 +824,6 @@ dependencies = [
]
[[package]]
-name = "gif"
-version = "0.13.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ae047235e33e2829703574b54fdec96bfbad892062d97fed2f76022287de61b"
-dependencies = [
- "color_quant",
- "weezl",
-]
-
-[[package]]
name = "gimli"
version = "0.31.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1114,16 +883,6 @@ dependencies = [
]
[[package]]
-name = "half"
-version = "2.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9"
-dependencies = [
- "cfg-if",
- "crunchy",
-]
-
-[[package]]
name = "hashbrown"
version = "0.15.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1589,46 +1348,6 @@ dependencies = [
]
[[package]]
-name = "image"
-version = "0.25.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "529feb3e6769d234375c4cf1ee2ce713682b8e76538cb13f9fc23e1400a591e7"
-dependencies = [
- "bytemuck",
- "byteorder-lite",
- "color_quant",
- "exr",
- "gif",
- "image-webp",
- "moxcms",
- "num-traits",
- "png",
- "qoi",
- "ravif",
- "rayon",
- "rgb",
- "tiff",
- "zune-core",
- "zune-jpeg",
-]
-
-[[package]]
-name = "image-webp"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3"
-dependencies = [
- "byteorder-lite",
- "quick-error",
-]
-
-[[package]]
-name = "imgref"
-version = "1.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408"
-
-[[package]]
name = "indexmap"
version = "2.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1647,23 +1366,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb"
[[package]]
-name = "interpolate_name"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
name = "io-uring"
version = "0.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b"
dependencies = [
- "bitflags 2.9.4",
+ "bitflags",
"cfg-if",
"libc",
]
@@ -1703,15 +1411,6 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]]
name = "itertools"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
-dependencies = [
- "either",
-]
-
-[[package]]
-name = "itertools"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
@@ -1776,28 +1475,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
-name = "lebe"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8"
-
-[[package]]
name = "libc"
version = "0.2.175"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
[[package]]
-name = "libfuzzer-sys"
-version = "0.4.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5037190e1f70cbeef565bd267599242926f724d3b8a9f510fd7e0b540cfa4404"
-dependencies = [
- "arbitrary",
- "cc",
-]
-
-[[package]]
name = "libloading"
version = "0.8.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1819,7 +1502,7 @@ version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb"
dependencies = [
- "bitflags 2.9.4",
+ "bitflags",
"libc",
]
@@ -1886,15 +1569,6 @@ dependencies = [
]
[[package]]
-name = "loop9"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062"
-dependencies = [
- "imgref",
-]
-
-[[package]]
name = "lru-slab"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1930,16 +1604,6 @@ dependencies = [
]
[[package]]
-name = "maybe-rayon"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519"
-dependencies = [
- "cfg-if",
- "rayon",
-]
-
-[[package]]
name = "mdns-sd"
version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1979,7 +1643,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
dependencies = [
"adler2",
- "simd-adler32",
]
[[package]]
@@ -1995,16 +1658,6 @@ dependencies = [
]
[[package]]
-name = "moxcms"
-version = "0.7.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddd32fa8935aeadb8a8a6b6b351e40225570a37c43de67690383d87ef170cd08"
-dependencies = [
- "num-traits",
- "pxfm",
-]
-
-[[package]]
name = "multer"
version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2024,12 +1677,6 @@ dependencies = [
]
[[package]]
-name = "new_debug_unreachable"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
-
-[[package]]
name = "nom"
version = "7.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2040,12 +1687,6 @@ dependencies = [
]
[[package]]
-name = "noop_proc_macro"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8"
-
-[[package]]
name = "nu-ansi-term"
version = "0.50.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2055,53 +1696,12 @@ dependencies = [
]
[[package]]
-name = "num-bigint"
-version = "0.4.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
-dependencies = [
- "num-integer",
- "num-traits",
-]
-
-[[package]]
name = "num-conv"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
[[package]]
-name = "num-derive"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "num-integer"
-version = "0.1.46"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
-dependencies = [
- "num-traits",
-]
-
-[[package]]
-name = "num-rational"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"
-dependencies = [
- "num-bigint",
- "num-integer",
- "num-traits",
-]
-
-[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2178,12 +1778,6 @@ dependencies = [
]
[[package]]
-name = "paste"
-version = "1.0.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
-
-[[package]]
name = "pear"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2225,46 +1819,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
-name = "pixelcurry"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "clap",
- "env_logger",
- "hurrycurry-client-lib",
- "hurrycurry-protocol",
- "log",
- "rand 0.9.2",
- "rustls",
- "sdl2",
- "serde",
- "serde_json",
- "toml 0.9.6",
- "tungstenite",
- "users",
- "xdg",
-]
-
-[[package]]
name = "pkg-config"
version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
[[package]]
-name = "png"
-version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97baced388464909d42d89643fe4361939af9b7ce7a31ee32a168f832a70f2a0"
-dependencies = [
- "bitflags 2.9.4",
- "crc32fast",
- "fdeflate",
- "flate2",
- "miniz_oxide",
-]
-
-[[package]]
name = "pollster"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2342,49 +1902,6 @@ dependencies = [
]
[[package]]
-name = "profiling"
-version = "1.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773"
-dependencies = [
- "profiling-procmacros",
-]
-
-[[package]]
-name = "profiling-procmacros"
-version = "1.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52717f9a02b6965224f95ca2a81e2e0c5c43baacd28ca057577988930b6c3d5b"
-dependencies = [
- "quote",
- "syn",
-]
-
-[[package]]
-name = "pxfm"
-version = "0.1.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f55f4fedc84ed39cb7a489322318976425e42a147e2be79d8f878e2884f94e84"
-dependencies = [
- "num-traits",
-]
-
-[[package]]
-name = "qoi"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001"
-dependencies = [
- "bytemuck",
-]
-
-[[package]]
-name = "quick-error"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
-
-[[package]]
name = "quinn"
version = "0.11.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2398,7 +1915,7 @@ dependencies = [
"rustc-hash",
"rustls",
"socket2 0.6.0",
- "thiserror 2.0.16",
+ "thiserror",
"tokio",
"tracing",
"web-time",
@@ -2419,7 +1936,7 @@ dependencies = [
"rustls",
"rustls-pki-types",
"slab",
- "thiserror 2.0.16",
+ "thiserror",
"tinyvec",
"tracing",
"web-time",
@@ -2524,82 +2041,12 @@ dependencies = [
]
[[package]]
-name = "rav1e"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9"
-dependencies = [
- "arbitrary",
- "arg_enum_proc_macro",
- "arrayvec",
- "av1-grain",
- "bitstream-io",
- "built",
- "cfg-if",
- "interpolate_name",
- "itertools 0.12.1",
- "libc",
- "libfuzzer-sys",
- "log",
- "maybe-rayon",
- "new_debug_unreachable",
- "noop_proc_macro",
- "num-derive",
- "num-traits",
- "once_cell",
- "paste",
- "profiling",
- "rand 0.8.5",
- "rand_chacha 0.3.1",
- "simd_helpers",
- "system-deps",
- "thiserror 1.0.69",
- "v_frame",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "ravif"
-version = "0.11.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5825c26fddd16ab9f515930d49028a630efec172e903483c94796cfe31893e6b"
-dependencies = [
- "avif-serialize",
- "imgref",
- "loop9",
- "quick-error",
- "rav1e",
- "rayon",
- "rgb",
-]
-
-[[package]]
-name = "rayon"
-version = "1.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f"
-dependencies = [
- "either",
- "rayon-core",
-]
-
-[[package]]
-name = "rayon-core"
-version = "1.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
-dependencies = [
- "crossbeam-deque",
- "crossbeam-utils",
-]
-
-[[package]]
name = "redox_syscall"
version = "0.5.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77"
dependencies = [
- "bitflags 2.9.4",
+ "bitflags",
]
[[package]]
@@ -2610,7 +2057,7 @@ checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac"
dependencies = [
"getrandom 0.2.16",
"libredox",
- "thiserror 2.0.16",
+ "thiserror",
]
[[package]]
@@ -2704,12 +2151,6 @@ dependencies = [
]
[[package]]
-name = "rgb"
-version = "0.8.52"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c6a884d2998352bb4daf0183589aec883f16a6da1f4dde84d8e2e9a5409a1ce"
-
-[[package]]
name = "ring"
version = "0.17.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2823,7 +2264,7 @@ version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e"
dependencies = [
- "bitflags 2.9.4",
+ "bitflags",
"errno",
"libc",
"linux-raw-sys",
@@ -2914,37 +2355,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
-name = "sdl2"
-version = "0.38.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d42407afc6a8ab67e36f92e80b8ba34cbdc55aaeed05249efe9a2e8d0e9feef"
-dependencies = [
- "bitflags 1.3.2",
- "c_vec",
- "lazy_static",
- "libc",
- "sdl2-sys",
-]
-
-[[package]]
-name = "sdl2-sys"
-version = "0.38.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ff61407fc75d4b0bbc93dc7e4d6c196439965fbef8e4a4f003a36095823eac0"
-dependencies = [
- "cfg-if",
- "cmake",
- "libc",
- "version-compare 0.1.1",
-]
-
-[[package]]
name = "security-framework"
version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60b369d18893388b345804dc0007963c99b7d665ae71d275812d828c6f089640"
dependencies = [
- "bitflags 2.9.4",
+ "bitflags",
"core-foundation 0.10.1",
"core-foundation-sys",
"libc",
@@ -3014,15 +2430,6 @@ dependencies = [
]
[[package]]
-name = "serde_spanned"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2789234a13a53fc4be1b51ea1bab45a3c338bdb884862a257d10e5a74ae009e6"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
name = "serde_urlencoded"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3085,21 +2492,6 @@ dependencies = [
]
[[package]]
-name = "simd-adler32"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
-
-[[package]]
-name = "simd_helpers"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6"
-dependencies = [
- "quote",
-]
-
-[[package]]
name = "slab"
version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3224,7 +2616,7 @@ version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
dependencies = [
- "bitflags 2.9.4",
+ "bitflags",
"core-foundation 0.9.4",
"system-configuration-sys",
]
@@ -3240,25 +2632,6 @@ dependencies = [
]
[[package]]
-name = "system-deps"
-version = "6.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349"
-dependencies = [
- "cfg-expr",
- "heck",
- "pkg-config",
- "toml 0.8.23",
- "version-compare 0.2.0",
-]
-
-[[package]]
-name = "target-lexicon"
-version = "0.12.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
-
-[[package]]
name = "tempfile"
version = "3.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3273,31 +2646,11 @@ dependencies = [
[[package]]
name = "thiserror"
-version = "1.0.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
-dependencies = [
- "thiserror-impl 1.0.69",
-]
-
-[[package]]
-name = "thiserror"
version = "2.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0"
dependencies = [
- "thiserror-impl 2.0.16",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "thiserror-impl",
]
[[package]]
@@ -3321,20 +2674,6 @@ dependencies = [
]
[[package]]
-name = "tiff"
-version = "0.10.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af9605de7fee8d9551863fd692cce7637f548dbd9db9180fcc07ccc6d26c336f"
-dependencies = [
- "fax",
- "flate2",
- "half",
- "quick-error",
- "weezl",
- "zune-jpeg",
-]
-
-[[package]]
name = "time"
version = "0.3.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3477,27 +2816,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"
dependencies = [
"serde",
- "serde_spanned 0.6.9",
- "toml_datetime 0.6.11",
+ "serde_spanned",
+ "toml_datetime",
"toml_edit",
]
[[package]]
-name = "toml"
-version = "0.9.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae2a4cf385da23d1d53bc15cdfa5c2109e93d8d362393c801e87da2f72f0e201"
-dependencies = [
- "indexmap",
- "serde_core",
- "serde_spanned 1.0.1",
- "toml_datetime 0.7.1",
- "toml_parser",
- "toml_writer",
- "winnow",
-]
-
-[[package]]
name = "toml_datetime"
version = "0.6.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3507,15 +2831,6 @@ dependencies = [
]
[[package]]
-name = "toml_datetime"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a197c0ec7d131bfc6f7e82c8442ba1595aeab35da7adbf05b6b73cd06a16b6be"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
name = "toml_edit"
version = "0.22.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3523,46 +2838,19 @@ checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
dependencies = [
"indexmap",
"serde",
- "serde_spanned 0.6.9",
- "toml_datetime 0.6.11",
+ "serde_spanned",
+ "toml_datetime",
"toml_write",
"winnow",
]
[[package]]
-name = "toml_parser"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b551886f449aa90d4fe2bdaa9f4a2577ad2dde302c61ecf262d80b116db95c10"
-dependencies = [
- "winnow",
-]
-
-[[package]]
name = "toml_write"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
[[package]]
-name = "toml_writer"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fcc842091f2def52017664b53082ecbbeb5c7731092bad69d2c63050401dfd64"
-
-[[package]]
-name = "tools"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "clap",
- "env_logger",
- "image",
- "log",
- "sdl2",
-]
-
-[[package]]
name = "tower"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3583,7 +2871,7 @@ version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2"
dependencies = [
- "bitflags 2.9.4",
+ "bitflags",
"bytes",
"futures-util",
"http 1.3.1",
@@ -3690,7 +2978,7 @@ dependencies = [
"rustls-native-certs",
"rustls-pki-types",
"sha1",
- "thiserror 2.0.16",
+ "thiserror",
"utf-8",
]
@@ -3750,16 +3038,6 @@ dependencies = [
]
[[package]]
-name = "users"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24cc0f6d6f267b73e5a2cadf007ba8f9bc39c6a6f9666f8cf25ea809a153b032"
-dependencies = [
- "libc",
- "log",
-]
-
-[[package]]
name = "utf-8"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3778,35 +3056,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
-name = "v_frame"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "666b7727c8875d6ab5db9533418d7c764233ac9c0cff1d469aec8fa127597be2"
-dependencies = [
- "aligned-vec",
- "num-traits",
- "wasm-bindgen",
-]
-
-[[package]]
name = "valuable"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
[[package]]
-name = "version-compare"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29"
-
-[[package]]
-name = "version-compare"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b"
-
-[[package]]
name = "version_check"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3938,12 +3193,6 @@ dependencies = [
]
[[package]]
-name = "weezl"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3"
-
-[[package]]
name = "wildmatch"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4278,12 +3527,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb"
[[package]]
-name = "xdg"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2fb433233f2df9344722454bc7e96465c9d03bff9d77c248f9e7523fe79585b5"
-
-[[package]]
name = "xml-rs"
version = "0.8.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4438,27 +3681,3 @@ dependencies = [
"cc",
"pkg-config",
]
-
-[[package]]
-name = "zune-core"
-version = "0.4.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a"
-
-[[package]]
-name = "zune-inflate"
-version = "0.2.54"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02"
-dependencies = [
- "simd-adler32",
-]
-
-[[package]]
-name = "zune-jpeg"
-version = "0.4.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713"
-dependencies = [
- "zune-core",
-]
diff --git a/Cargo.toml b/Cargo.toml
index 0b1c4313..887ac828 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,8 +9,6 @@ members = [
"server/discover",
"server/editor",
"server/tools",
- "pixel-client",
- "pixel-client/tools",
"locale/tools",
]
resolver = "2"
diff --git a/client/game.gd b/client/game.gd
index 7289eed0..e5c14fdb 100644
--- a/client/game.gd
+++ b/client/game.gd
@@ -46,8 +46,8 @@ var item_names: Array = []
var item_index_by_name: Dictionary = {}
var tile_names: Array = []
var tile_index_by_name: Dictionary = {}
-var tile_collide: Array = []
-var tile_interact: Array = []
+var tile_walkable: Dictionary = {}
+var tile_placeable_items: Dictionary = {}
var maps: Array = []
var bot_algos: Array
var text_message_history: Array[TextMessage] = []
@@ -93,8 +93,11 @@ func handle_packet(p):
"data":
item_names = p["data"]["item_names"]
tile_names = p["data"]["tile_names"]
- tile_collide = p["data"]["tile_collide"]
- tile_interact = p["data"]["tile_interact"]
+ tile_walkable = {}
+ for tile in p["data"]["tile_walkable"]: tile_walkable[int(tile)] = true
+ tile_placeable_items = {}
+ for tile in p["data"]["tile_placeable_items"]:
+ tile_placeable_items[int(tile)] = p["data"]["tile_placeable_items"][tile].map(func(x): return int(x))
maps = p["data"]["maps"]
bot_algos = p["data"]["bot_algos"]
Global.hand_count = p["data"]["hand_count"]
@@ -423,14 +426,16 @@ func get_message_str(m: Dictionary) -> String:
func get_tile_collision(pos: Vector2i) -> bool:
var t = map.get_tile_name(pos)
if t == null: return true
- else: return tile_collide[tile_index_by_name[t]]
+ else: return not tile_walkable.has(tile_index_by_name[t])
-func get_tile_interactive(pos: Vector2i) -> bool:
+func get_tile_interactive(pos: Vector2i, item = null) -> bool:
var t = map.get_tile_name(pos)
if t == null: return false
else:
if map.get_tile_instance(pos).item != null: return true
- return tile_interact[tile_index_by_name[t]]
+ if !tile_placeable_items.has(tile_index_by_name[t]): return true
+ if item == null: return false # TODO change to true then always supplied
+ return item_index_by_name[item] in tile_placeable_items[tile_index_by_name[t]]
func update_center():
$FollowCamera.autozoom = spectating_mode == SpectatingMode.CENTER and join_state == JoinState.SPECTATING
diff --git a/data/maps/debug.yaml b/data/maps/debug.yaml
index 985697dd..06a5f8ac 100644
--- a/data/maps/debug.yaml
+++ b/data/maps/debug.yaml
@@ -134,3 +134,4 @@ collider:
- tree
- lamp
- white-hole
+ - deep-fryer
diff --git a/server/bot/src/algos/customer.rs b/server/bot/src/algos/customer.rs
index 043e5358..cb5c5b59 100644
--- a/server/bot/src/algos/customer.rs
+++ b/server/bot/src/algos/customer.rs
@@ -134,15 +134,17 @@ impl CustomerState {
let check = *ticks % 10 == 0;
if path.is_done() {
let demand = DemandIndex(random::<u32>() as usize % game.data.demands.len());
+ let requested_item = game.data.demands[demand.0].input;
info!("{me:?} -> waiting");
let timeout = 90. + random::<f32>() * 60.;
let mut facing = Vec2::ZERO;
for off in [IVec2::NEG_X, IVec2::NEG_Y, IVec2::X, IVec2::Y] {
- if game
- .tiles
- .get(&(off + *chair))
- .is_some_and(|t| game.data.is_tile_interactable(t.kind))
- {
+ if game.tiles.get(&(off + *chair)).is_some_and(|t| {
+ game.data
+ .tile_placeable_items
+ .get(&t.kind)
+ .map_or(true, |p| p.contains(&requested_item))
+ }) {
facing = off.as_vec2();
}
}
@@ -158,9 +160,9 @@ impl CustomerState {
let message_item = if config.unknown_order {
game.data
.get_item_by_name("unknown-order")
- .unwrap_or(game.data.demands[demand.0].input)
+ .unwrap_or(requested_item)
} else {
- game.data.demands[demand.0].input
+ requested_item
};
BotInput {
extra: vec![PacketS::Communicate {
diff --git a/server/bot/src/algos/simple.rs b/server/bot/src/algos/simple.rs
index f232062a..42cc4223 100644
--- a/server/bot/src/algos/simple.rs
+++ b/server/bot/src/algos/simple.rs
@@ -118,28 +118,8 @@ impl<S> Context<'_, S> {
.map(|p| p.items[0].is_some())
.unwrap_or(false)
}
- pub fn find_demand(&self) -> Option<(ItemIndex, IVec2)> {
- self.game
- .players
- .iter()
- .find_map(|(_, pl)| match &pl.communicate_persist {
- Some((Message::Item(item), _)) => {
- let pos = pl.movement.position.as_ivec2();
- [IVec2::X, IVec2::Y, -IVec2::X, -IVec2::Y]
- .into_iter()
- .find(|off| {
- self.game
- .tiles
- .get(&(pos + *off))
- .is_some_and(|t| self.game.data.tile_interact[t.kind.0])
- })
- .map(|off| pos + off)
- .map(|pos| (*item, pos))
- }
- _ => None,
- })
- }
- pub fn find_demands_with_table(&self) -> Vec<(ItemIndex, IVec2, f32)> {
+ /// Returns (requested_item, table_pos, remaining_time)
+ pub fn find_demands(&self) -> Vec<(ItemIndex, IVec2, f32)> {
self.game
.players
.iter()
@@ -149,10 +129,13 @@ impl<S> Context<'_, S> {
[IVec2::X, IVec2::Y, -IVec2::X, -IVec2::Y]
.into_iter()
.find(|off| {
- self.game
- .tiles
- .get(&(pos + *off))
- .is_some_and(|t| self.game.data.tile_interact[t.kind.0])
+ self.game.tiles.get(&(pos + *off)).is_some_and(|t| {
+ self.game
+ .data
+ .tile_placeable_items
+ .get(&t.kind)
+ .map_or(true, |placable| placable.contains(item))
+ })
})
.map(|off| pos + off)
.map(|pos| (*item, pos, timeout.remaining))
@@ -202,7 +185,7 @@ impl<S> Context<'_, S> {
.tiles
.iter()
.find(|(_, t)| {
- self.game.data.tile_interact[t.kind.0]
+ !self.game.data.tile_placeable_items.contains_key(&t.kind)
&& t.item.is_none()
&& self.game.data.tile_names[t.kind.0] == name
})
@@ -228,7 +211,7 @@ impl<S: State> Context<'_, S> {
self.game
.tiles
.iter()
- .find(|(_, t)| self.game.data.tile_interact[t.kind.0] && t.item.is_none())
+ .find(|(_, t)| !self.game.data.tile_placeable_items.contains_key(&t.kind)) // TODO filter by placable item
.map(|(p, _)| *p)
}
pub fn clear_tile(&mut self, pos: IVec2) -> LogicRes {
@@ -378,7 +361,7 @@ impl Context<'_, Simple> {
Err(())
}
pub fn update(&mut self) -> LogicRes {
- if let Some((item, table)) = self.find_demand() {
+ if let Some((item, table, _)) = self.find_demands().pop() {
if self.game.data.item_name(item) == "unknown-order" {
self.interact_with(table, 0.)?;
} else {
diff --git a/server/bot/src/algos/waiter.rs b/server/bot/src/algos/waiter.rs
index ab0402e6..bde87f94 100644
--- a/server/bot/src/algos/waiter.rs
+++ b/server/bot/src/algos/waiter.rs
@@ -102,7 +102,7 @@ impl Context<'_, Waiter> {
if let Some(pos) = self.find_occupied_table_or_floor() {
self.assert_tile_is_clear(pos)?;
}
- let mut dems = self.find_demands_with_table();
+ let mut dems = self.find_demands();
dems.sort_by_key(|(_, _, x)| (*x * 1000.) as i32);
for (item, table, _) in dems {
if self.game.data.item_name(item) == "unknown-order" {
diff --git a/server/src/data/index.rs b/server/client-lib/src/gamedata_index.rs
index a9ffbb81..8aa5e4af 100644
--- a/server/src/data/index.rs
+++ b/server/client-lib/src/gamedata_index.rs
@@ -15,17 +15,23 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-use hurrycurry_protocol::{Gamedata, ItemIndex, Recipe, RecipeIndex};
+use hurrycurry_protocol::{Gamedata, ItemIndex, Recipe, RecipeIndex, TileIndex};
use std::collections::HashMap;
#[derive(Debug, Default)]
pub struct GamedataIndex {
+ pub tile_collide: Vec<bool>,
pub recipe_passive_by_input: HashMap<ItemIndex, Vec<RecipeIndex>>,
}
impl GamedataIndex {
pub fn update(&mut self, data: &Gamedata) {
self.recipe_passive_by_input.clear();
+ self.tile_collide.clear();
+
+ for tile in (0..data.tile_names.len()).map(TileIndex) {
+ self.tile_collide.push(!data.tile_walkable.contains(&tile));
+ }
for (ri, r) in data.recipes() {
if let Recipe::Passive { input, .. } = r {
diff --git a/server/client-lib/src/lib.rs b/server/client-lib/src/lib.rs
index 23394cc4..76ef1e77 100644
--- a/server/client-lib/src/lib.rs
+++ b/server/client-lib/src/lib.rs
@@ -16,6 +16,7 @@
*/
#![feature(let_chains)]
+pub mod gamedata_index;
pub mod network;
pub mod spatial_index;
@@ -30,6 +31,8 @@ use std::{
time::Instant,
};
+use crate::gamedata_index::GamedataIndex;
+
#[derive(Debug, PartialEq)]
pub struct Involvement {
pub position: f32,
@@ -64,6 +67,7 @@ pub struct Player {
#[derive(Default)]
pub struct Game {
pub data: Arc<Gamedata>,
+ pub data_index: GamedataIndex,
pub tiles: HashMap<IVec2, Tile>,
pub walkable: HashSet<IVec2>,
pub players: HashMap<PlayerID, Player>,
@@ -161,7 +165,7 @@ impl Game {
} => {
if let Some(kind) = kind {
self.tiles.insert(tile, Tile { kind, item: None });
- if self.data.tile_collide[kind.0] {
+ if self.data_index.tile_collide[kind.0] {
self.walkable.remove(&tile);
} else {
self.walkable.insert(tile);
diff --git a/server/editor/src/main.rs b/server/editor/src/main.rs
index 506d79cf..5fb8f1a4 100644
--- a/server/editor/src/main.rs
+++ b/server/editor/src/main.rs
@@ -13,7 +13,7 @@ use hurrycurry_protocol::{
use log::{debug, info, warn};
use save::{export_state, import_state};
use std::{
- collections::{HashMap, HashSet},
+ collections::{BTreeMap, HashMap, HashSet},
fs::{File, read_to_string},
io::Write,
net::SocketAddr,
@@ -143,8 +143,8 @@ async fn handle_conn(
});
state.out.push(PacketC::Data {
data: Gamedata {
- tile_collide: TILES.iter().map(|_| false).collect(),
- tile_interact: TILES.iter().map(|_| true).collect(),
+ tile_walkable: (0..TILES.len()).map(TileIndex).collect(),
+ tile_placeable_items: BTreeMap::new(),
tile_names: TILES.iter().map(|(name, _, _)| name.to_string()).collect(),
current_map: "editor".to_owned(),
..Default::default()
diff --git a/server/protocol/src/helpers.rs b/server/protocol/src/helpers.rs
index b5c0e82b..92668df4 100644
--- a/server/protocol/src/helpers.rs
+++ b/server/protocol/src/helpers.rs
@@ -5,12 +5,6 @@ impl Gamedata {
pub fn tile_name(&self, index: TileIndex) -> &str {
&self.tile_names[index.0]
}
- pub fn is_tile_colliding(&self, index: TileIndex) -> bool {
- self.tile_collide[index.0]
- }
- pub fn is_tile_interactable(&self, index: TileIndex) -> bool {
- self.tile_interact[index.0]
- }
pub fn item_name(&self, index: ItemIndex) -> &str {
&self.item_names[index.0]
}
diff --git a/server/protocol/src/lib.rs b/server/protocol/src/lib.rs
index c32bff39..00ef62d7 100644
--- a/server/protocol/src/lib.rs
+++ b/server/protocol/src/lib.rs
@@ -17,7 +17,10 @@
*/
use glam::{IVec2, Vec2};
use serde::{Deserialize, Deserializer, Serialize};
-use std::{collections::HashSet, sync::LazyLock};
+use std::{
+ collections::{BTreeMap, HashSet},
+ sync::LazyLock,
+};
pub use glam;
@@ -76,14 +79,14 @@ pub struct Demand {
pub points: i64,
}
-#[derive(Debug, Clone, Serialize, Deserialize, Default)]
+#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[rustfmt::skip]
pub struct Gamedata {
pub current_map: String,
pub item_names: Vec<String>,
pub tile_names: Vec<String>,
- pub tile_collide: Vec<bool>,
- pub tile_interact: Vec<bool>,
+ pub tile_walkable: HashSet<TileIndex>,
+ pub tile_placeable_items: BTreeMap<TileIndex, HashSet<ItemIndex>>,
pub maps: Vec<(String, MapMetadata)>,
pub bot_algos: Vec<String>,
pub recipes: Vec<Recipe>,
diff --git a/server/registry/src/lobby.rs b/server/registry/src/lobby.rs
index 36ef9e44..b951f0db 100644
--- a/server/registry/src/lobby.rs
+++ b/server/registry/src/lobby.rs
@@ -9,7 +9,7 @@ use hurrycurry_protocol::{
use log::{error, info, warn};
use rocket::futures::{SinkExt, StreamExt};
use std::{
- collections::{HashMap, HashSet},
+ collections::{BTreeMap, HashMap, HashSet},
f32::consts::PI,
net::SocketAddr,
sync::Arc,
@@ -75,8 +75,8 @@ async fn handle_conn(sock: TcpStream, addr: SocketAddr, entries: &[Entry]) -> Re
});
out.push(PacketC::Data {
data: Gamedata {
- tile_collide: TILES.iter().map(|(_, c)| *c).collect(),
- tile_interact: TILES.iter().map(|_| false).collect(),
+ tile_walkable: (0..TILES.len()).map(TileIndex).collect(),
+ tile_placeable_items: BTreeMap::new(),
tile_names: TILES.iter().map(|(s, _)| s.to_string()).collect(),
current_map: "registry".to_owned(),
..Default::default()
diff --git a/server/src/data/mod.rs b/server/src/data/mod.rs
index d19b32a3..e5cd4552 100644
--- a/server/src/data/mod.rs
+++ b/server/src/data/mod.rs
@@ -16,7 +16,6 @@
*/
pub mod demands;
-pub mod index;
use crate::entity::{construct_entity, Entities, EntityDecl};
use anyhow::{anyhow, bail, Context, Result};
@@ -29,7 +28,7 @@ use hurrycurry_protocol::{
};
use serde::{Deserialize, Serialize};
use std::{
- collections::{HashMap, HashSet},
+ collections::{BTreeMap, HashMap, HashSet},
fs::{read_to_string, File},
path::PathBuf,
str::FromStr,
@@ -307,16 +306,24 @@ pub fn build_data(
maps.sort_unstable_by_key(|(_, m)| m.difficulty);
maps.sort_by_key(|(_, m)| m.players);
+ let mut tile_placeable_items = BTreeMap::new();
+ for tile_name in map_in.collider.iter().chain(map_in.walkable.iter()) {
+ let tile = reg.register_tile(tile_name.to_string());
+ let whitelist = recipes
+ .iter()
+ .filter(|r| r.tile() == Some(tile))
+ .flat_map(|e| e.inputs())
+ .collect();
+ tile_placeable_items.insert(tile, whitelist);
+ }
+ let tile_walkable = map_in
+ .walkable
+ .into_iter()
+ .map(|name| reg.register_tile(name))
+ .collect();
+
let item_names = reg.items.into_inner().unwrap();
let tile_names = reg.tiles.into_inner().unwrap();
- let tile_collide = tile_names
- .iter()
- .map(|i| !map_in.walkable.contains(i))
- .collect();
- let tile_interact = tile_names
- .iter()
- .map(|i| !map_in.collider.contains(i) && !map_in.walkable.contains(i))
- .collect();
let default_timer = if map_name.ends_with("lobby") {
None
@@ -329,8 +336,8 @@ pub fn build_data(
bot_algos,
current_map: map_name,
maps,
- tile_collide,
- tile_interact,
+ tile_walkable,
+ tile_placeable_items,
recipes,
item_names,
demands,
diff --git a/server/src/interaction.rs b/server/src/interaction.rs
index 624d9893..8f591db1 100644
--- a/server/src/interaction.rs
+++ b/server/src/interaction.rs
@@ -15,8 +15,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-use crate::data::index::GamedataIndex;
-use hurrycurry_client_lib::{Involvement, Item};
+use hurrycurry_client_lib::{gamedata_index::GamedataIndex, Involvement, Item};
use hurrycurry_protocol::{Gamedata, ItemLocation, PacketC, PlayerID, Recipe, Score, TileIndex};
use log::info;
use std::collections::VecDeque;
@@ -36,11 +35,11 @@ pub fn interact(
automated: bool,
packet_out: &mut VecDeque<PacketC>,
) {
- let interactable = automated
- || tile
- .map(|tile| data.is_tile_interactable(tile))
- .unwrap_or(true);
- if interactable && other.is_none() {
+ // let interactable = automated
+ // || tile
+ // .map(|tile| data.is_tile_interactable(tile))
+ // .unwrap_or(true);
+ if other.is_none() {
if let Some(item) = this {
if let Some(active) = &mut item.active {
let recipe = &data.recipe(active.recipe);
@@ -85,96 +84,102 @@ pub fn interact(
if !edge {
return;
}
- if interactable {
- for (ri, recipe) in data.recipes() {
- if !recipe.supports_tile(tile) {
- continue;
- }
- match recipe {
- Recipe::Active { input, speed, .. } => {
- if other.is_none() {
- if let Some(item) = this {
- if item.kind == *input && item.active.is_none() {
- info!("start active recipe {ri:?}");
- item.active = Some(Involvement {
- player,
- recipe: ri,
- speed: *speed,
- position: 0.,
- warn: false,
- });
- }
+ for (ri, recipe) in data.recipes() {
+ if !recipe.supports_tile(tile) {
+ continue;
+ }
+ match recipe {
+ Recipe::Active { input, speed, .. } => {
+ if other.is_none() {
+ if let Some(item) = this {
+ if item.kind == *input && item.active.is_none() {
+ info!("start active recipe {ri:?}");
+ item.active = Some(Involvement {
+ player,
+ recipe: ri,
+ speed: *speed,
+ position: 0.,
+ warn: false,
+ });
}
}
- if this.is_none() {
- if let Some(item) = &other {
- if item.kind == *input && item.active.is_none() {
- let mut item = other.take().unwrap();
- info!("start active recipe {ri:?}");
- item.active = Some(Involvement {
- player,
- recipe: ri,
- speed: *speed,
- position: 0.,
- warn: false,
- });
- *this = Some(item);
- score.active_recipes += 1;
- packet_out.push_back(PacketC::MoveItem {
- from: other_loc,
- to: this_loc,
- });
- packet_out.push_back(PacketC::SetProgress {
- player,
- item: this_loc,
- position: 0.,
- speed: *speed,
- warn: false,
- });
- return;
- }
+ }
+ if this.is_none() {
+ if let Some(item) = &other {
+ if item.kind == *input && item.active.is_none() {
+ let mut item = other.take().unwrap();
+ info!("start active recipe {ri:?}");
+ item.active = Some(Involvement {
+ player,
+ recipe: ri,
+ speed: *speed,
+ position: 0.,
+ warn: false,
+ });
+ *this = Some(item);
+ score.active_recipes += 1;
+ packet_out.push_back(PacketC::MoveItem {
+ from: other_loc,
+ to: this_loc,
+ });
+ packet_out.push_back(PacketC::SetProgress {
+ player,
+ item: this_loc,
+ position: 0.,
+ speed: *speed,
+ warn: false,
+ });
+ return;
}
}
}
- Recipe::Instant {
- inputs,
- outputs,
- points: pd,
- ..
- } => {
- let on_tile = this.as_ref().map(|i| i.kind);
- let in_hand = other.as_ref().map(|i| i.kind);
- let ok = inputs[0] == on_tile && inputs[1] == in_hand;
- let ok_rev = inputs[1] == on_tile && inputs[0] == in_hand;
- if ok || ok_rev {
- info!("instant recipe {ri:?} reversed={ok_rev}");
- let ok_rev = ok_rev as usize;
- let this_had_item = this.is_some();
- let other_had_item = other.is_some();
- *other = outputs[1 - ok_rev].map(|kind| Item { kind, active: None });
- *this = outputs[ok_rev].map(|kind| Item { kind, active: None });
- score.points += pd;
- score.instant_recipes += 1;
- *score_changed = true;
- produce(
- this_had_item,
- other_had_item,
- this,
- this_loc,
- other,
- other_loc,
- score_changed,
- packet_out,
- );
- return;
- }
+ }
+ Recipe::Instant {
+ inputs,
+ outputs,
+ points: pd,
+ ..
+ } => {
+ let on_tile = this.as_ref().map(|i| i.kind);
+ let in_hand = other.as_ref().map(|i| i.kind);
+ let ok = inputs[0] == on_tile && inputs[1] == in_hand;
+ let ok_rev = inputs[1] == on_tile && inputs[0] == in_hand;
+ if ok || ok_rev {
+ info!("instant recipe {ri:?} reversed={ok_rev}");
+ let ok_rev = ok_rev as usize;
+ let this_had_item = this.is_some();
+ let other_had_item = other.is_some();
+ *other = outputs[1 - ok_rev].map(|kind| Item { kind, active: None });
+ *this = outputs[ok_rev].map(|kind| Item { kind, active: None });
+ score.points += pd;
+ score.instant_recipes += 1;
+ *score_changed = true;
+ produce(
+ this_had_item,
+ other_had_item,
+ this,
+ this_loc,
+ other,
+ other_loc,
+ score_changed,
+ packet_out,
+ );
+ return;
}
- _ => (),
}
+ _ => (),
}
}
- if interactable && this.is_none() {
+ let can_place = tile.map_or(true, |tile| {
+ other.as_ref().map_or(false, |other| {
+ data.tile_placeable_items
+ .get(&tile)
+ .map_or(true, |pl| pl.contains(&other.kind))
+ })
+ });
+
+ if can_place && this.is_none() {
if let Some(item) = other.take() {
*this = Some(item);
packet_out.push_back(PacketC::MoveItem {
diff --git a/server/src/server.rs b/server/src/server.rs
index 57b26122..14244394 100644
--- a/server/src/server.rs
+++ b/server/src/server.rs
@@ -16,7 +16,7 @@
*/
use crate::{
- data::{index::GamedataIndex, DataIndex, Serverdata},
+ data::{DataIndex, Serverdata},
entity::{Entities, EntityContext},
interaction::{interact, tick_slot},
message::TrError,
@@ -24,7 +24,7 @@ use crate::{
tre, ConnectionID,
};
use anyhow::{Context, Result};
-use hurrycurry_client_lib::{Game, Involvement, Item, Player, Tile};
+use hurrycurry_client_lib::{gamedata_index::GamedataIndex, Game, Involvement, Item, Player, Tile};
use hurrycurry_protocol::{
glam::{IVec2, Vec2},
movement::MovementBase,
@@ -137,6 +137,7 @@ impl GameServerExt for Game {
self.lobby = gamedata.current_map == "lobby";
self.data = gamedata.into();
+ self.data_index.update(&self.data);
self.score = Score {
time_remaining: timer.map(|dur| dur.as_secs_f64()).unwrap_or(0.),
..Default::default()
@@ -154,7 +155,7 @@ impl GameServerExt for Game {
}),
},
);
- if !self.data.tile_collide[tile.0] {
+ if !self.data_index.tile_collide[tile.0] {
self.walkable.insert(p);
}
}
@@ -304,7 +305,7 @@ impl GameServerExt for Game {
) {
if let Some(kind) = kind {
self.tiles.insert(tile, Tile::from(kind));
- if self.data.is_tile_colliding(kind) {
+ if self.data_index.tile_collide[kind.0] {
self.walkable.remove(&tile);
} else {
self.walkable.insert(tile);
@@ -547,7 +548,15 @@ impl Server {
player.interacting = if edge { Some((pos, hand)) } else { None };
- let other_pid = if !self.game.data.is_tile_interactable(tile.kind) {
+ // Dont try interacting with player it tile is interactable
+ let other_pid = if !self
+ .game
+ .data
+ .tile_placeable_items
+ .get(&tile.kind)
+ .map_or(false, |p| !p.is_empty())
+ // TODO check for hand item
+ {
self.game
.players
.iter()