Compare commits

..

4 Commits

Author SHA1 Message Date
f572aaf958
feat: add console-subscriber feature 2025-02-27 20:22:53 -05:00
c1e4530358
feat(client): add more client information fields 2025-02-27 20:22:53 -05:00
31ccd370eb
chore(deps): downgrade some dependencies
Azalea seems to have stopped working properly after the update; some
events are not being received.

This partially backs out commit 5533d852b2f7f939d6927fd3baf8d2642924c653.
2025-02-27 19:21:32 -05:00
3e341c1f04
chore: improve compile times with -Zshare-generics=y 2025-02-27 18:00:43 -05:00
5 changed files with 410 additions and 101 deletions

View File

@ -1,3 +1,3 @@
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-Clink-arg=-fuse-ld=mold"]
rustflags = ["-Clink-arg=-fuse-ld=mold", "-Zshare-generics=y"]

446
Cargo.lock generated
View File

@ -178,6 +178,28 @@ dependencies = [
"syn",
]
[[package]]
name = "async-stream"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476"
dependencies = [
"async-stream-impl",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-stream-impl"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "async-task"
version = "4.7.1"
@ -195,16 +217,69 @@ dependencies = [
"syn",
]
[[package]]
name = "atomic-waker"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
[[package]]
name = "autocfg"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "axum"
version = "0.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f"
dependencies = [
"async-trait",
"axum-core",
"bytes",
"futures-util",
"http",
"http-body",
"http-body-util",
"itoa",
"matchit",
"memchr",
"mime",
"percent-encoding",
"pin-project-lite",
"rustversion",
"serde",
"sync_wrapper",
"tower 0.5.2",
"tower-layer",
"tower-service",
]
[[package]]
name = "axum-core"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199"
dependencies = [
"async-trait",
"bytes",
"futures-util",
"http",
"http-body",
"http-body-util",
"mime",
"pin-project-lite",
"rustversion",
"sync_wrapper",
"tower-layer",
"tower-service",
]
[[package]]
name = "azalea"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-auth",
"azalea-block",
@ -226,7 +301,7 @@ dependencies = [
"derive_more 2.0.1",
"futures",
"futures-lite",
"indexmap",
"indexmap 2.7.1",
"nohash-hasher",
"num-format",
"num-traits",
@ -242,11 +317,11 @@ dependencies = [
[[package]]
name = "azalea-auth"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-buf",
"azalea-crypto",
"base64",
"base64 0.22.1",
"chrono",
"md-5",
"reqwest",
@ -262,7 +337,7 @@ dependencies = [
[[package]]
name = "azalea-block"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-block-macros",
"azalea-buf",
@ -272,7 +347,7 @@ dependencies = [
[[package]]
name = "azalea-block-macros"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"proc-macro2",
"quote",
@ -282,7 +357,7 @@ dependencies = [
[[package]]
name = "azalea-brigadier"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-buf",
"azalea-chat",
@ -292,7 +367,7 @@ dependencies = [
[[package]]
name = "azalea-buf"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-buf-macros",
"byteorder",
@ -306,7 +381,7 @@ dependencies = [
[[package]]
name = "azalea-buf-macros"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"proc-macro2",
"quote",
@ -316,7 +391,7 @@ dependencies = [
[[package]]
name = "azalea-chat"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-buf",
"azalea-language",
@ -330,7 +405,7 @@ dependencies = [
[[package]]
name = "azalea-client"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-auth",
"azalea-block",
@ -352,7 +427,6 @@ dependencies = [
"derive_more 2.0.1",
"minecraft_folder_path",
"parking_lot",
"paste",
"regex",
"reqwest",
"simdnbt",
@ -365,13 +439,13 @@ dependencies = [
[[package]]
name = "azalea-core"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-buf",
"azalea-chat",
"azalea-registry",
"bevy_ecs",
"indexmap",
"indexmap 2.7.1",
"nohash-hasher",
"num-traits",
"serde",
@ -382,7 +456,7 @@ dependencies = [
[[package]]
name = "azalea-crypto"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"aes",
"azalea-buf",
@ -399,7 +473,7 @@ dependencies = [
[[package]]
name = "azalea-entity"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-block",
"azalea-buf",
@ -423,14 +497,14 @@ dependencies = [
[[package]]
name = "azalea-inventory"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-buf",
"azalea-chat",
"azalea-core",
"azalea-inventory-macros",
"azalea-registry",
"indexmap",
"indexmap 2.7.1",
"simdnbt",
"tracing",
"uuid",
@ -439,7 +513,7 @@ dependencies = [
[[package]]
name = "azalea-inventory-macros"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"proc-macro2",
"quote",
@ -449,7 +523,7 @@ dependencies = [
[[package]]
name = "azalea-language"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"compact_str",
"serde",
@ -459,7 +533,7 @@ dependencies = [
[[package]]
name = "azalea-physics"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-block",
"azalea-core",
@ -476,7 +550,7 @@ dependencies = [
[[package]]
name = "azalea-protocol"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"async-recursion",
"azalea-auth",
@ -510,7 +584,7 @@ dependencies = [
[[package]]
name = "azalea-protocol-macros"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"proc-macro2",
"quote",
@ -520,7 +594,7 @@ dependencies = [
[[package]]
name = "azalea-registry"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-buf",
"azalea-registry-macros",
@ -531,7 +605,7 @@ dependencies = [
[[package]]
name = "azalea-registry-macros"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"quote",
"syn",
@ -540,7 +614,7 @@ dependencies = [
[[package]]
name = "azalea-world"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea.git#72d87349feaf0240848b735be94448836e0bf4e5"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-block",
"azalea-buf",
@ -572,6 +646,12 @@ dependencies = [
"windows-targets",
]
[[package]]
name = "base64"
version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
[[package]]
name = "base64"
version = "0.22.1"
@ -586,9 +666,9 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
[[package]]
name = "bevy_app"
version = "0.15.3"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0ac033a388b8699d241499a43783a09e6a3bab2430f1297c6bd4974095efb3f"
checksum = "47983196daf9290ac97023de67d9364182c4a9a88ce400039e2d79aaf342dcb2"
dependencies = [
"bevy_derive",
"bevy_ecs",
@ -605,9 +685,9 @@ dependencies = [
[[package]]
name = "bevy_derive"
version = "0.15.3"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57d94761ce947b0a2402fd949fe1e7a5b1535293130ba4cd9893be6295d4680a"
checksum = "fa901a443b9ee433823f0d1a4e6db78440ff27572a98e7fa7f2a614bf8d6e475"
dependencies = [
"bevy_macro_utils",
"quote",
@ -616,9 +696,9 @@ dependencies = [
[[package]]
name = "bevy_ecs"
version = "0.15.3"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1597106cc01e62e6217ccb662e0748b2ce330893f27c7dc17bac33e0bb99bca9"
checksum = "40e6d5ad061f750f710a9a4e2f9e7d65f86c0061fc9ffcf3a430b3c003bc0088"
dependencies = [
"bevy_ecs_macros",
"bevy_ptr",
@ -637,9 +717,9 @@ dependencies = [
[[package]]
name = "bevy_ecs_macros"
version = "0.15.3"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f453adf07712b39826bc5845e5b0887ce03204ee8359bbe6b40a9afda60564a1"
checksum = "fea80917f2d11e8928d0b7cd41efa55b814355e6a3544a1bf68e6b73871d332c"
dependencies = [
"bevy_macro_utils",
"proc-macro2",
@ -649,9 +729,9 @@ dependencies = [
[[package]]
name = "bevy_log"
version = "0.15.3"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b381a22e01f24af51536ef1eace94298dd555d06ffcf368125d16317f5f179cb"
checksum = "8530cc17503ccfe86c8496136fca222bfa389c9cc70267be7d377d0f6621aa29"
dependencies = [
"android_log-sys",
"bevy_app",
@ -665,9 +745,9 @@ dependencies = [
[[package]]
name = "bevy_macro_utils"
version = "0.15.3"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8bb6ded1ddc124ea214f6a2140e47a78d1fe79b0638dad39419cdeef2e1133f1"
checksum = "090371a2cd85574989febff6063a21d1fbbc2939e80f00fe075f62aa8e616136"
dependencies = [
"proc-macro2",
"quote",
@ -677,15 +757,15 @@ dependencies = [
[[package]]
name = "bevy_ptr"
version = "0.15.3"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89fe0b0b919146939481a3a7c38864face2c6d0fd2c73ab3d430dc693ecd9b11"
checksum = "4da2111eefa2000ea8c9dc1beee2eb7283b29b5ef90a29fe43c748df549f84ad"
[[package]]
name = "bevy_reflect"
version = "0.15.3"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ddbca0a39e88eff2c301dc794ee9d73a53f4b08d47b2c9b5a6aac182fae6217"
checksum = "82af24a68fd8feff476d9672ff34d220d3f45e95ef2f2324e7cb674614d18138"
dependencies = [
"assert_type_match",
"bevy_ptr",
@ -702,9 +782,9 @@ dependencies = [
[[package]]
name = "bevy_reflect_derive"
version = "0.15.3"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d62affb769db17d34ad0b75ff27eca94867e2acc8ea350c5eca97d102bd98709"
checksum = "8369e6e779ab3540f9dcd93d062139f62551b3d2fe1ab451c6ddf74757e22ccd"
dependencies = [
"bevy_macro_utils",
"proc-macro2",
@ -715,9 +795,9 @@ dependencies = [
[[package]]
name = "bevy_tasks"
version = "0.15.3"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "028630ddc355563bd567df1076db3515858aa26715ddf7467d2086f9b40e5ab1"
checksum = "53e085e93374b8dd2559968bcc1bc66d059387ef3128e59e9af92dcde03f10b7"
dependencies = [
"async-channel",
"async-executor",
@ -730,9 +810,9 @@ dependencies = [
[[package]]
name = "bevy_time"
version = "0.15.3"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b2051ec56301b994f7c182a2a6eb1490038149ad46d95eee715e1a922acdfd9"
checksum = "c02b14d56c04a372725dacc656e2e5f134ff239e72cd73431a065b32b296db31"
dependencies = [
"bevy_app",
"bevy_ecs",
@ -743,9 +823,9 @@ dependencies = [
[[package]]
name = "bevy_utils"
version = "0.15.3"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63c2174d43a0de99f863c98a472370047a2bfa7d1e5cec8d9d647fb500905d9d"
checksum = "2993cac374b3f88cfaf59506c71f8e3e7ad8b4961f4e9864bc76e1c9e1e4400c"
dependencies = [
"ahash",
"bevy_utils_proc_macros",
@ -758,9 +838,9 @@ dependencies = [
[[package]]
name = "bevy_utils_proc_macros"
version = "0.15.3"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94847541f6dd2e28f54a9c2b0e857da5f2631e2201ebc25ce68781cdcb721391"
checksum = "2606f79dfe359a88e2a59bb6cd632cd42e9d4bcd250ac8bc3a4e7657e82f4f39"
dependencies = [
"proc-macro2",
"quote",
@ -880,9 +960,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "chrono"
version = "0.4.40"
version = "0.4.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c"
checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825"
dependencies = [
"num-traits",
"serde",
@ -911,9 +991,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.5.31"
version = "4.5.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767"
checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d"
dependencies = [
"clap_builder",
"clap_derive",
@ -921,9 +1001,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.31"
version = "4.5.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863"
checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c"
dependencies = [
"anstream",
"anstyle",
@ -979,6 +1059,45 @@ dependencies = [
"crossbeam-utils",
]
[[package]]
name = "console-api"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8030735ecb0d128428b64cd379809817e620a40e5001c54465b99ec5feec2857"
dependencies = [
"futures-core",
"prost",
"prost-types",
"tonic",
"tracing-core",
]
[[package]]
name = "console-subscriber"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6539aa9c6a4cd31f4b1c040f860a1eac9aa80e7df6b05d506a6e7179936d6a01"
dependencies = [
"console-api",
"crossbeam-channel",
"crossbeam-utils",
"futures-task",
"hdrhistogram",
"humantime",
"hyper-util",
"prost",
"prost-types",
"serde",
"serde_json",
"thread_local",
"tokio",
"tokio-stream",
"tonic",
"tracing",
"tracing-core",
"tracing-subscriber",
]
[[package]]
name = "console_error_panic_hook"
version = "0.1.7"
@ -1168,9 +1287,9 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
[[package]]
name = "either"
version = "1.14.0"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d"
checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
[[package]]
name = "enum-as-inner"
@ -1209,6 +1328,7 @@ dependencies = [
"bevy_app",
"bevy_log",
"clap",
"console-subscriber",
"futures",
"futures-locks",
"http-body-util",
@ -1260,9 +1380,9 @@ checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99"
[[package]]
name = "flate2"
version = "1.1.0"
version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc"
checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c"
dependencies = [
"crc32fast",
"miniz_oxide",
@ -1431,6 +1551,31 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
[[package]]
name = "h2"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2"
dependencies = [
"atomic-waker",
"bytes",
"fnv",
"futures-core",
"futures-sink",
"http",
"indexmap 2.7.1",
"slab",
"tokio",
"tokio-util",
"tracing",
]
[[package]]
name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "hashbrown"
version = "0.14.5"
@ -1448,6 +1593,19 @@ version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
[[package]]
name = "hdrhistogram"
version = "7.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d"
dependencies = [
"base64 0.21.7",
"byteorder",
"flate2",
"nom",
"num-traits",
]
[[package]]
name = "heck"
version = "0.5.0"
@ -1543,6 +1701,12 @@ version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
[[package]]
name = "humantime"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "hyper"
version = "1.6.0"
@ -1552,6 +1716,7 @@ dependencies = [
"bytes",
"futures-channel",
"futures-util",
"h2",
"http",
"http-body",
"httparse",
@ -1581,6 +1746,19 @@ dependencies = [
"webpki-roots",
]
[[package]]
name = "hyper-timeout"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0"
dependencies = [
"hyper",
"hyper-util",
"pin-project-lite",
"tokio",
"tower-service",
]
[[package]]
name = "hyper-util"
version = "0.1.10"
@ -1739,6 +1917,16 @@ dependencies = [
"icu_properties",
]
[[package]]
name = "indexmap"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown 0.12.3",
]
[[package]]
name = "indexmap"
version = "2.7.1"
@ -1806,9 +1994,9 @@ dependencies = [
[[package]]
name = "libc"
version = "0.2.170"
version = "0.2.169"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828"
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
[[package]]
name = "libloading"
@ -1834,9 +2022,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]]
name = "litemap"
version = "0.7.5"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856"
checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104"
[[package]]
name = "lock_api"
@ -1872,6 +2060,12 @@ dependencies = [
"regex-automata 0.1.10",
]
[[package]]
name = "matchit"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
[[package]]
name = "md-5"
version = "0.10.6"
@ -2147,12 +2341,6 @@ dependencies = [
"windows-targets",
]
[[package]]
name = "paste"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = "pem-rfc7468"
version = "0.7.0"
@ -2175,7 +2363,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db"
dependencies = [
"fixedbitset 0.4.2",
"indexmap",
"indexmap 2.7.1",
]
[[package]]
@ -2265,6 +2453,38 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "prost"
version = "0.13.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5"
dependencies = [
"bytes",
"prost-derive",
]
[[package]]
name = "prost-derive"
version = "0.13.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d"
dependencies = [
"anyhow",
"itertools",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "prost-types"
version = "0.13.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16"
dependencies = [
"prost",
]
[[package]]
name = "quinn"
version = "0.11.6"
@ -2415,7 +2635,7 @@ version = "0.12.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da"
dependencies = [
"base64",
"base64 0.22.1",
"bytes",
"futures-core",
"futures-util",
@ -2442,7 +2662,7 @@ dependencies = [
"sync_wrapper",
"tokio",
"tokio-rustls",
"tower",
"tower 0.5.2",
"tower-service",
"url",
"wasm-bindgen",
@ -2454,9 +2674,9 @@ dependencies = [
[[package]]
name = "ring"
version = "0.17.11"
version = "0.17.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da5349ae27d3887ca812fb375b45a4fbb36d8d12d2df394968cd86e35683fe73"
checksum = "d34b5020fcdea098ef7d95e9f89ec15952123a4a039badd09fabebe9e963e839"
dependencies = [
"cc",
"cfg-if",
@ -2952,6 +3172,7 @@ dependencies = [
"pin-project-lite",
"socket2",
"tokio-macros",
"tracing",
"windows-sys 0.52.0",
]
@ -2976,6 +3197,17 @@ dependencies = [
"tokio",
]
[[package]]
name = "tokio-stream"
version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047"
dependencies = [
"futures-core",
"pin-project-lite",
"tokio",
]
[[package]]
name = "tokio-util"
version = "0.7.13"
@ -3001,11 +3233,61 @@ version = "0.22.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474"
dependencies = [
"indexmap",
"indexmap 2.7.1",
"toml_datetime",
"winnow",
]
[[package]]
name = "tonic"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52"
dependencies = [
"async-stream",
"async-trait",
"axum",
"base64 0.22.1",
"bytes",
"h2",
"http",
"http-body",
"http-body-util",
"hyper",
"hyper-timeout",
"hyper-util",
"percent-encoding",
"pin-project",
"prost",
"socket2",
"tokio",
"tokio-stream",
"tower 0.4.13",
"tower-layer",
"tower-service",
"tracing",
]
[[package]]
name = "tower"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
dependencies = [
"futures-core",
"futures-util",
"indexmap 1.9.3",
"pin-project",
"pin-project-lite",
"rand",
"slab",
"tokio",
"tokio-util",
"tower-layer",
"tower-service",
"tracing",
]
[[package]]
name = "tower"
version = "0.5.2"
@ -3525,18 +3807,18 @@ dependencies = [
[[package]]
name = "zerofrom"
version = "0.1.6"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5"
checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e"
dependencies = [
"zerofrom-derive",
]
[[package]]
name = "zerofrom-derive"
version = "0.1.6"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808"
dependencies = [
"proc-macro2",
"quote",

View File

@ -20,6 +20,7 @@ azalea = { git = "https://github.com/azalea-rs/azalea.git" }
bevy_app = "0"
bevy_log = "0"
clap = { version = "4", features = ["derive"] }
console-subscriber = { version = "0", optional = true }
futures = "0"
futures-locks = "0"
http-body-util = "0"
@ -28,3 +29,6 @@ hyper-util = "0"
log = { version = "0" }
mlua = { version = "0", features = ["async", "luajit", "send"] }
tokio = { version = "1", features = ["macros"] }
[features]
console-subscriber = ["dep:console-subscriber"]

View File

@ -2,6 +2,7 @@ use super::Client;
use azalea::{
ClientInformation,
entity::metadata::{AirSupply, Score},
protocol::common::client_information::ModelCustomization,
};
use log::error;
use mlua::{Lua, Result, Table, UserDataRef};
@ -30,11 +31,26 @@ pub fn score(_lua: &Lua, client: &Client) -> Result<i32> {
pub async fn set_client_information(
_lua: Lua,
client: UserDataRef<Client>,
client_information: Table,
ci: Table,
) -> Result<()> {
let model_customization = if let Some(mc) = ci.get::<Option<Table>>("model_customization")? {
ModelCustomization {
cape: mc.get("cape")?,
jacket: mc.get("jacket")?,
left_sleeve: mc.get("left_sleeve")?,
right_sleeve: mc.get("right_sleeve")?,
left_pants: mc.get("left_pants")?,
right_pants: mc.get("right_pants")?,
hat: mc.get("hat")?,
}
} else {
ModelCustomization::default()
};
if let Err(error) = client
.set_client_information(ClientInformation {
view_distance: client_information.get("view_distance")?,
allows_listing: ci.get("allows_listing")?,
model_customization,
view_distance: ci.get("view_distance").unwrap_or(8),
..ClientInformation::default()
})
.await

View File

@ -42,6 +42,9 @@ pub struct State {
#[tokio::main]
async fn main() -> anyhow::Result<()> {
#[cfg(feature = "console-subscriber")]
console_subscriber::init();
let args = arguments::Arguments::parse();
let script_path = args.script.unwrap_or(PathBuf::from(DEFAULT_SCRIPT_PATH));
@ -66,7 +69,10 @@ async fn main() -> anyhow::Result<()> {
let mut commands = CommandDispatcher::new();
register(&mut commands);
let log_plugin = LogPlugin {
let default_plugins = if cfg!(feature = "console-subscriber") {
DefaultPlugins.build().disable::<LogPlugin>()
} else {
DefaultPlugins.set(LogPlugin {
custom_layer: |_| {
env::var("LOG_FILE").ok().map(|log_file| {
layer()
@ -81,9 +87,10 @@ async fn main() -> anyhow::Result<()> {
})
},
..Default::default()
})
};
let Err(error) = ClientBuilder::new_without_plugins()
.add_plugins(DefaultPlugins.set(log_plugin))
.add_plugins(default_plugins)
.add_plugins(DefaultBotPlugins)
.set_handler(events::handle_event)
.set_state(State {