diff --git a/Cargo.lock b/Cargo.lock index 123e7d01b9..8b8bf31649 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -71,6 +71,20 @@ dependencies = [ "winit", ] +[[package]] +name = "acto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c372578ce4215ccf94ec3f3585fbb6a902e47d07b064ff8a55d850ffb5025e" +dependencies = [ + "parking_lot", + "pin-project-lite", + "rustc_version", + "smol_str 0.1.24", + "tokio", + "tracing", +] + [[package]] name = "addr2line" version = "0.24.1" @@ -309,9 +323,9 @@ dependencies = [ [[package]] name = "asn1-rs" -version = "0.5.2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" dependencies = [ "asn1-rs-derive", "asn1-rs-impl", @@ -325,25 +339,25 @@ dependencies = [ [[package]] name = "asn1-rs-derive" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", - "synstructure 0.12.6", + "syn 2.0.77", + "synstructure", ] [[package]] name = "asn1-rs-impl" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.77", ] [[package]] @@ -357,18 +371,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "async-channel" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - [[package]] name = "async-executor" version = "1.13.1" @@ -382,6 +384,17 @@ dependencies = [ "slab", ] +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "async-task" version = "4.7.1" @@ -525,7 +538,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9714af523da4cdf58c42a317e5ed40349708ad954a18533991fd64c8ae0a6f68" dependencies = [ "anyhow", - "async-channel 1.9.0", + "async-channel", "bevy_app", "bevy_diagnostic", "bevy_ecs 0.11.3", @@ -614,7 +627,7 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "266144b36df7e834d5198049e037ecdf2a2310a76ce39ed937d1b0a6a2c4e8c6" dependencies = [ - "async-channel 1.9.0", + "async-channel", "bevy_ecs_macros 0.11.3", "bevy_ptr 0.11.3", "bevy_reflect 0.11.3", @@ -635,7 +648,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7709fbd22f81fb681534cd913c41e1cd18b17143368743281195d7f024b61aea" dependencies = [ - "async-channel 1.9.0", + "async-channel", "bevy_ecs_macros 0.12.1", "bevy_ptr 0.12.1", "bevy_reflect 0.12.1", @@ -902,7 +915,7 @@ dependencies = [ "parking_lot", "serde", "smallvec", - "smol_str", + "smol_str 0.2.2", "thiserror", ] @@ -955,7 +968,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39df4824b760928c27afc7b00fb649c7a63c9d76661ab014ff5c86537ee906cb" dependencies = [ "anyhow", - "async-channel 1.9.0", + "async-channel", "bevy_app", "bevy_asset", "bevy_core", @@ -1061,7 +1074,7 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c73bbb847c83990d3927005090df52f8ac49332e1643d2ad9aac3cd2974e66bf" dependencies = [ - "async-channel 1.9.0", + "async-channel", "async-executor", "async-task", "concurrent-queue", @@ -1075,7 +1088,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4fefa7fe0da8923525f7500e274f1bd60dbd79918a25cf7d0dfa0a6ba15c1cf" dependencies = [ - "async-channel 1.9.0", + "async-channel", "async-executor", "async-task", "concurrent-queue", @@ -1356,7 +1369,7 @@ version = "0.4.0" dependencies = [ "anyhow", "append-only-vec", - "async-channel 1.9.0", + "async-channel", "bevy_tasks 0.11.3", "bones_schema", "bones_utils", @@ -1444,7 +1457,7 @@ name = "bones_framework" version = "0.4.0" dependencies = [ "anyhow", - "async-channel 1.9.0", + "async-channel", "bevy_tasks 0.11.3", "bones_asset", "bones_lib", @@ -1572,7 +1585,7 @@ dependencies = [ name = "bones_scripting" version = "0.4.0" dependencies = [ - "async-channel 1.9.0", + "async-channel", "bevy_tasks 0.11.3", "bones_asset", "bones_lib", @@ -2001,7 +2014,7 @@ dependencies = [ "core-foundation-sys", "coreaudio-rs", "dasp_sample", - "jni", + "jni 0.21.1", "js-sys", "libc", "mach2", @@ -2240,9 +2253,9 @@ dependencies = [ [[package]] name = "der-parser" -version = "8.2.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" dependencies = [ "asn1-rs", "displaydoc", @@ -2275,18 +2288,18 @@ dependencies = [ [[package]] name = "derive_more" -version = "1.0.0-beta.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3249c0372e72f5f93b5c0ca54c0ab76bbf6216b6f718925476fd9bc4ffabb4fe" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" dependencies = [ "derive_more-impl", ] [[package]] name = "derive_more-impl" -version = "1.0.0-beta.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27d919ced7590fc17b5d5a3c63b662e8a7d2324212c4e4dbbed975cafd22d16d" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", @@ -2400,6 +2413,12 @@ dependencies = [ "shared_child", ] +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + [[package]] name = "ecdsa" version = "0.16.9" @@ -2699,27 +2718,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "event-listener" -version = "5.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" -dependencies = [ - "event-listener 5.3.1", - "pin-project-lite", -] - [[package]] name = "extended" version = "0.1.0" @@ -2962,9 +2960,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -2987,9 +2985,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" @@ -3004,9 +3002,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" @@ -3038,9 +3036,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", @@ -3049,15 +3047,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-timer" @@ -3067,9 +3065,9 @@ checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -3113,7 +3111,38 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.77", - "synstructure 0.13.1", + "synstructure", +] + +[[package]] +name = "genawaiter" +version = "0.99.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c86bd0361bcbde39b13475e6e36cb24c329964aa2611be285289d1e4b751c1a0" +dependencies = [ + "futures-core", + "genawaiter-macro", + "genawaiter-proc-macro", + "proc-macro-hack", +] + +[[package]] +name = "genawaiter-macro" +version = "0.99.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b32dfe1fdfc0bbde1f22a5da25355514b5e450c33a6af6770884c8750aedfbc" + +[[package]] +name = "genawaiter-proc-macro" +version = "0.99.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784f84eebc366e15251c4a8c3acee82a6a6f427949776ecb88377362a9621738" +dependencies = [ + "proc-macro-error", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -3491,15 +3520,41 @@ dependencies = [ "url", ] +[[package]] +name = "hickory-proto" +version = "0.25.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8270a1857fb962b9914aafd46a89a187a4e63d0eb4190c327e7c7b8256a2d055" +dependencies = [ + "async-recursion", + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.5.0", + "ipnet", + "once_cell", + "rand", + "thiserror", + "time", + "tinyvec", + "tokio", + "tracing", + "url", +] + [[package]] name = "hickory-resolver" -version = "0.24.1" +version = "0.25.0-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" +checksum = "46c110355b5703070d9e29c344d79818a7cde3de9c27fc35750defea6074b0ad" dependencies = [ "cfg-if", "futures-util", - "hickory-proto", + "hickory-proto 0.25.0-alpha.2", "ipconfig", "lru-cache", "once_cell", @@ -3694,9 +3749,9 @@ dependencies = [ "rustls 0.23.12", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls", "tower-service", - "webpki-roots 0.26.5", + "webpki-roots", ] [[package]] @@ -3941,9 +3996,9 @@ checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "iroh-base" -version = "0.22.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24ddb47e8160fb1d563a6f541c813c2f185423a0ad1c9260a6c76891a2300c26" +checksum = "973c0b3c7851fa2e8e6cf4cb81c9f4cab1373848828fafa43dfe25b123a89ff2" dependencies = [ "aead", "anyhow", @@ -3982,9 +4037,9 @@ dependencies = [ [[package]] name = "iroh-metrics" -version = "0.22.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab017d2786c0b77583371cef016d3e76bdbc7d13b66532023cb7e854f65d15a" +checksum = "02edfa7ca1aa89b0b9793d94671e32b79c97d61e9022f082c5eb2b95b64e90c0" dependencies = [ "anyhow", "erased_set", @@ -4003,12 +4058,11 @@ dependencies = [ [[package]] name = "iroh-net" -version = "0.22.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372fbf01dc303be5427b6ea33b80411b3cfb6443d6389ce1ffc43231f244a51c" +checksum = "329553be056a92eec7802e1c087eed951eec6e60f0f0740491ef16a295be4ca2" dependencies = [ "anyhow", - "async-channel 2.3.1", "backoff", "base64 0.22.1", "bytes", @@ -4020,9 +4074,10 @@ dependencies = [ "futures-lite 2.3.0", "futures-sink", "futures-util", + "genawaiter", "governor", "hex", - "hickory-proto", + "hickory-proto 0.25.0-alpha.2", "hickory-resolver", "hostname", "http 1.1.0", @@ -4047,23 +4102,24 @@ dependencies = [ "pkarr", "postcard", "rand", - "rand_core", "rcgen", "reqwest", "ring", "rtnetlink", - "rustls 0.21.12", - "rustls-webpki 0.101.7", + "rustls 0.23.12", + "rustls-webpki 0.102.7", "serde", "smallvec", "socket2 0.5.7", "strum", "stun-rs", "surge-ping", + "swarm-discovery", "thiserror", "time", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", + "tokio-stream", "tokio-tungstenite", "tokio-tungstenite-wasm", "tokio-util", @@ -4071,7 +4127,7 @@ dependencies = [ "tungstenite", "url", "watchable", - "webpki-roots 0.25.4", + "webpki-roots", "windows 0.51.1", "wmi", "x509-parser", @@ -4080,16 +4136,17 @@ dependencies = [ [[package]] name = "iroh-quinn" -version = "0.10.5" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "906875956feb75d3d41d708ddaffeb11fdb10cd05f23efbcb17600037e411779" +checksum = "4fd590a39a14cfc168efa4d894de5039d65641e62d8da4a80733018ababe3c33" dependencies = [ "bytes", "iroh-quinn-proto", "iroh-quinn-udp", "pin-project-lite", - "rustc-hash 1.1.0", - "rustls 0.21.12", + "rustc-hash 2.0.0", + "rustls 0.23.12", + "socket2 0.5.7", "thiserror", "tokio", "tracing", @@ -4097,16 +4154,16 @@ dependencies = [ [[package]] name = "iroh-quinn-proto" -version = "0.10.8" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6bf92478805e67f2320459285496e1137edf5171411001a0d4d85f9bbafb792" +checksum = "5fd0538ff12efe3d61ea1deda2d7913f4270873a519d43e6995c6e87a1558538" dependencies = [ "bytes", "rand", "ring", - "rustc-hash 1.1.0", - "rustls 0.21.12", - "rustls-native-certs", + "rustc-hash 2.0.0", + "rustls 0.23.12", + "rustls-platform-verifier", "slab", "thiserror", "tinyvec", @@ -4115,15 +4172,15 @@ dependencies = [ [[package]] name = "iroh-quinn-udp" -version = "0.4.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc7915b3a31f08ee0bc02f73f4d61a5d5be146a1081ef7f70622a11627fd314" +checksum = "d0619b59471fdd393ac8a6c047f640171119c1c8b41f7d2927db91776dcdbc5f" dependencies = [ - "bytes", "libc", + "once_cell", "socket2 0.5.7", "tracing", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -4147,6 +4204,20 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + [[package]] name = "jni" version = "0.21.1" @@ -4432,6 +4503,26 @@ dependencies = [ "libc", ] +[[package]] +name = "mainline" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b751ffb57303217bcae8f490eee6044a5b40eadf6ca05ff476cad37e7b7970d" +dependencies = [ + "bytes", + "crc", + "ed25519-dalek", + "flume", + "lru", + "rand", + "serde", + "serde_bencode", + "serde_bytes", + "sha1_smol", + "thiserror", + "tracing", +] + [[package]] name = "malloc_buf" version = "0.0.6" @@ -5159,7 +5250,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8b61bebd49e5d43f5f8cc7ee2891c16e0f41ec7954d36bcb6c14c5e0de867fb" dependencies = [ - "jni", + "jni 0.21.1", "ndk 0.8.0", "ndk-context", "num-derive", @@ -5178,9 +5269,9 @@ dependencies = [ [[package]] name = "oid-registry" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9" dependencies = [ "asn1-rs", ] @@ -5536,11 +5627,13 @@ checksum = "7945a08031b7e14de57e8385cea3bcc7e10a88701595dc11d82551ba07bae13e" dependencies = [ "bytes", "document-features", + "dyn-clone", "ed25519-dalek", "flume", "futures", "js-sys", "lru", + "mainline", "self_cell 1.0.4", "simple-dns", "thiserror", @@ -5788,6 +5881,38 @@ dependencies = [ "toml_edit 0.22.20", ] +[[package]] +name = "proc-macro-error" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18f33027081eba0a6d8aba6d1b1c3a3be58cbb12106341c2d5759fcd9b5277e7" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a5b4b77fdb63c1eca72173d68d24501c54ab1269409f6b672c85deb18af69de" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "syn-mid", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + [[package]] name = "proc-macro2" version = "1.0.86" @@ -6123,20 +6248,20 @@ dependencies = [ "pin-project-lite", "quinn", "rustls 0.23.12", - "rustls-pemfile 2.1.3", + "rustls-pemfile", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.26.5", + "webpki-roots", "windows-registry", ] @@ -6313,25 +6438,17 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.6.3" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.4", + "rustls-pemfile", + "rustls-pki-types", "schannel", "security-framework", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - [[package]] name = "rustls-pemfile" version = "2.1.3" @@ -6348,6 +6465,33 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +[[package]] +name = "rustls-platform-verifier" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afbb878bdfdf63a336a5e63561b1835e7a8c91524f51621db870169eac84b490" +dependencies = [ + "core-foundation 0.9.4", + "core-foundation-sys", + "jni 0.19.0", + "log", + "once_cell", + "rustls 0.23.12", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki 0.102.7", + "security-framework", + "security-framework-sys", + "webpki-roots", + "winapi", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -6460,6 +6604,7 @@ dependencies = [ "core-foundation 0.9.4", "core-foundation-sys", "libc", + "num-bigint", "security-framework-sys", ] @@ -6521,6 +6666,25 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_bencode" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a70dfc7b7438b99896e7f8992363ab8e2c4ba26aa5ec675d32d1c3c2c33d413e" +dependencies = [ + "serde", + "serde_bytes", +] + +[[package]] +name = "serde_bytes" +version = "0.11.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" version = "1.0.210" @@ -6590,6 +6754,12 @@ dependencies = [ "digest", ] +[[package]] +name = "sha1_smol" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" + [[package]] name = "sha2" version = "0.10.8" @@ -6693,6 +6863,12 @@ dependencies = [ "serde", ] +[[package]] +name = "smol_str" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fad6c857cbab2627dcf01ec85a623ca4e7dcb5691cbaa3d7fb7653671f0d09c9" + [[package]] name = "smol_str" version = "0.2.2" @@ -6938,6 +7114,21 @@ dependencies = [ "siphasher", ] +[[package]] +name = "swarm-discovery" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39769914108ae68e261d85ceac7bce7095947130f79c29d4535e9b31fc702a40" +dependencies = [ + "acto", + "anyhow", + "hickory-proto 0.24.1", + "rand", + "socket2 0.5.7", + "tokio", + "tracing", +] + [[package]] name = "symphonia" version = "0.5.4" @@ -7082,24 +7273,23 @@ dependencies = [ ] [[package]] -name = "sync_wrapper" -version = "1.0.1" +name = "syn-mid" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "fea305d57546cc8cd04feb14b62ec84bf17f50e3f7b12560d7bfa9265f39d9ed" dependencies = [ - "futures-core", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "synstructure" -version = "0.12.6" +name = "sync_wrapper" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", + "futures-core", ] [[package]] @@ -7298,22 +7488,23 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.21.12", + "rustls 0.23.12", + "rustls-pki-types", "tokio", ] [[package]] -name = "tokio-rustls" -version = "0.26.0" +name = "tokio-stream" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ - "rustls 0.23.12", - "rustls-pki-types", + "futures-core", + "pin-project-lite", "tokio", ] @@ -7356,6 +7547,8 @@ dependencies = [ "bytes", "futures-core", "futures-sink", + "futures-util", + "hashbrown 0.14.5", "pin-project-lite", "tokio", ] @@ -7765,7 +7958,7 @@ dependencies = [ "rustls 0.23.12", "rustls-pki-types", "url", - "webpki-roots 0.26.5", + "webpki-roots", ] [[package]] @@ -7997,7 +8190,7 @@ checksum = "db67ae75a9405634f5882791678772c94ff5f16a66535aae186e26aa0841fc8b" dependencies = [ "core-foundation 0.9.4", "home", - "jni", + "jni 0.21.1", "log", "ndk-context", "objc", @@ -8006,12 +8199,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - [[package]] name = "webpki-roots" version = "0.26.5" @@ -8679,9 +8866,9 @@ checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" [[package]] name = "x509-parser" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" +checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" dependencies = [ "asn1-rs", "data-encoding", diff --git a/deny.toml b/deny.toml index 2a47d84bae..070e6a606a 100644 --- a/deny.toml +++ b/deny.toml @@ -31,3 +31,9 @@ github = ["gschup"] name = "ring" expression = "MIT AND ISC AND OpenSSL" license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }] + + +[advisories] +ignore = [ + "RUSTSEC-2024-0370", # no upgrade available - https://github.com/fishfolk/bones/issues/479 +] diff --git a/framework_crates/bones_framework/Cargo.toml b/framework_crates/bones_framework/Cargo.toml index 69df9563f7..d08fa4cba8 100644 --- a/framework_crates/bones_framework/Cargo.toml +++ b/framework_crates/bones_framework/Cargo.toml @@ -153,8 +153,8 @@ postcard = { version = "1.0", features = ["alloc"] } rcgen = "0.12" rustls = { version = "0.21", features = ["dangerous_configuration", "quic"] } smallvec = "1.10" -iroh-quinn = "0.10" -iroh-net = "0.22" +iroh-quinn = { version = "0.11" } +iroh-net = { version = "0.26", features = ["discovery-local-network"] } tokio = { version = "1", features = ["rt-multi-thread", "macros"] } turborand = { version = "0.10.0", features = ["atomic"] } diff --git a/framework_crates/bones_framework/src/networking.rs b/framework_crates/bones_framework/src/networking.rs index df4eb1f2c9..8f52b20191 100644 --- a/framework_crates/bones_framework/src/networking.rs +++ b/framework_crates/bones_framework/src/networking.rs @@ -122,6 +122,12 @@ pub async fn get_network_endpoint() -> &'static iroh_net::Endpoint { .alpns(vec![MATCH_ALPN.to_vec(), PLAY_ALPN.to_vec()]) .discovery(Box::new( iroh_net::discovery::ConcurrentDiscovery::from_services(vec![ + Box::new( + iroh_net::discovery::local_swarm_discovery::LocalSwarmDiscovery::new( + secret_key.public(), + ) + .unwrap(), + ), Box::new(iroh_net::discovery::dns::DnsDiscovery::n0_dns()), Box::new(iroh_net::discovery::pkarr::PkarrPublisher::n0_dns( secret_key.clone(), @@ -129,7 +135,7 @@ pub async fn get_network_endpoint() -> &'static iroh_net::Endpoint { ]), )) .secret_key(secret_key) - .bind(0) + .bind() .await .unwrap() }) diff --git a/framework_crates/bones_framework/src/networking/lan.rs b/framework_crates/bones_framework/src/networking/lan.rs index 708a236d23..c961b7f67d 100644 --- a/framework_crates/bones_framework/src/networking/lan.rs +++ b/framework_crates/bones_framework/src/networking/lan.rs @@ -328,14 +328,15 @@ async fn lan_start_server( } // Handle new connections - new_connection = ep.accept() => { - let Some(mut new_connection) = new_connection else { + incomming = ep.accept() => { + let Some(incomming) = incomming else { anyhow::bail!("unable to accept new connections"); }; let result = async move { - let alpn = new_connection.alpn().await?; + let mut connecting = incomming.accept()?; + let alpn = connecting.alpn().await?; anyhow::ensure!(alpn == PLAY_ALPN, "unexpected ALPN"); - let conn = new_connection.await?; + let conn = connecting.await?; anyhow::Ok(conn) }; @@ -383,7 +384,7 @@ async fn lan_start_server( .for_each(|(i, conn)| { let id = get_remote_node_id(conn).expect("invalid connection"); let mut addr = NodeAddr::new(id); - if let Some(info) = endpoint.connection_info(id) { + if let Some(info) = endpoint.remote_info(id) { if let Some(relay_url) = info.relay_url { addr = addr.with_relay_url(relay_url.relay_url); } @@ -402,7 +403,8 @@ async fn lan_start_server( player_count, })?) .await?; - uni.finish().await?; + uni.finish()?; + uni.stopped().await?; } let connections = connections diff --git a/framework_crates/bones_framework/src/networking/online_lobby.rs b/framework_crates/bones_framework/src/networking/online_lobby.rs index 741171c39e..f6cfb20420 100644 --- a/framework_crates/bones_framework/src/networking/online_lobby.rs +++ b/framework_crates/bones_framework/src/networking/online_lobby.rs @@ -24,7 +24,8 @@ pub(crate) async fn resolve_list_lobbies( let message = MatchmakerRequest::ListLobbies(game_id); let message = postcard::to_allocvec(&message)?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; let response = recv.read_to_end(5 * 1024).await?; let message: MatchmakerResponse = postcard::from_bytes(&response)?; @@ -50,7 +51,8 @@ pub(crate) async fn resolve_create_lobby( let message = MatchmakerRequest::CreateLobby(lobby_info); let message = postcard::to_allocvec(&message)?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; let response = recv.read_to_end(READ_TO_END_BYTE_COUNT).await?; let message: MatchmakerResponse = postcard::from_bytes(&response)?; @@ -81,7 +83,8 @@ pub(crate) async fn resolve_join_lobby( let message = MatchmakerRequest::JoinLobby(game_id, lobby_id.clone(), password); let message = postcard::to_allocvec(&message)?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; let response = recv.read_to_end(READ_TO_END_BYTE_COUNT).await?; let message: MatchmakerResponse = postcard::from_bytes(&response)?; diff --git a/framework_crates/bones_framework/src/networking/online_matchmaking.rs b/framework_crates/bones_framework/src/networking/online_matchmaking.rs index cdb93b89f2..c429c7c3be 100644 --- a/framework_crates/bones_framework/src/networking/online_matchmaking.rs +++ b/framework_crates/bones_framework/src/networking/online_matchmaking.rs @@ -27,7 +27,8 @@ pub(crate) async fn resolve_search_for_match( info!(request=?message, "Resolve: Sending match request"); let message = postcard::to_allocvec(&message)?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; let res = recv.read_to_end(READ_TO_END_BYTE_COUNT).await?; let _response: MatchmakerResponse = postcard::from_bytes(&res)?; @@ -114,7 +115,8 @@ pub(crate) async fn resolve_stop_search_for_match( let message = postcard::to_allocvec(&message)?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; let res = recv.read_to_end(READ_TO_END_BYTE_COUNT).await?; let response: MatchmakerResponse = postcard::from_bytes(&res)?; diff --git a/framework_crates/bones_framework/src/networking/socket.rs b/framework_crates/bones_framework/src/networking/socket.rs index af6964581d..13f7def97e 100644 --- a/framework_crates/bones_framework/src/networking/socket.rs +++ b/framework_crates/bones_framework/src/networking/socket.rs @@ -152,7 +152,8 @@ impl NetworkSocket for Socket { let result = async move { let mut stream = conn.open_uni().await?; stream.write_chunk(message).await?; - stream.finish().await?; + stream.finish()?; + stream.stopped().await?; anyhow::Ok(()) }; if let Err(err) = result.await { @@ -168,7 +169,8 @@ impl NetworkSocket for Socket { let result = async move { let mut stream = conn.open_uni().await?; stream.write_chunk(message).await?; - stream.finish().await?; + stream.finish()?; + stream.stopped().await?; anyhow::Ok(()) }; if let Err(err) = result.await { @@ -233,18 +235,19 @@ pub(super) async fn establish_peer_connections( info!(players=?range, "Waiting for {} peer connections", range.len()); for i in range { // Wait for connection - let mut conn = ep + let conn = ep .accept() .await .ok_or_else(|| anyhow::anyhow!("no connection for {}", i))?; - let alpn = conn.alpn().await?; + let mut connecting = conn.accept()?; + let alpn = connecting.alpn().await?; anyhow::ensure!( alpn == PLAY_ALPN, "invalid ALPN: {:?}", std::str::from_utf8(&alpn).unwrap_or("") ); - let conn = conn.await?; + let conn = connecting.await?; // Receive the player index let idx = { @@ -271,7 +274,8 @@ pub(super) async fn establish_peer_connections( // Send player index let mut channel = conn.open_uni().await?; channel.write(&player_idx.to_le_bytes()).await?; - channel.finish().await?; + channel.finish()?; + channel.stopped().await?; out_connections.push((i, conn)); } diff --git a/other_crates/bones_matchmaker/Cargo.toml b/other_crates/bones_matchmaker/Cargo.toml index 4192aa1b68..f05938bed2 100644 --- a/other_crates/bones_matchmaker/Cargo.toml +++ b/other_crates/bones_matchmaker/Cargo.toml @@ -23,6 +23,6 @@ postcard = { version = "1.0", default-features = false, features = serde = { version = "1.0", features = ["derive"] } tracing-subscriber = { version = "0.3", features = ["env-filter"] } tokio = { version = "1", features = ["rt-multi-thread", "macros"] } -iroh-net = { version = "0.22" } -quinn = { version = "0.10", package = "iroh-quinn" } -blake3 = "1.5.3" +iroh-net = { version = "0.26", features = ["discovery-local-network"] } +quinn = { version = "0.11", package = "iroh-quinn" } +blake3 = "1.5.3" diff --git a/other_crates/bones_matchmaker/examples/matchmaker_client.rs b/other_crates/bones_matchmaker/examples/matchmaker_client.rs index bb9fb69108..8d27886d95 100644 --- a/other_crates/bones_matchmaker/examples/matchmaker_client.rs +++ b/other_crates/bones_matchmaker/examples/matchmaker_client.rs @@ -2,7 +2,10 @@ use bones_matchmaker_proto::{ MatchInfo, MatchmakerRequest, MatchmakerResponse, PlayerIdxAssignment, MATCH_ALPN, PLAY_ALPN, }; use serde::{Deserialize, Serialize}; -use std::time::Duration; +use std::{ + net::{Ipv4Addr, SocketAddrV4}, + time::Duration, +}; use tokio::task::JoinSet; const CLIENT_PORT: u16 = 0; @@ -25,6 +28,11 @@ async fn client() -> anyhow::Result<()> { .alpns(vec![MATCH_ALPN.to_vec(), PLAY_ALPN.to_vec()]) .discovery(Box::new( iroh_net::discovery::ConcurrentDiscovery::from_services(vec![ + Box::new( + iroh_net::discovery::local_swarm_discovery::LocalSwarmDiscovery::new( + secret_key.public(), + )?, + ), Box::new(iroh_net::discovery::dns::DnsDiscovery::n0_dns()), Box::new(iroh_net::discovery::pkarr::PkarrPublisher::n0_dns( secret_key.clone(), @@ -32,7 +40,8 @@ async fn client() -> anyhow::Result<()> { ]), )) .secret_key(secret_key) - .bind(CLIENT_PORT) + .bind_addr_v4(SocketAddrV4::new(Ipv4Addr::UNSPECIFIED, CLIENT_PORT)) + .bind() .await?; let i_am = std::env::args().nth(2).unwrap(); @@ -61,7 +70,8 @@ async fn client() -> anyhow::Result<()> { let message = postcard::to_allocvec(&message)?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; println!("o Waiting for response"); @@ -116,7 +126,8 @@ async fn client() -> anyhow::Result<()> { sender .write_all(&postcard::to_allocvec(&hello.clone())?) .await?; - sender.finish().await?; + sender.finish()?; + sender.stopped().await?; tokio::time::sleep(Duration::from_secs(1)).await; } @@ -133,13 +144,14 @@ async fn client() -> anyhow::Result<()> { let endpoint = endpoint.clone(); tasks.spawn(async move { - if let Some(mut conn) = endpoint.accept().await { + if let Some(incomming) = endpoint.accept().await { let result = async { - let alpn = conn.alpn().await?; + let mut connecting = incomming.accept()?; + let alpn = connecting.alpn().await?; if alpn != PLAY_ALPN { anyhow::bail!("unexpected ALPN: {:?}", alpn); } - let conn = conn.await?; + let conn = connecting.await?; for _ in 0..3 { let mut recv = conn.accept_uni().await?; diff --git a/other_crates/bones_matchmaker/src/lib.rs b/other_crates/bones_matchmaker/src/lib.rs index 0a1ae3dbb9..27de146a41 100644 --- a/other_crates/bones_matchmaker/src/lib.rs +++ b/other_crates/bones_matchmaker/src/lib.rs @@ -5,7 +5,7 @@ #[macro_use] extern crate tracing; -use std::net::SocketAddr; +use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4}; use bones_matchmaker_proto::MATCH_ALPN; use iroh_net::key::SecretKey; @@ -52,6 +52,11 @@ async fn server(args: Config) -> anyhow::Result<()> { .alpns(vec![MATCH_ALPN.to_vec()]) .discovery(Box::new( iroh_net::discovery::ConcurrentDiscovery::from_services(vec![ + Box::new( + iroh_net::discovery::local_swarm_discovery::LocalSwarmDiscovery::new( + secret_key.public(), + )?, + ), Box::new(iroh_net::discovery::dns::DnsDiscovery::n0_dns()), Box::new(iroh_net::discovery::pkarr::PkarrPublisher::n0_dns( secret_key.clone(), @@ -59,7 +64,8 @@ async fn server(args: Config) -> anyhow::Result<()> { ]), )) .secret_key(secret_key) - .bind(port) + .bind_addr_v4(SocketAddrV4::new(Ipv4Addr::UNSPECIFIED, port)) + .bind() .await?; let my_addr = endpoint.node_addr().await?; @@ -76,6 +82,7 @@ async fn server(args: Config) -> anyhow::Result<()> { Ok(conn) => { info!( connection_id = conn.stable_id(), + addr = ?conn.remote_address(), "Accepted connection from client" ); diff --git a/other_crates/bones_matchmaker/src/lobbies.rs b/other_crates/bones_matchmaker/src/lobbies.rs index 2c8e33468d..5aedd225e9 100644 --- a/other_crates/bones_matchmaker/src/lobbies.rs +++ b/other_crates/bones_matchmaker/src/lobbies.rs @@ -41,7 +41,8 @@ pub async fn handle_list_lobbies(game_id: GameID, send: &mut quinn::SendStream) // Send the lobby list back to the client let message = postcard::to_allocvec(&MatchmakerResponse::LobbiesList(lobbies))?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; Ok(()) } @@ -77,7 +78,8 @@ pub async fn handle_create_lobby( // Send confirmation to the client let message = postcard::to_allocvec(&MatchmakerResponse::LobbyCreated(lobby_id))?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; Ok(()) } @@ -102,7 +104,8 @@ pub async fn handle_join_lobby( "Incorrect password".to_string(), ))?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; return Ok(()); } } @@ -130,7 +133,8 @@ pub async fn handle_join_lobby( let message = postcard::to_allocvec(&MatchmakerResponse::LobbyJoined(lobby_id.clone()))?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; // Always notify all players in the lobby about the update let lobby_update_message = @@ -144,7 +148,8 @@ pub async fn handle_join_lobby( for connection in connections.get().iter() { let mut send = connection.open_uni().await?; send.write_all(&lobby_update_message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; } } @@ -176,20 +181,23 @@ pub async fn handle_join_lobby( "Lobby is full".to_string(), ))?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; } } } else { let message = postcard::to_allocvec(&MatchmakerResponse::Error("Lobby not found".to_string()))?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; } } else { let message = postcard::to_allocvec(&MatchmakerResponse::Error("Game not found".to_string()))?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; } Ok(()) diff --git a/other_crates/bones_matchmaker/src/matchmaker.rs b/other_crates/bones_matchmaker/src/matchmaker.rs index 2b454fd81c..ec4e93ab66 100644 --- a/other_crates/bones_matchmaker/src/matchmaker.rs +++ b/other_crates/bones_matchmaker/src/matchmaker.rs @@ -52,6 +52,8 @@ pub async fn handle_connection(ep: Endpoint, conn: Connection) -> Result<()> { match request { MatchmakerRequest::RequestMatchmaking(match_info) => { handle_request_matchaking(ep.clone(), conn.clone(), match_info, &mut send).await?; + send.finish()?; + send.stopped().await?; } MatchmakerRequest::StopMatchmaking(match_info) => { handle_stop_matchmaking(conn.clone(), match_info, &mut send).await?; @@ -105,7 +107,7 @@ pub async fn start_game( for (conn_idx, conn) in members.iter().enumerate() { let id = iroh_net::endpoint::get_remote_node_id(conn)?; let mut addr = NodeAddr::new(id); - if let Some(info) = ep.connection_info(id) { + if let Some(info) = ep.remote_info(id) { if let Some(relay_url) = info.relay_url { addr = addr.with_relay_url(relay_url.relay_url); } @@ -129,7 +131,8 @@ pub async fn start_game( })?; let mut send = conn.open_uni().await?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; conn.close(0u32.into(), b"done"); } diff --git a/other_crates/bones_matchmaker/src/matchmaking.rs b/other_crates/bones_matchmaker/src/matchmaking.rs index 960ce3c450..68128f6d6b 100644 --- a/other_crates/bones_matchmaker/src/matchmaking.rs +++ b/other_crates/bones_matchmaker/src/matchmaking.rs @@ -43,7 +43,8 @@ pub async fn handle_stop_matchmaking( let message = postcard::to_allocvec(&response)?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; // If we removed a player, send update to the other players in the room if removed { @@ -122,14 +123,16 @@ pub async fn handle_request_matchaking( "Matchmaking room is full. Please try matchmaking again shortly.".to_string(), ))?; send.write_all(&error_message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; return Ok(()); } // Accept the matchmaking request let message = postcard::to_allocvec(&MatchmakerResponse::Accepted)?; send.write_all(&message).await?; - send.finish().await?; + send.finish()?; + send.stopped().await?; // Add the connection to the matchmaking room let new_player_count = state @@ -215,7 +218,10 @@ async fn send_matchmaking_updates( // Send first update and check active connections for (_index, conn) in connections.into_iter().enumerate() { if let Ok(mut send) = conn.open_uni().await { - if send.write_all(&first_update_message).await.is_ok() && send.finish().await.is_ok() { + if send.write_all(&first_update_message).await.is_ok() + && send.finish().is_ok() + && send.stopped().await.is_ok() + { active_connections.push(conn); } } @@ -232,7 +238,9 @@ async fn send_matchmaking_updates( if let Ok(mut send) = member.open_uni().await { if let Err(e) = send.write_all(&second_update_message).await { warn!("Connection to client {} has closed. {:?}", index, e); - } else if let Err(e) = send.finish().await { + } else if let Err(e) = send.finish() { + warn!("Connection to client {} has closed. {:?}", index, e); + } else if let Err(e) = send.stopped().await { warn!("Connection to client {} has closed. {:?}", index, e); } } diff --git a/other_crates/bones_matchmaker_proto/Cargo.toml b/other_crates/bones_matchmaker_proto/Cargo.toml index 237096675f..4cae9c909c 100644 --- a/other_crates/bones_matchmaker_proto/Cargo.toml +++ b/other_crates/bones_matchmaker_proto/Cargo.toml @@ -9,4 +9,4 @@ repository.workspace = true [dependencies] serde = { version = "1.0", features = ["derive"] } -iroh-net = "0.22" +iroh-net = "0.26"