diff options
author | Lemonzyy <lemonzy.pro@gmail.com> | 2022-11-14 12:04:23 +0100 |
---|---|---|
committer | Lemonzyy <lemonzy.pro@gmail.com> | 2022-11-14 12:04:23 +0100 |
commit | fc24c1b15071cf9fe44664bf9620d9dacd84154d (patch) | |
tree | 3e8313ba9a74de4fe31f9f0ab55dbf10c7ce17cd | |
parent | 82e2288afc91ac196295fa05796a925ed720c764 (diff) |
Update Bevy to 0.9
-rw-r--r-- | Cargo.lock | 757 | ||||
-rw-r--r-- | Cargo.toml | 6 | ||||
-rw-r--r-- | examples/breakout/breakout.rs | 5 | ||||
-rw-r--r-- | examples/breakout/client.rs | 191 | ||||
-rw-r--r-- | examples/breakout/server.rs | 72 | ||||
-rw-r--r-- | examples/chat/client.rs | 14 | ||||
-rw-r--r-- | examples/chat/server.rs | 4 | ||||
-rw-r--r-- | src/client.rs | 14 | ||||
-rw-r--r-- | src/lib.rs | 6 | ||||
-rw-r--r-- | src/server.rs | 14 |
10 files changed, 610 insertions, 473 deletions
@@ -47,7 +47,7 @@ dependencies = [ "alsa-sys", "bitflags", "libc", - "nix", + "nix 0.23.1", ] [[package]] @@ -68,14 +68,14 @@ checksum = "85965b6739a430150bdd138e2374a98af0c3ee0d030b3bb7fc3bddff58d0102e" [[package]] name = "android_logger" -version = "0.10.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9ed09b18365ed295d722d0b5ed59c01b79a826ff2d2a8f73d5ecca8e6fb2f66" +checksum = "b5e9dd62f37dea550caf48c77591dc50bd1a378ce08855be1a0c42a97b7550fb" dependencies = [ "android_log-sys", "env_logger", - "lazy_static", "log", + "once_cell", ] [[package]] @@ -123,26 +123,36 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" dependencies = [ - "concurrent-queue", + "concurrent-queue 1.2.4", "event-listener", "futures-core", ] [[package]] name = "async-executor" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +checksum = "17adb73da160dfb475c183343c8cccd80721ea5a605d3eb57125f0a7b7a92d0b" dependencies = [ + "async-lock", "async-task", - "concurrent-queue", + "concurrent-queue 2.0.0", "fastrand", "futures-lite", - "once_cell", "slab", ] [[package]] +name = "async-lock" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" +dependencies = [ + "event-listener", + "futures-lite", +] + +[[package]] name = "async-task" version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -155,6 +165,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + +[[package]] name = "base64" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -162,33 +178,33 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bevy" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea147ef1ebb92d41294cfad804c40de151b174c711ce6e0a4a40eba23eae1a4" +checksum = "3654d60973fcde065efcfe0c9066c81a76987d28c45233998b2ccdc581dcd914" dependencies = [ "bevy_internal", ] [[package]] name = "bevy_app" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e4ae0a6ed2adf3b153511b4645241660a93f747c05ecd1e5a909dafc803cad4" +checksum = "e7240e455d6976b20d24bf8eda37cd9154116fe9cc2beef7bdc009b4c6fff139" dependencies = [ "bevy_derive", "bevy_ecs", "bevy_reflect", - "bevy_tasks", "bevy_utils", + "downcast-rs", "wasm-bindgen", "web-sys", ] [[package]] name = "bevy_asset" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ec773c861a7e9d9978771f59f385500ec6da3a1ab5487705cddb054393d3d19" +checksum = "86ca05c472cd4939aed5b2980ad9b416a250ae4674824e8c4b569ddf18ab5230" dependencies = [ "anyhow", "bevy_app", @@ -202,8 +218,8 @@ dependencies = [ "downcast-rs", "fastrand", "js-sys", - "ndk-glue 0.5.2", - "parking_lot 0.12.1", + "ndk-glue", + "parking_lot", "serde", "thiserror", "wasm-bindgen", @@ -213,9 +229,9 @@ dependencies = [ [[package]] name = "bevy_audio" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e5cf4713a24f318841f73a9e030854cfd5bad46bc81fa1acc9590cdab053c6f" +checksum = "064d3733a2b4396ba0ca27f187d3957b1621c83d9ae65e7da458e57627d3541b" dependencies = [ "anyhow", "bevy_app", @@ -223,15 +239,15 @@ dependencies = [ "bevy_ecs", "bevy_reflect", "bevy_utils", - "parking_lot 0.12.1", + "parking_lot", "rodio", ] [[package]] name = "bevy_core" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c53172003d5cde7780870b5403c66c8ede3581faf3e510e916d8b4baa5b538d2" +checksum = "0d344ff340874fb3f1e458f03eca2b731cb8174495e9c0828f5e4569765489cb" dependencies = [ "bevy_app", "bevy_ecs", @@ -244,27 +260,29 @@ dependencies = [ [[package]] name = "bevy_core_pipeline" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e60efd10d593f6d122f2687f74c09ad55835a8f999c35bed6380ddd8e6ff7f2" +checksum = "13523e290f9aad62987e04836d66819fb97afeaf794847b6f64121c62a4db916" dependencies = [ "bevy_app", "bevy_asset", "bevy_derive", "bevy_ecs", + "bevy_math", "bevy_reflect", "bevy_render", "bevy_transform", "bevy_utils", + "bitflags", "radsort", "serde", ] [[package]] name = "bevy_derive" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e6345431bbe6d7b6c165cd860ecd0b35da929779571259c5df970ac256d45f9" +checksum = "a12e50d2ff8423438e971c44a90baefc9e351edd45b50b8d077f9ad4f7a0a2a5" dependencies = [ "bevy_macro_utils", "quote", @@ -273,11 +291,12 @@ dependencies = [ [[package]] name = "bevy_diagnostic" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ac9f4c2815f412be4b6e21e4b299cdafa710f651d064f6d40b2a8377a0d17c" +checksum = "d3415f3a220d8706daac84986d744374fd18883add3a22e894af8cddf2cf1c29" dependencies = [ "bevy_app", + "bevy_core", "bevy_ecs", "bevy_log", "bevy_time", @@ -286,9 +305,9 @@ dependencies = [ [[package]] name = "bevy_ecs" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c174066a24ed8a14d15ea58b0aea1c1f5c763f4bb36ebdc2b1dc78026007d0f5" +checksum = "43b29e39772df5e8939f7f540ee152569eebeb3c2cc35a68670688ae008ba2cf" dependencies = [ "async-channel", "bevy_ecs_macros", @@ -297,6 +316,7 @@ dependencies = [ "bevy_tasks", "bevy_utils", "downcast-rs", + "event-listener", "fixedbitset", "fxhash", "serde", @@ -305,9 +325,9 @@ dependencies = [ [[package]] name = "bevy_ecs_macros" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc50c39e49e8febccc74e8e731680adb0cb4aef1f53275740cbaa95c6da71f4f" +checksum = "10b8e7e7fb3ab9554c77e0f8a2531abd05d40ddb0145a8dfa72434cefa52ee5c" dependencies = [ "bevy_macro_utils", "proc-macro2", @@ -317,9 +337,9 @@ dependencies = [ [[package]] name = "bevy_encase_derive" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bc194009c5e9b97da64a08142dd183c264885d99c985cf849868103018adf1" +checksum = "3a0773119830d63dde225338c0c556f84cd68e8e69de5b62a1b172fdddc5b915" dependencies = [ "bevy_macro_utils", "encase_derive_impl", @@ -327,9 +347,9 @@ dependencies = [ [[package]] name = "bevy_gltf" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79db7d7e71b47a69953fbe8407ded5c6308eaeecf9a05efd5dfb42992f400a16" +checksum = "fd77158983e09cbbb8115a2c629bdf3249cfff58e8e19f1c62861b1e5495eaf1" dependencies = [ "anyhow", "base64", @@ -355,12 +375,14 @@ dependencies = [ [[package]] name = "bevy_hierarchy" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eb1ec76099ea5a716de08ea42ff41f036ebe2502df1d569168b58f16458a85e" +checksum = "23b5181dc3d621c3d18a1209791e82199409d6ddf5376ee19f2e26ad7bfd9b06" dependencies = [ "bevy_app", + "bevy_core", "bevy_ecs", + "bevy_log", "bevy_reflect", "bevy_utils", "smallvec", @@ -368,21 +390,23 @@ dependencies = [ [[package]] name = "bevy_input" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1821c4b760ba6ddb4fe61806e9cc33f40b09a884557aca4553a29b8c7d73c6b4" +checksum = "10f72c3037535eb41b863a22c2e58d3845a096401f9b92204b6a240e36a5151b" dependencies = [ "bevy_app", "bevy_ecs", "bevy_math", + "bevy_reflect", "bevy_utils", + "thiserror", ] [[package]] name = "bevy_internal" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee63ad1e3f95a26ff2c227fadb1534a7bfe3a098e0e45c347f2f2575a573d9bc" +checksum = "0ff89c2c2644c588d72cf505f15ad515479705c82ad7aa359ad2249646995a76" dependencies = [ "bevy_app", "bevy_asset", @@ -410,17 +434,18 @@ dependencies = [ "bevy_utils", "bevy_window", "bevy_winit", - "ndk-glue 0.5.2", + "ndk-glue", ] [[package]] name = "bevy_log" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "092daf498887814a064331dfcd1cf487a5ddab01fd38629b84a35b8b664462a1" +checksum = "66c1d5f2cbcf5c3ce87d42afb6ba98177f8f758278364cbc79a2b3bf38415f0e" dependencies = [ "android_log-sys", "bevy_app", + "bevy_ecs", "bevy_utils", "console_error_panic_hook", "tracing-log", @@ -430,9 +455,9 @@ dependencies = [ [[package]] name = "bevy_macro_utils" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43fb5137e5198302d7c6c33d1e454cf48a586e7c6fd12f4860f12863951e16b9" +checksum = "656fa7b3434ac5d5c2883dde3c075f834ff51178f2f48ef2454b6f2ada75cb15" dependencies = [ "quote", "syn", @@ -441,31 +466,33 @@ dependencies = [ [[package]] name = "bevy_math" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531f2b90c7e861a96f418b3d560131b3354c5e67a67eba3953a45a56ea0114d2" +checksum = "b26459575a5f9695788e3487aa0a5f9252562e0fc57065e6f35f370dbfac7d4a" dependencies = [ "glam", + "serde", ] [[package]] name = "bevy_mikktspace" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "941e7d3d4e1dbb735f040e4cdc1558be1d3c38d43f1d9fdbb039c39a7849a00b" +checksum = "1e67d9caff1be480eb097e1a5ee7332762e19a2ea3d07496017fc8221ea6bc46" dependencies = [ "glam", ] [[package]] name = "bevy_pbr" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176073021a4caeb8b448f24ce790fb57fde74b114f345064a8b102d2f7bed905" +checksum = "5a2e5069b351743e5660f837671135a7aac585cd2c1d7d0b90d92a2d84c2a1fd" dependencies = [ "bevy_app", "bevy_asset", "bevy_core_pipeline", + "bevy_derive", "bevy_ecs", "bevy_math", "bevy_reflect", @@ -480,9 +507,9 @@ dependencies = [ [[package]] name = "bevy_ptr" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9960c19e582b43cebe1894b6679520a4f50802d1cc5b6fa432f8d685ed232f09" +checksum = "c36f4d3af0cda50c07e2010d0351ab79594681116edd280592ca394db73ef32b" [[package]] name = "bevy_quinnet" @@ -508,10 +535,11 @@ dependencies = [ [[package]] name = "bevy_reflect" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fc689dd7a7df3b3768884a4754711d406aa302ea48da483c03b52715fa95045" +checksum = "c39f74d7786a0016c74b6bfb57f44928d536bef8bf6db7505d4cbe9435aeda7b" dependencies = [ + "bevy_math", "bevy_ptr", "bevy_reflect_derive", "bevy_utils", @@ -519,7 +547,7 @@ dependencies = [ "erased-serde", "glam", "once_cell", - "parking_lot 0.12.1", + "parking_lot", "serde", "smallvec", "thiserror", @@ -527,11 +555,12 @@ dependencies = [ [[package]] name = "bevy_reflect_derive" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c36fa5100832c787c10558d31632ddc454c221e8dfacbbef836938f59614754" +checksum = "5b2c0aab36b060e88cd93c56710d9ce8ab6107596dc4cbb8a9d84ba98f39c63b" dependencies = [ "bevy_macro_utils", + "bit-set", "proc-macro2", "quote", "syn", @@ -540,9 +569,9 @@ dependencies = [ [[package]] name = "bevy_render" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "600bcef85c7efac6e38ed725707f0e5b7c59b510430034ba2f743f472493f845" +checksum = "14033813fdd9587663ffa6b6d84327f30bd0398b40386677704bd4d608625420" dependencies = [ "anyhow", "bevy_app", @@ -563,7 +592,6 @@ dependencies = [ "bevy_window", "bitflags", "codespan-reporting", - "copyless", "downcast-rs", "encase", "futures-lite", @@ -572,7 +600,7 @@ dependencies = [ "image", "naga", "once_cell", - "parking_lot 0.12.1", + "parking_lot", "regex", "serde", "smallvec", @@ -583,9 +611,9 @@ dependencies = [ [[package]] name = "bevy_render_macros" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be90adc9e5d5808833e363670818da5fe68ccafd7ca983a457f90957d2a430b" +checksum = "e29db44fb38743a08e71bed324a19b8ce2e9f2853abcb4640e03625dd55cc186" dependencies = [ "bevy_macro_utils", "proc-macro2", @@ -595,9 +623,9 @@ dependencies = [ [[package]] name = "bevy_scene" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a045d575d2c8f776d8ea965363c81660243fefbfc3712ead938b00dfd6797216" +checksum = "b5b98c58cba6417961856a57ba1116d78db3364b8e791ac517175f04b9abdb6b" dependencies = [ "anyhow", "bevy_app", @@ -617,13 +645,14 @@ dependencies = [ [[package]] name = "bevy_sprite" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69c419f3db09d7ac1f4d45e0874d349d5d6f47f48bc10d55cd0da36413e2331e" +checksum = "b135b2ccf7c5eaf9b3e20e39ef80081842f122081c8ce988cb2054afd1af270e" dependencies = [ "bevy_app", "bevy_asset", "bevy_core_pipeline", + "bevy_derive", "bevy_ecs", "bevy_log", "bevy_math", @@ -633,34 +662,32 @@ dependencies = [ "bevy_utils", "bitflags", "bytemuck", - "copyless", "fixedbitset", "guillotiere", "rectangle-pack", - "serde", "thiserror", ] [[package]] name = "bevy_tasks" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b753acb3d5b9dbfd77038560fe1893c17d4ee0a4242c2ee70da9d59430537" +checksum = "a5d91d94d2db1476d7452509c1967fe83d66da5f683f5d49ba31e0f455adfcdc" dependencies = [ "async-channel", "async-executor", - "event-listener", + "async-task", + "concurrent-queue 1.2.4", "futures-lite", - "num_cpus", "once_cell", "wasm-bindgen-futures", ] [[package]] name = "bevy_text" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c265b7515faf55a3b92fd6ce0ab65dd246f247e11d737d6f5cdaf49c2be42c63" +checksum = "fe4282d77fb5dd38bb2a7736a770f5e499782b8c546b9f7d73f6893ab04c8041" dependencies = [ "ab_glyph", "anyhow", @@ -681,9 +708,9 @@ dependencies = [ [[package]] name = "bevy_time" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22830665b8476292b861216383fd79922aef2b540f9fd09d49144e3e5e94550e" +checksum = "a259a4b04f5ae2d02998247a69e5a711b0754eb22971320bf727c6f4d7bf38fa" dependencies = [ "bevy_app", "bevy_ecs", @@ -694,9 +721,9 @@ dependencies = [ [[package]] name = "bevy_transform" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4bb8760f03e9667e7499a5ceec1f7630fc3e45702781ac0df56cb969e8ae668" +checksum = "b7b4cdac87f8a58c3ec166b5673dd35565c61eb0ec648e3b0cc30083170c0fb3" dependencies = [ "bevy_app", "bevy_ecs", @@ -707,9 +734,9 @@ dependencies = [ [[package]] name = "bevy_ui" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062ce086de1a4a470e5df48cb5c16a1dc97ab610e635cafabdef26c4a1ef5756" +checksum = "da6d85fcefe5a2bf259c2ff58a7a29b6102070242dc385b42a2656f4e8918883" dependencies = [ "bevy_app", "bevy_asset", @@ -731,13 +758,14 @@ dependencies = [ "serde", "smallvec", "taffy", + "thiserror", ] [[package]] name = "bevy_utils" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e9aa1866c1cf7ee000f281ce9e90d02d701f5c7380a107252017e58e2f5246" +checksum = "1d7473635355a99fcf7181091a2ac11df03561706b1696cb0cc72e4ddd010571" dependencies = [ "ahash", "getrandom", @@ -749,24 +777,24 @@ dependencies = [ [[package]] name = "bevy_window" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707dbbebfac72b1e63e874e7a11a345feab8c440355c0bd71e6dff26709fba9a" +checksum = "07a0d03022a6d1ec0d05c01a77f5592a9602bbc1cfc11ba457788b69f9ca175d" dependencies = [ "bevy_app", "bevy_ecs", "bevy_input", "bevy_math", + "bevy_reflect", "bevy_utils", - "raw-window-handle", - "web-sys", + "raw-window-handle 0.5.0", ] [[package]] name = "bevy_winit" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98b15fee4b75472e3441b0c7221467303e4ce59b342a94a328e447e7cdb5a43c" +checksum = "ebc7b4e4f83e268dcbd6f9c4e1c18f7382e457f5f1b160da4c85d9a3f489771a" dependencies = [ "approx", "bevy_app", @@ -776,7 +804,7 @@ dependencies = [ "bevy_utils", "bevy_window", "crossbeam-channel", - "raw-window-handle", + "raw-window-handle 0.5.0", "wasm-bindgen", "web-sys", "winit", @@ -793,9 +821,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.59.2" +version = "0.61.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +checksum = "8a022e58a142a46fea340d68012b9201c094e93ec3d033a944a24f8fd4a4f09a" dependencies = [ "bitflags", "cexpr", @@ -808,6 +836,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", + "syn", ] [[package]] @@ -845,18 +874,18 @@ checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "bytemuck" -version = "1.12.2" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aec14f5d4e6e3f927cd0c81f72e5710d95ee9019fbeb4b3021193867491bfd8" +checksum = "aaa3a8d9a1ca92e282c96a32d6511b695d7d994d1d102ba85d279f9b2756947f" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9e1f5fa78f69496407a27ae9ed989e3c3b072310286f5ef385525e4cbc24a9" +checksum = "5fe233b960f12f8007e3db2d136e3cb1c291bfd7396e384ee76025fc1a3932b4" dependencies = [ "proc-macro2", "quote", @@ -883,9 +912,9 @@ checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" [[package]] name = "cc" -version = "1.0.74" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581f5dba903aac52ea3feb5ec4810848460ee833876f1f9b0fdeab1f19091574" +checksum = "76a284da2e6fe2092f2353e51713435363112dfd60030e22add80be333fb928f" dependencies = [ "jobserver", ] @@ -907,12 +936,6 @@ dependencies = [ [[package]] name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" @@ -943,8 +966,8 @@ dependencies = [ "bitflags", "block", "cocoa-foundation", - "core-foundation 0.9.3", - "core-graphics 0.22.3", + "core-foundation", + "core-graphics", "foreign-types", "libc", "objc", @@ -958,7 +981,7 @@ checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" dependencies = [ "bitflags", "block", - "core-foundation 0.9.3", + "core-foundation", "core-graphics-types", "foreign-types", "libc", @@ -1001,12 +1024,21 @@ dependencies = [ ] [[package]] +name = "concurrent-queue" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7bef69dc86e3c610e4e7aed41035e2a7ed12e72dd7530f61327a6579a4390b" +dependencies = [ + "crossbeam-utils", +] + +[[package]] name = "console_error_panic_hook" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen", ] @@ -1017,63 +1049,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed2b28323eee4fb66bb824401daa3e46bd445b9a9298a3d382b320710ba69dd" [[package]] -name = "copyless" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536" - -[[package]] -name = "core-foundation" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" -dependencies = [ - "core-foundation-sys 0.7.0", - "libc", -] - -[[package]] name = "core-foundation" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ - "core-foundation-sys 0.8.3", + "core-foundation-sys", "libc", ] [[package]] name = "core-foundation-sys" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" - -[[package]] -name = "core-foundation-sys" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "core-graphics" -version = "0.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" -dependencies = [ - "bitflags", - "core-foundation 0.7.0", - "foreign-types", - "libc", -] - -[[package]] -name = "core-graphics" version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" dependencies = [ "bitflags", - "core-foundation 0.9.3", + "core-foundation", "core-graphics-types", "foreign-types", "libc", @@ -1086,25 +1084,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" dependencies = [ "bitflags", - "core-foundation 0.9.3", + "core-foundation", "foreign-types", "libc", ] [[package]] -name = "core-video-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" -dependencies = [ - "cfg-if 0.1.10", - "core-foundation-sys 0.7.0", - "core-graphics 0.19.2", - "libc", - "objc", -] - -[[package]] name = "coreaudio-rs" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1116,37 +1101,37 @@ dependencies = [ [[package]] name = "coreaudio-sys" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dff444d80630d7073077d38d40b4501fd518bd2b922c2a55edcc8b0f7be57e6" +checksum = "1a9444b94b8024feecc29e01a9706c69c1e26bfee480221c90764200cfd778fb" dependencies = [ "bindgen", ] [[package]] name = "cpal" -version = "0.13.5" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74117836a5124f3629e4b474eed03e479abaf98988b4bb317e29f08cfe0e4116" +checksum = "e73413ddcb69c398125f5529714492e070c64c6a090ad5b01d8c082b320a0809" dependencies = [ "alsa", - "core-foundation-sys 0.8.3", + "core-foundation-sys", "coreaudio-rs", "jni", "js-sys", - "lazy_static", "libc", "mach", - "ndk 0.6.0", - "ndk-glue 0.6.2", - "nix", + "ndk 0.7.0", + "ndk-context", + "nix 0.25.0", "oboe", - "parking_lot 0.11.2", + "once_cell", + "parking_lot", "stdweb", "thiserror", "wasm-bindgen", "web-sys", - "winapi", + "windows", ] [[package]] @@ -1155,7 +1140,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -1165,7 +1150,7 @@ version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1221,6 +1206,12 @@ dependencies = [ ] [[package]] +name = "discard" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" + +[[package]] name = "dispatch" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1234,9 +1225,9 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "encase" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a516181e9a36e8982cb37933c5e7dba638c42938cacde46ee4e5b4156f881b9" +checksum = "c6bdd416eb91cd6fb73a22fbc9fa1ea013641cce1a58905c31623ff9c562e811" dependencies = [ "const_panic", "encase_derive", @@ -1246,18 +1237,18 @@ dependencies = [ [[package]] name = "encase_derive" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5b802412eea315f29f2bb2da3a5963cd6121f56eaa06aebcdc0c54eea578f22" +checksum = "df06cd7ea02426c2a0a164656bf116813584b461b8a7bb059b7941ab981105d3" dependencies = [ "encase_derive_impl", ] [[package]] name = "encase_derive_impl" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2f4de457d974f548d2c2a16f709ebd81013579e543bd1a9b19ced88132c2cf" +checksum = "b299aab48b9a897ddd730dde2b5550af7c90ec6779c78e3c70f4c28d9337663f" dependencies = [ "proc-macro2", "quote", @@ -1266,9 +1257,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.8.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" dependencies = [ "log", "regex", @@ -1453,7 +1444,7 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi", @@ -1462,9 +1453,9 @@ dependencies = [ [[package]] name = "glam" -version = "0.21.3" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518faa5064866338b013ff9b2350dc318e14cc4fcd6cb8206d7e7c9886c98815" +checksum = "12f597d56c1bd55a811a1be189459e8fad2bbc272616375602443bdfb37fa774" dependencies = [ "bytemuck", "serde", @@ -1630,9 +1621,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hexasphere" -version = "7.2.1" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaadafd1beb6ad34cff5521987017ece5848f9ad5401fdb039bff896a643add4" +checksum = "619ce654558681d7d0a7809e1b20249c7032ff13ee6baa7bb7ff64f7f28a906a" dependencies = [ "glam", "once_cell", @@ -1652,9 +1643,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "image" -version = "0.24.4" +version = "0.24.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd8e4fb07cf672b1642304e731ef8a6a4c7891d67bb4fd4f5ce58cd6ed86803c" +checksum = "69b7ea949b537b0fd0af141fff8c77690f2ce96f4f41f042ccb6c69c6c965945" dependencies = [ "bytemuck", "byteorder", @@ -1680,18 +1671,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a257582fdcde896fd96463bf2d40eefea0580021c0712a0e2b028b60b47a837a" [[package]] -name = "inplace_it" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e567468c50f3d4bc7397702e09b380139f9b9288b4e909b070571007f8b5bf78" - -[[package]] name = "instant" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -1765,6 +1750,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] +name = "lewton" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "777b48df9aaab155475a83a7df3070395ea1ac6902f5cd062b8f2b028075c030" +dependencies = [ + "byteorder", + "ogg", + "tinyvec", +] + +[[package]] name = "libc" version = "0.2.137" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1772,11 +1768,11 @@ checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" [[package]] name = "libloading" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "winapi", ] @@ -1796,7 +1792,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1875,9 +1871,9 @@ dependencies = [ [[package]] name = "naga" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f50357e1167a3ab92d6b3c7f4bf5f7fd13fde3f4b28bf0d5ea07b5100fdb6c0" +checksum = "262d2840e72dbe250e8cf2f522d080988dfca624c4112c096238a4845f591707" dependencies = [ "bit-set", "bitflags", @@ -1897,27 +1893,28 @@ dependencies = [ [[package]] name = "ndk" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d868f654c72e75f8687572699cdabe755f03effbb62542768e995d5b8d699d" +checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" dependencies = [ "bitflags", "jni-sys", - "ndk-sys 0.2.2", + "ndk-sys 0.3.0", "num_enum", "thiserror", ] [[package]] name = "ndk" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" +checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" dependencies = [ "bitflags", "jni-sys", - "ndk-sys 0.3.0", + "ndk-sys 0.4.0", "num_enum", + "raw-window-handle 0.5.0", "thiserror", ] @@ -1929,33 +1926,19 @@ checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" [[package]] name = "ndk-glue" -version = "0.5.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c71bee8ea72d685477e28bd004cfe1bf99c754d688cd78cad139eae4089484d4" +checksum = "0434fabdd2c15e0aab768ca31d5b7b333717f03cf02037d5a0a3ff3c278ed67f" dependencies = [ "android_logger", - "lazy_static", - "libc", - "log", - "ndk 0.5.0", - "ndk-context", - "ndk-macro", - "ndk-sys 0.2.2", -] - -[[package]] -name = "ndk-glue" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0c4a7b83860226e6b4183edac21851f05d5a51756e97a1144b7f5a6b63e65f" -dependencies = [ - "lazy_static", "libc", "log", - "ndk 0.6.0", + "ndk 0.7.0", "ndk-context", "ndk-macro", - "ndk-sys 0.3.0", + "ndk-sys 0.4.0", + "once_cell", + "parking_lot", ] [[package]] @@ -1973,15 +1956,18 @@ dependencies = [ [[package]] name = "ndk-sys" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" +checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" +dependencies = [ + "jni-sys", +] [[package]] name = "ndk-sys" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" +checksum = "21d83ec9c63ec5bf950200a8e508bdad6659972187b625469f58ef8c08e29046" dependencies = [ "jni-sys", ] @@ -1994,12 +1980,26 @@ checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" dependencies = [ "bitflags", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "memoffset", ] [[package]] +name = "nix" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb" +dependencies = [ + "autocfg", + "bitflags", + "cfg-if", + "libc", + "memoffset", + "pin-utils", +] + +[[package]] name = "nom" version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2092,15 +2092,6 @@ dependencies = [ ] [[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - -[[package]] name = "objc" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2143,6 +2134,15 @@ dependencies = [ ] [[package]] +name = "ogg" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6951b4e8bf21c8193da321bcce9c9dd2e13c858fe078bf9054a288b419ae5d6e" +dependencies = [ + "byteorder", +] + +[[package]] name = "once_cell" version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2162,9 +2162,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owned_ttf_parser" -version = "0.17.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4665508572151759e8d60404e20dc096ef93a99801a05ac2ac6e43bf5b4ca187" +checksum = "18904d3c65493a9f0d7542293d1a7f69bfdc309a6b9ef4f46dc3e58b0577edc5" dependencies = [ "ttf-parser", ] @@ -2177,37 +2177,12 @@ checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" [[package]] name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.5", -] - -[[package]] -name = "parking_lot" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.4", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" -dependencies = [ - "cfg-if 1.0.0", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -2216,7 +2191,7 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", @@ -2283,9 +2258,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro-crate" @@ -2427,6 +2402,15 @@ dependencies = [ ] [[package]] +name = "raw-window-handle" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed7e3d950b66e19e0c372f3fa3fbbcf85b1746b571f74e0c2af6042a5c93420a" +dependencies = [ + "cty", +] + +[[package]] name = "rcgen" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2455,9 +2439,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" dependencies = [ "aho-corasick", "memchr", @@ -2475,9 +2459,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "renderdoc-sys" @@ -2502,18 +2486,19 @@ dependencies = [ [[package]] name = "rodio" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0939e9f626e6c6f1989adb6226a039c855ca483053f0ee7c98b90e41cf731e" +checksum = "eb10b653d5ec0e9411a2e7d46e2c7f4046fd87d35b9955bd73ba4108d69072b5" dependencies = [ "cpal", + "lewton", ] [[package]] name = "ron" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" +checksum = "300a51053b1cb55c80b7a9fde4120726ddf25ca241a1cbb926626f62fb136bff" dependencies = [ "base64", "bitflags", @@ -2527,6 +2512,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + +[[package]] name = "rustls" version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2615,8 +2609,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" dependencies = [ "bitflags", - "core-foundation 0.9.3", - "core-foundation-sys 0.8.3", + "core-foundation", + "core-foundation-sys", "libc", "security-framework-sys", ] @@ -2627,11 +2621,26 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" dependencies = [ - "core-foundation-sys 0.8.3", + "core-foundation-sys", "libc", ] [[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] name = "serde" version = "1.0.147" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2663,6 +2672,21 @@ dependencies = [ ] [[package]] +name = "sha1" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +dependencies = [ + "sha1_smol", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + +[[package]] name = "sharded-slab" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2731,10 +2755,59 @@ dependencies = [ ] [[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] name = "stdweb" -version = "0.1.3" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" +dependencies = [ + "discard", + "rustc_version", + "stdweb-derive", + "stdweb-internal-macros", + "stdweb-internal-runtime", + "wasm-bindgen", +] + +[[package]] +name = "stdweb-derive" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "serde_derive", + "syn", +] + +[[package]] +name = "stdweb-internal-macros" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" +dependencies = [ + "base-x", + "proc-macro2", + "quote", + "serde", + "serde_derive", + "serde_json", + "sha1", + "syn", +] + +[[package]] +name = "stdweb-internal-runtime" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" +checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" [[package]] name = "strsim" @@ -2812,12 +2885,10 @@ dependencies = [ [[package]] name = "time" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fab5c8b9980850e06d92ddbe3ab839c062c801f3927c0fb8abd6fc8e918fbca" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" dependencies = [ - "libc", - "num_threads", "serde", "time-core", ] @@ -2899,7 +2970,7 @@ version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -3053,7 +3124,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -3078,7 +3149,7 @@ version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -3135,17 +3206,18 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "277e967bf8b7820a76852645a6bce8bbd31c32fda2042e82d8e3ea75fda8892d" +checksum = "c2272b17bffc8a0c7d53897435da7c1db587c87d3a14e8dae9cdb8d1d210fc0f" dependencies = [ "arrayvec", "js-sys", "log", "naga", - "parking_lot 0.12.1", - "raw-window-handle", + "parking_lot", + "raw-window-handle 0.5.0", "smallvec", + "static_assertions", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -3156,22 +3228,21 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.13.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b92788dec9d0c1bed849a1b83f01b2ee12819bf04a79c90f68e4173f7b5ba2" +checksum = "73d14cad393054caf992ee02b7da6a372245d39a484f7461c1f44f6f6359bd28" dependencies = [ "arrayvec", "bit-vec", "bitflags", "cfg_aliases", "codespan-reporting", - "copyless", "fxhash", "log", "naga", - "parking_lot 0.12.1", + "parking_lot", "profiling", - "raw-window-handle", + "raw-window-handle 0.5.0", "smallvec", "thiserror", "web-sys", @@ -3181,9 +3252,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.13.2" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cbdfc3d0637dba3d5536b93adef3d26023a0b96f0e1ee5ee9560a401d9f646" +checksum = "3cc320a61acb26be4f549c9b1b53405c10a223fbfea363ec39474c32c348d12f" dependencies = [ "android_system_properties", "arrayvec", @@ -3198,7 +3269,6 @@ dependencies = [ "glow", "gpu-alloc", "gpu-descriptor", - "inplace_it", "js-sys", "khronos-egl", "libloading", @@ -3206,11 +3276,12 @@ dependencies = [ "metal", "naga", "objc", - "parking_lot 0.12.1", + "parking_lot", "profiling", "range-alloc", - "raw-window-handle", + "raw-window-handle 0.5.0", "renderdoc-sys", + "smallvec", "thiserror", "wasm-bindgen", "web-sys", @@ -3220,9 +3291,9 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.13.2" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f762cbc08e1a51389859cf9c199c7aef544789cf3510889aab12c607f701604" +checksum = "fb6b28ef22cac17b9109b25b3bf8c9a103eeb293d7c5f78653979b09140375f6" dependencies = [ "bitflags", ] @@ -3259,6 +3330,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] +name = "windows" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57b543186b344cc61c85b5aab0d2e3adf4e0f99bc076eff9aa5927bcc0b8a647" +dependencies = [ + "windows_aarch64_msvc 0.37.0", + "windows_i686_gnu 0.37.0", + "windows_i686_msvc 0.37.0", + "windows_x86_64_gnu 0.37.0", + "windows_x86_64_msvc 0.37.0", +] + +[[package]] name = "windows-sys" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3300,6 +3384,12 @@ checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" [[package]] name = "windows_aarch64_msvc" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2623277cb2d1c216ba3b578c0f3cf9cdebeddb6e66b1b218bb33596ea7769c3a" + +[[package]] +name = "windows_aarch64_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" @@ -3312,6 +3402,12 @@ checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" [[package]] name = "windows_i686_gnu" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3925fd0b0b804730d44d4b6278c50f9699703ec49bcd628020f46f4ba07d9e1" + +[[package]] +name = "windows_i686_gnu" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" @@ -3324,6 +3420,12 @@ checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" [[package]] name = "windows_i686_msvc" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce907ac74fe331b524c1298683efbf598bb031bc84d5e274db2083696d07c57c" + +[[package]] +name = "windows_i686_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" @@ -3336,6 +3438,12 @@ checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" [[package]] name = "windows_x86_64_gnu" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2babfba0828f2e6b32457d5341427dcbb577ceef556273229959ac23a10af33d" + +[[package]] +name = "windows_x86_64_gnu" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" @@ -3354,35 +3462,40 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "windows_x86_64_msvc" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4dd6dc7df2d84cf7b33822ed5b86318fb1781948e9663bacd047fc9dd52259d" + +[[package]] +name = "windows_x86_64_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" [[package]] name = "winit" -version = "0.26.1" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b43cc931d58b99461188607efd7acb2a093e65fc621f54cad78517a6063e73a" +checksum = "bb796d6fbd86b2fd896c9471e6f04d39d750076ebe5680a3958f00f5ab97657c" dependencies = [ "bitflags", "cocoa", - "core-foundation 0.9.3", - "core-graphics 0.22.3", - "core-video-sys", + "core-foundation", + "core-graphics", "dispatch", "instant", - "lazy_static", "libc", "log", - "ndk 0.5.0", - "ndk-glue 0.5.2", - "ndk-sys 0.2.2", + "ndk 0.7.0", + "ndk-glue", "objc", - "parking_lot 0.11.2", - "raw-window-handle", + "once_cell", + "parking_lot", + "raw-window-handle 0.4.3", + "raw-window-handle 0.5.0", "wasm-bindgen", "web-sys", - "winapi", + "windows-sys 0.36.1", ] [[package]] @@ -11,8 +11,8 @@ readme = "README.md" exclude = ["assets/"] [dependencies] -bevy = { version = "0.8.1", default-features = false, features = [] } -rustls = { version = "0.20.6", default-features = false, features = ["quic","dangerous_configuration"] } +bevy = { version = "0.9.0", default-features = false, features = [] } +rustls = { version = "0.20.6", default-features = false, features = ["quic", "dangerous_configuration"] } rustls-pemfile = "1.0.1" ring = "0.16.20" tokio = { version = "1.21.2", features = ["sync", "rt-multi-thread", "macros"] } @@ -28,7 +28,7 @@ base64 = "0.13.1" thiserror = "1.0.37" [dev-dependencies] -bevy = { version = "0.8.1", default-features = false, features = ["bevy_asset", "bevy_audio", "bevy_winit", "render"] } +bevy = { version = "0.9.0", default-features = false, features = ["bevy_asset", "bevy_audio", "vorbis", "bevy_winit", "render"] } rand = "0.8.5" [[example]] diff --git a/examples/breakout/breakout.rs b/examples/breakout/breakout.rs index 123817c..e57e2d7 100644 --- a/examples/breakout/breakout.rs +++ b/examples/breakout/breakout.rs @@ -61,6 +61,7 @@ struct CollisionEvent; #[derive(Component)] struct Score; +#[derive(Resource)] struct CollisionSound(Handle<AudioSource>); pub type BrickId = u64; @@ -152,7 +153,7 @@ fn main() { SystemSet::new() // https://github.com/bevyengine/bevy/issues/1839 // Run on a fixed Timestep,on all clients, in GameState::Running - .with_run_criteria(FixedTimestep::step(TIME_STEP as f64).chain( + .with_run_criteria(FixedTimestep::step(TIME_STEP as f64).pipe( |In(input): In<ShouldRun>, state: Res<State<GameState>>| match state.current() { GameState::Running => input, _ => ShouldRun::No, @@ -169,7 +170,7 @@ fn main() { SystemSet::new() // https://github.com/bevyengine/bevy/issues/1839 // Run on a fixed Timestep, only for the hosting client, in GameState::Running - .with_run_criteria(FixedTimestep::step(TIME_STEP as f64).chain( + .with_run_criteria(FixedTimestep::step(TIME_STEP as f64).pipe( |In(input): In<ShouldRun>, state: Res<State<GameState>>, server: Res<Server>| match state.current() { diff --git a/examples/breakout/client.rs b/examples/breakout/client.rs index 9546b26..eb7a8bb 100644 --- a/examples/breakout/client.rs +++ b/examples/breakout/client.rs @@ -4,13 +4,14 @@ use bevy::{ prelude::{ default, AssetServer, Audio, BuildChildren, Bundle, Button, ButtonBundle, Camera2dBundle, Changed, Color, Commands, Component, DespawnRecursiveExt, Entity, EventReader, EventWriter, - Input, KeyCode, Local, Query, Res, ResMut, State, TextBundle, Transform, Vec2, Vec3, With, - Without, + Input, KeyCode, Local, Query, Res, ResMut, Resource, State, TextBundle, Transform, Vec2, + Vec3, With, Without, }, sprite::{Sprite, SpriteBundle}, text::{Text, TextSection, TextStyle}, ui::{ - AlignItems, Interaction, JustifyContent, PositionType, Size, Style, UiColor, UiRect, Val, + AlignItems, BackgroundColor, Interaction, JustifyContent, PositionType, Size, Style, + UiRect, Val, }, }; use bevy_quinnet::{ @@ -45,22 +46,23 @@ const BOLD_FONT: &str = "fonts/FiraSans-Bold.ttf"; const NORMAL_FONT: &str = "fonts/FiraMono-Medium.ttf"; const COLLISION_SOUND_EFFECT: &str = "sounds/breakout_collision.ogg"; -#[derive(Debug, Clone, Default)] +#[derive(Resource, Debug, Clone, Default)] pub(crate) struct ClientData { self_id: ClientId, } -#[derive(Default)] +#[derive(Resource, Default)] pub(crate) struct NetworkMapping { // Network entity id to local entity id map: HashMap<Entity, Entity>, } -#[derive(Default)] +#[derive(Resource, Default)] pub struct BricksMapping { map: HashMap<BrickId, Entity>, } // This resource tracks the game's score +#[derive(Resource)] pub(crate) struct Scoreboard { pub(crate) score: i32, } @@ -104,44 +106,46 @@ pub(crate) fn start_connection(client: ResMut<Client>) { fn spawn_paddle(commands: &mut Commands, position: &Vec3, owned: bool) -> Entity { commands - .spawn() - .insert_bundle(SpriteBundle { - transform: Transform { - translation: *position, - scale: PADDLE_SIZE, - ..default() - }, - sprite: Sprite { - color: if owned { - PADDLE_COLOR - } else { - OPPONENT_PADDLE_COLOR + .spawn(( + SpriteBundle { + transform: Transform { + translation: *position, + scale: PADDLE_SIZE, + ..default() + }, + sprite: Sprite { + color: if owned { + PADDLE_COLOR + } else { + OPPONENT_PADDLE_COLOR + }, + ..default() }, ..default() }, - ..default() - }) - .insert(Paddle) + Paddle, + )) .id() } fn spawn_ball(commands: &mut Commands, pos: &Vec3, direction: &Vec2, owned: bool) -> Entity { commands - .spawn() - .insert(Ball) - .insert_bundle(SpriteBundle { - transform: Transform { - scale: BALL_SIZE, - translation: *pos, - ..default() - }, - sprite: Sprite { - color: ball_color_from_bool(owned), + .spawn(( + Ball, + SpriteBundle { + transform: Transform { + scale: BALL_SIZE, + translation: *pos, + ..default() + }, + sprite: Sprite { + color: ball_color_from_bool(owned), + ..default() + }, ..default() }, - ..default() - }) - .insert(Velocity(direction.normalize() * BALL_SPEED)) + Velocity(direction.normalize() * BALL_SPEED), + )) .id() } @@ -161,20 +165,21 @@ pub(crate) fn spawn_bricks( ); let brick = commands - .spawn() - .insert(Brick(brick_id)) - .insert_bundle(SpriteBundle { - sprite: Sprite { - color: BRICK_COLOR, - ..default() - }, - transform: Transform { - translation: brick_position.extend(0.0), - scale: Vec3::new(BRICK_SIZE.x, BRICK_SIZE.y, 1.0), + .spawn(( + Brick(brick_id), + SpriteBundle { + sprite: Sprite { + color: BRICK_COLOR, + ..default() + }, + transform: Transform { + translation: brick_position.extend(0.0), + scale: Vec3::new(BRICK_SIZE.x, BRICK_SIZE.y, 1.0), + ..default() + }, ..default() }, - ..default() - }) + )) .id(); bricks.map.insert(brick_id, brick); brick_id += 1; @@ -328,7 +333,7 @@ pub(crate) fn play_collision_sound( pub(crate) fn setup_main_menu(mut commands: Commands, asset_server: Res<AssetServer>) { // Camera - commands.spawn_bundle(Camera2dBundle::default()); + commands.spawn(Camera2dBundle::default()); let button_style = Style { size: Size::new(Val::Px(150.0), Val::Px(65.0)), @@ -346,30 +351,34 @@ pub(crate) fn setup_main_menu(mut commands: Commands, asset_server: Res<AssetSer color: BUTTON_TEXT_COLOR, }; commands - .spawn_bundle(ButtonBundle { - style: button_style.clone(), - color: NORMAL_BUTTON_COLOR.into(), - ..default() - }) - .insert(MenuItem::Host) + .spawn(( + ButtonBundle { + style: button_style.clone(), + background_color: NORMAL_BUTTON_COLOR.into(), + ..default() + }, + MenuItem::Host, + )) .with_children(|parent| { - parent.spawn_bundle(TextBundle::from_section("Host", text_style.clone())); + parent.spawn(TextBundle::from_section("Host", text_style.clone())); }); commands - .spawn_bundle(ButtonBundle { - style: button_style, - color: NORMAL_BUTTON_COLOR.into(), - ..default() - }) - .insert(MenuItem::Join) + .spawn(( + ButtonBundle { + style: button_style, + background_color: NORMAL_BUTTON_COLOR.into(), + ..default() + }, + MenuItem::Join, + )) .with_children(|parent| { - parent.spawn_bundle(TextBundle::from_section("Join", text_style)); + parent.spawn(TextBundle::from_section("Join", text_style)); }); } pub(crate) fn handle_menu_buttons( mut interaction_query: Query< - (&Interaction, &mut UiColor, &MenuItem), + (&Interaction, &mut BackgroundColor, &MenuItem), (Changed<Interaction>, With<Button>), >, mut game_state: ResMut<State<GameState>>, @@ -405,41 +414,39 @@ pub(crate) fn setup_breakout(mut commands: Commands, asset_server: Res<AssetServ commands.insert_resource(CollisionSound(ball_collision_sound)); // Scoreboard - commands - .spawn() - .insert_bundle( - TextBundle::from_sections([ - TextSection::new( - "Score: ", - TextStyle { - font: asset_server.load(BOLD_FONT), - font_size: SCOREBOARD_FONT_SIZE, - color: TEXT_COLOR, - }, - ), - TextSection::from_style(TextStyle { - font: asset_server.load(NORMAL_FONT), + commands.spawn(( + TextBundle::from_sections([ + TextSection::new( + "Score: ", + TextStyle { + font: asset_server.load(BOLD_FONT), font_size: SCOREBOARD_FONT_SIZE, - color: SCORE_COLOR, - }), - ]) - .with_style(Style { - position_type: PositionType::Absolute, - position: UiRect { - top: SCOREBOARD_TEXT_PADDING, - left: SCOREBOARD_TEXT_PADDING, - ..default() + color: TEXT_COLOR, }, - ..default() + ), + TextSection::from_style(TextStyle { + font: asset_server.load(NORMAL_FONT), + font_size: SCOREBOARD_FONT_SIZE, + color: SCORE_COLOR, }), - ) - .insert(Score); + ]) + .with_style(Style { + position_type: PositionType::Absolute, + position: UiRect { + top: SCOREBOARD_TEXT_PADDING, + left: SCOREBOARD_TEXT_PADDING, + ..default() + }, + ..default() + }), + Score, + )); // Walls - commands.spawn_bundle(WallBundle::new(WallLocation::Left)); - commands.spawn_bundle(WallBundle::new(WallLocation::Right)); - commands.spawn_bundle(WallBundle::new(WallLocation::Bottom)); - commands.spawn_bundle(WallBundle::new(WallLocation::Top)); + commands.spawn(WallBundle::new(WallLocation::Left)); + commands.spawn(WallBundle::new(WallLocation::Right)); + commands.spawn(WallBundle::new(WallLocation::Bottom)); + commands.spawn(WallBundle::new(WallLocation::Top)); } pub(crate) fn apply_velocity(mut query: Query<(&mut Transform, &Velocity), With<Ball>>) { diff --git a/examples/breakout/server.rs b/examples/breakout/server.rs index c4c20af..5ac1fc4 100644 --- a/examples/breakout/server.rs +++ b/examples/breakout/server.rs @@ -2,8 +2,8 @@ use std::collections::HashMap; use bevy::{ prelude::{ - default, Bundle, Commands, Component, Entity, EventReader, Query, ResMut, Transform, Vec2, - Vec3, With, + default, Bundle, Commands, Component, Entity, EventReader, Query, ResMut, Resource, + Transform, Vec2, Vec3, With, }, sprite::collide_aabb::{collide, Collision}, transform::TransformBundle, @@ -48,7 +48,7 @@ pub(crate) struct Player { input: PaddleInput, } -#[derive(Debug, Clone, Default)] +#[derive(Resource, Debug, Clone, Default)] pub(crate) struct Players { map: HashMap<ClientId, Player>, } @@ -298,10 +298,10 @@ fn start_game(commands: &mut Commands, server: &mut ResMut<Server>, players: &Re } // Spawn walls - commands.spawn_bundle(WallBundle::new(WallLocation::Left)); - commands.spawn_bundle(WallBundle::new(WallLocation::Right)); - commands.spawn_bundle(WallBundle::new(WallLocation::Bottom)); - commands.spawn_bundle(WallBundle::new(WallLocation::Top)); + commands.spawn(WallBundle::new(WallLocation::Left)); + commands.spawn(WallBundle::new(WallLocation::Right)); + commands.spawn(WallBundle::new(WallLocation::Bottom)); + commands.spawn(WallBundle::new(WallLocation::Top)); // Spawn bricks // Negative scales result in flipped sprites / meshes, @@ -352,18 +352,18 @@ fn start_game(commands: &mut Commands, server: &mut ResMut<Server>, players: &Re ); // brick - commands - .spawn() - .insert(Brick(brick_id)) - .insert_bundle(TransformBundle { + commands.spawn(( + Brick(brick_id), + TransformBundle { local: Transform { translation: brick_position.extend(0.0), scale: Vec3::new(BRICK_SIZE.x, BRICK_SIZE.y, 1.0), ..default() }, ..default() - }) - .insert(Collider); + }, + Collider, + )); brick_id += 1; } } @@ -388,19 +388,20 @@ fn start_game(commands: &mut Commands, server: &mut ResMut<Server>, players: &Re fn spawn_paddle(commands: &mut Commands, client_id: ClientId, pos: &Vec3) -> Entity { commands - .spawn() - .insert(Paddle { - player_id: client_id, - }) - .insert_bundle(TransformBundle { - local: Transform { - translation: *pos, - scale: PADDLE_SIZE, + .spawn(( + Paddle { + player_id: client_id, + }, + TransformBundle { + local: Transform { + translation: *pos, + scale: PADDLE_SIZE, + ..default() + }, ..default() }, - ..default() - }) - .insert(Collider) + Collider, + )) .id() } @@ -411,19 +412,20 @@ fn spawn_ball( direction: &Vec2, ) -> Entity { commands - .spawn() - .insert(Ball { - last_hit_by: client_id, - }) - .insert_bundle(TransformBundle { - local: Transform { - scale: BALL_SIZE, - translation: *pos, + .spawn(( + Ball { + last_hit_by: client_id, + }, + TransformBundle { + local: Transform { + scale: BALL_SIZE, + translation: *pos, + ..default() + }, ..default() }, - ..default() - }) - .insert(Velocity(direction.normalize() * BALL_SPEED)) + Velocity(direction.normalize() * BALL_SPEED), + )) .id() } diff --git a/examples/chat/client.rs b/examples/chat/client.rs index 0e6fad7..15d515a 100644 --- a/examples/chat/client.rs +++ b/examples/chat/client.rs @@ -7,7 +7,10 @@ use std::{ use bevy::{ app::{AppExit, ScheduleRunnerPlugin}, log::LogPlugin, - prelude::{info, warn, App, Commands, CoreStage, EventReader, EventWriter, Res, ResMut}, + prelude::{ + info, warn, App, Commands, CoreStage, Deref, DerefMut, EventReader, EventWriter, Res, + ResMut, Resource, + }, }; use bevy_quinnet::{ client::{ @@ -23,12 +26,15 @@ use protocol::{ClientMessage, ServerMessage}; mod protocol; -#[derive(Debug, Clone, Default)] +#[derive(Resource, Debug, Clone, Default)] struct Users { self_id: ClientId, names: HashMap<ClientId, String>, } +#[derive(Resource, Deref, DerefMut)] +struct TerminalReceiver(mpsc::Receiver<String>); + pub fn on_app_exit(app_exit_events: EventReader<AppExit>, client: Res<Client>) { if !app_exit_events.is_empty() { client.send_message(ClientMessage::Disconnect {}).unwrap(); @@ -76,7 +82,7 @@ fn handle_server_messages(mut client: ResMut<Client>, mut users: ResMut<Users>) fn handle_terminal_messages( client: ResMut<Client>, - mut terminal_messages: ResMut<mpsc::Receiver<String>>, + mut terminal_messages: ResMut<TerminalReceiver>, mut app_exit_events: EventWriter<AppExit>, ) { while let Ok(message) = terminal_messages.try_recv() { @@ -101,7 +107,7 @@ fn start_terminal_listener(mut commands: Commands) { .unwrap(); }); - commands.insert_resource(from_terminal_receiver); + commands.insert_resource(TerminalReceiver(from_terminal_receiver)); } fn start_connection(client: ResMut<Client>) { diff --git a/examples/chat/server.rs b/examples/chat/server.rs index 26fa75e..facaefa 100644 --- a/examples/chat/server.rs +++ b/examples/chat/server.rs @@ -13,7 +13,7 @@ use protocol::{ClientMessage, ServerMessage}; mod protocol; -#[derive(Debug, Clone, Default)] +#[derive(Resource, Debug, Clone, Default)] struct Users { names: HashMap<ClientId, String>, } @@ -54,7 +54,7 @@ fn handle_client_messages(mut server: ResMut<Server>, mut users: ResMut<Users>) } ClientMessage::Disconnect {} => { // We tell the server to disconnect this user - server.disconnect_client(client_id); + server.disconnect_client(client_id).unwrap(); handle_disconnect(&mut server, &mut users, client_id); } ClientMessage::ChatMessage { message } => { diff --git a/src/client.rs b/src/client.rs index 201a795..fe53398 100644 --- a/src/client.rs +++ b/src/client.rs @@ -12,7 +12,6 @@ use quinn::{ClientConfig, Endpoint}; use rustls::Certificate; use serde::Deserialize; use tokio::{ - runtime::Runtime, sync::{ broadcast, mpsc::{ @@ -25,7 +24,9 @@ use tokio::{ }; use tokio_util::codec::{FramedRead, FramedWrite, LengthDelimitedCodec}; -use crate::{QuinnetError, DEFAULT_KILL_MESSAGE_QUEUE_SIZE, DEFAULT_MESSAGE_QUEUE_SIZE}; +use crate::{ + AsyncRuntime, QuinnetError, DEFAULT_KILL_MESSAGE_QUEUE_SIZE, DEFAULT_MESSAGE_QUEUE_SIZE, +}; use self::certificate::{ load_known_hosts_store_from_config, CertVerificationStatus, CertVerifierAction, @@ -116,6 +117,7 @@ pub(crate) enum InternalSyncMessage { }, } +#[derive(Resource)] pub struct Client { state: ClientState, // TODO Perf: multiple channels @@ -335,7 +337,7 @@ async fn connection_task( } } -fn start_async_client(mut commands: Commands, runtime: Res<Runtime>) { +fn start_async_client(mut commands: Commands, runtime: Res<AsyncRuntime>) { let (from_server_sender, from_server_receiver) = mpsc::channel::<Bytes>(DEFAULT_MESSAGE_QUEUE_SIZE); let (to_server_sender, to_server_receiver) = mpsc::channel::<Bytes>(DEFAULT_MESSAGE_QUEUE_SIZE); @@ -440,13 +442,13 @@ impl Plugin for QuinnetClientPlugin { .add_startup_system_to_stage(StartupStage::PreStartup, start_async_client) .add_system(update_sync_client); - if app.world.get_resource_mut::<Runtime>().is_none() { - app.insert_resource( + if app.world.get_resource_mut::<AsyncRuntime>().is_none() { + app.insert_resource(AsyncRuntime( tokio::runtime::Builder::new_multi_thread() .enable_all() .build() .unwrap(), - ); + )); } } } @@ -1,3 +1,6 @@ +use bevy::prelude::{Deref, DerefMut, Resource}; +use tokio::runtime::Runtime; + pub const DEFAULT_MESSAGE_QUEUE_SIZE: usize = 150; pub const DEFAULT_KILL_MESSAGE_QUEUE_SIZE: usize = 10; pub const DEFAULT_KEEP_ALIVE_INTERVAL_S: u64 = 4; @@ -7,6 +10,9 @@ pub mod server; pub type ClientId = u64; +#[derive(Resource, Deref, DerefMut)] +pub(crate) struct AsyncRuntime(pub(crate) Runtime); + /// Enum with possibles errors that can occur in Bevy Quinnet #[derive(thiserror::Error, Debug)] pub enum QuinnetError { diff --git a/src/server.rs b/src/server.rs index ab2f9e9..ae7ae83 100644 --- a/src/server.rs +++ b/src/server.rs @@ -16,7 +16,6 @@ use futures_util::StreamExt; use quinn::{Endpoint, NewConnection, ServerConfig}; use serde::Deserialize; use tokio::{ - runtime::Runtime, sync::{ broadcast::{self}, mpsc::{self, error::TryRecvError}, @@ -26,8 +25,8 @@ use tokio::{ use tokio_util::codec::{FramedRead, FramedWrite, LengthDelimitedCodec}; use crate::{ - ClientId, QuinnetError, DEFAULT_KEEP_ALIVE_INTERVAL_S, DEFAULT_KILL_MESSAGE_QUEUE_SIZE, - DEFAULT_MESSAGE_QUEUE_SIZE, + AsyncRuntime, ClientId, QuinnetError, DEFAULT_KEEP_ALIVE_INTERVAL_S, + DEFAULT_KILL_MESSAGE_QUEUE_SIZE, DEFAULT_MESSAGE_QUEUE_SIZE, }; pub const DEFAULT_INTERNAL_MESSAGE_CHANNEL_SIZE: usize = 100; @@ -133,6 +132,7 @@ pub(crate) struct ClientConnection { close_sender: broadcast::Sender<()>, } +#[derive(Resource)] pub struct Server { clients: HashMap<ClientId, ClientConnection>, receiver: mpsc::Receiver<ClientPayload>, @@ -536,7 +536,7 @@ async fn connections_listening_task( } } -fn start_async_server(mut commands: Commands, runtime: Res<Runtime>) { +fn start_async_server(mut commands: Commands, runtime: Res<AsyncRuntime>) { // TODO Clean: Configure size let (from_clients_sender, from_clients_receiver) = mpsc::channel::<ClientPayload>(DEFAULT_MESSAGE_QUEUE_SIZE); @@ -615,13 +615,13 @@ impl Plugin for QuinnetServerPlugin { .add_startup_system_to_stage(StartupStage::PreStartup, start_async_server) .add_system_to_stage(CoreStage::PreUpdate, update_sync_server); - if app.world.get_resource_mut::<Runtime>().is_none() { - app.insert_resource( + if app.world.get_resource_mut::<AsyncRuntime>().is_none() { + app.insert_resource(AsyncRuntime( tokio::runtime::Builder::new_multi_thread() .enable_all() .build() .unwrap(), - ); + )); } } } |