diff --git a/.editorconfig b/.editorconfig index 054edd37..fd3b06ea 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,12 +12,8 @@ charset = utf-8 indent_style = space indent_size = 2 -# Rust -# https://github.com/rust-lang/rust/blob/master/src/doc/style/style/whitespace.md [*.rs] -indent_size = 4 insert_final_newline = false -trim_trailing_whitespace = true [*.{yaml,yml}] indent_style = space diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index a1a28965..b1201280 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -21,7 +21,7 @@ You should have received a copy of the GNU General Public License along with thi Any files depicting [Polyfrost branding](https://polyfrost.org/legal/branding), including the Polyfrost logo, any landing and background images, the OneConfig logo, the OneLauncher logo, and variations thereof, are licensed under the following: ```txt -All rights reserved. Copyright (C) 2022~2024 Polyfrost +All rights reserved. Copyright (C) 2022~CURRENT Polyfrost ``` This includes, but may not be limited to, the following files: @@ -31,9 +31,9 @@ This includes, but may not be limited to, the following files: ## Additional Libraries -The following are libraries, projects, and codebases which we (Polyfrost and Contributors) copied or modified from, with additional attribution inline (THIS IS A NON-EXHAUSTIVE LIST, IF WE ARE MISSING A LICENSE, PLEASE CHECK OUR [attributions page](https://polyfrost.org/attributions), OR LEAVE A TICKET IN [our Discord server](https://polyfrost.org/discord)): +The following are libraries, projects, and codebases which we (Polyfrost and Contributors) copied or modified, with additional attribution inline (THIS IS A NON-EXHAUSTIVE LIST, IF WE ARE MISSING A LICENSE, PLEASE CHECK OUR [attributions page](https://polyfrost.org/attributions), OR LEAVE A TICKET IN [our Discord server](https://polyfrost.org/discord)): -## Prism Launcher +## [Prism Launcher] ```txt Prism Launcher - Minecraft Launcher @@ -69,7 +69,7 @@ permission notice: limitations under the License. ``` -## Modrinth App +## [Modrinth App] ```txt Modrinth App diff --git a/Cargo.lock b/Cargo.lock index 0d64e498..8cbef63e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,9 +162,9 @@ checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ashpd" @@ -213,7 +213,7 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fec134f64e2bc57411226dfc4e52dec859ddfc7e711fc5e07b612584f000e4aa" dependencies = [ - "brotli 6.0.0", + "brotli", "bzip2", "deflate64", "flate2", @@ -309,7 +309,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -344,7 +344,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -556,17 +556,6 @@ dependencies = [ "piper", ] -[[package]] -name = "brotli" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor 2.5.1", -] - [[package]] name = "brotli" version = "6.0.0" @@ -575,17 +564,7 @@ checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", - "brotli-decompressor 4.0.1", -] - -[[package]] -name = "brotli-decompressor" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", + "brotli-decompressor", ] [[package]] @@ -679,9 +658,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3054fea8a20d8ff3968d5b22cc27501d2b08dc4decdb31b184323f00c5ef23bb" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] @@ -1173,7 +1152,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1183,7 +1162,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1219,7 +1198,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1243,7 +1222,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1254,7 +1233,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1315,7 +1294,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1328,7 +1307,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1431,7 +1410,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1454,7 +1433,7 @@ checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1625,7 +1604,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1760,6 +1739,15 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "fluent-uri" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "flume" version = "0.11.0" @@ -1793,7 +1781,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1899,7 +1887,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -2190,7 +2178,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -2280,7 +2268,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -2858,15 +2846,27 @@ dependencies = [ [[package]] name = "json-patch" -version = "1.4.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec9ad60d674508f3ca8f380a928cfe7b096bc729c4e2dbfe3852bc45da3ab30b" +checksum = "5b1fb8864823fad91877e6caea0baca82e49e8db50f8e5c9f9a453e27d3330fc" dependencies = [ + "jsonptr", "serde", "serde_json", "thiserror", ] +[[package]] +name = "jsonptr" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c6e529149475ca0b2820835d3dce8fcc41c6b943ca608d32f35b449255e4627" +dependencies = [ + "fluent-uri", + "serde", + "serde_json", +] + [[package]] name = "k256" version = "0.13.3" @@ -2962,9 +2962,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.156" +version = "0.2.157" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a" +checksum = "374af5f94e54fa97cf75e945cce8a6b201e88a1a07e688b47dfd2a59c66dbd86" [[package]] name = "libflate" @@ -3218,11 +3218,11 @@ dependencies = [ [[package]] name = "muda" -version = "0.13.5" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b959f97c97044e4c96e32e1db292a7d594449546a3c6b77ae613dc3a5b5145" +checksum = "86c410a9d21523a819e84881603fbc00331c8001eb899964952046671deddb9c" dependencies = [ - "cocoa 0.25.0", + "cocoa 0.26.0", "crossbeam-channel", "dpi", "gtk", @@ -3232,20 +3232,21 @@ dependencies = [ "png", "serde", "thiserror", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "ndk" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "jni-sys", + "log", "ndk-sys", "num_enum", - "raw-window-handle 0.5.2", + "raw-window-handle", "thiserror", ] @@ -3257,9 +3258,9 @@ checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" [[package]] name = "ndk-sys" -version = "0.4.1+23.1.7779620" +version = "0.6.0+11769913" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" dependencies = [ "jni-sys", ] @@ -3365,23 +3366,23 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.5.11" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.5.11" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 2.0.2", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.75", ] [[package]] @@ -3648,7 +3649,7 @@ name = "onelauncher_macros" version = "1.0.0-alpha.1" dependencies = [ "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -3927,7 +3928,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -3974,7 +3975,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -4331,12 +4332,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "raw-window-handle" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" - [[package]] name = "raw-window-handle" version = "0.6.2" @@ -4519,7 +4514,7 @@ dependencies = [ "objc", "objc-foundation", "objc_id", - "raw-window-handle 0.6.2", + "raw-window-handle", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -4698,7 +4693,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -4795,7 +4790,7 @@ checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -4806,7 +4801,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -4840,7 +4835,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -4891,7 +4886,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -5051,7 +5046,7 @@ dependencies = [ "objc2-app-kit", "objc2-foundation", "objc2-quartz-core", - "raw-window-handle 0.6.2", + "raw-window-handle", "redox_syscall 0.5.3", "wasm-bindgen", "web-sys", @@ -5120,7 +5115,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -5326,9 +5321,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.74" +version = "2.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" +checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" dependencies = [ "proc-macro2", "quote", @@ -5402,14 +5397,14 @@ dependencies = [ [[package]] name = "tao" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea538df05fbc2dcbbd740ba0cfe8607688535f4798d213cbbfa13ce494f3451f" +checksum = "6775bcf3c1da33f848ede9cff5883ed1e45a29f66533ce42ad06c93ae514ed59" dependencies = [ "bitflags 2.6.0", - "cocoa 0.25.0", - "core-foundation 0.9.4", - "core-graphics 0.23.2", + "cocoa 0.26.0", + "core-foundation 0.10.0", + "core-graphics 0.24.0", "crossbeam-channel", "dispatch", "dlopen2", @@ -5428,13 +5423,13 @@ dependencies = [ "objc", "once_cell", "parking_lot", - "raw-window-handle 0.6.2", + "raw-window-handle", "scopeguard", "tao-macros", "unicode-segmentation", "url", - "windows 0.57.0", - "windows-core 0.57.0", + "windows 0.58.0", + "windows-core 0.58.0", "windows-version", "x11-dl", ] @@ -5469,13 +5464,13 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.0.0-rc.2" +version = "2.0.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ee93e545e49458813d4ed16179c67ee6141dba140ec3d4f078dda3b8d4e0d1" +checksum = "79776954e2cd6b6c3b56e2cd99905a3a166017495a39ac8eb4c85dd8ea8704b4" dependencies = [ "anyhow", "bytes", - "cocoa 0.25.0", + "cocoa 0.26.0", "dirs 5.0.1", "dunce", "embed_plist", @@ -5494,7 +5489,7 @@ dependencies = [ "muda", "objc", "percent-encoding", - "raw-window-handle 0.6.2", + "raw-window-handle", "reqwest", "serde", "serde_json", @@ -5518,14 +5513,14 @@ dependencies = [ "webkit2gtk", "webview2-com", "window-vibrancy", - "windows 0.57.0", + "windows 0.58.0", ] [[package]] name = "tauri-build" -version = "2.0.0-rc.2" +version = "2.0.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96a58b3a716b51d7f671f729bb8c0a53cd2551eec8450c64e828ef4e6c9f948e" +checksum = "1fc103bde77870e08d5fc8765615b9615997827550b626fbc4ebbd7a1fbfe2a2" dependencies = [ "anyhow", "cargo_toml", @@ -5546,12 +5541,12 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.0.0-rc.2" +version = "2.0.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90a9e63ecd827d57228864764e0234935c9aac230099cf145197c8c08e754ced" +checksum = "ea061e6be9b37ab455eadc189f45617deafc85c94f78f9cd584862a6deaa83d1" dependencies = [ "base64 0.22.1", - "brotli 3.5.0", + "brotli", "ico", "json-patch", "plist", @@ -5562,7 +5557,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "syn 2.0.74", + "syn 2.0.75", "tauri-utils", "thiserror", "time", @@ -5573,23 +5568,23 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.0.0-rc.2" +version = "2.0.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a54f5d5b289aa6215ffcfed7d4ff9960a04b7a854436d04519a9fcf911050cba" +checksum = "9e20d6f6f96f55a43339c465b3c8205d71940372d54d7c665c5329e8e4ba35d0" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", "tauri-codegen", "tauri-utils", ] [[package]] name = "tauri-plugin" -version = "2.0.0-rc.2" +version = "2.0.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ce2ac5e182251ff932750d69c9b240a78e44901a7a6234814d63c595b43660" +checksum = "ec01af01098a286d3e430c1fa947bfd77bc8011ecb209438af4444b02d82b29e" dependencies = [ "anyhow", "glob", @@ -5604,9 +5599,9 @@ dependencies = [ [[package]] name = "tauri-plugin-clipboard-manager" -version = "2.0.0-rc.0" +version = "2.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a26868f7e05a09673e4172d23acb82cd48911cca092f0e8d06179a69e5024c" +checksum = "6719e5f3fcc6c6f5afda68da944a44a50c28f30a3506c457ea7dbcc13377bfe0" dependencies = [ "arboard", "image 0.24.9", @@ -5620,9 +5615,9 @@ dependencies = [ [[package]] name = "tauri-plugin-deep-link" -version = "2.0.0-rc.0" +version = "2.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db97f4b54f2e6f24681c3fffbcb7e9cfff24003b92bb8d3944a39072b8a1178" +checksum = "1c8e169df47aa4892184c812cc9753a486328835d38d2269a4b062179698a242" dependencies = [ "dunce", "log", @@ -5640,13 +5635,13 @@ dependencies = [ [[package]] name = "tauri-plugin-dialog" -version = "2.0.0-rc.0" +version = "2.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c538457a755a75b8bb1594ed40d1512f8f6386251d3fcde492f8f46768ec85b" +checksum = "fcf99017391fdc40b6c8ae0dae8d970cc8151a8177d48b8805f320f52cac0e3c" dependencies = [ "dunce", "log", - "raw-window-handle 0.6.2", + "raw-window-handle", "rfd", "serde", "serde_json", @@ -5677,9 +5672,9 @@ dependencies = [ [[package]] name = "tauri-plugin-shell" -version = "2.0.0-rc.0" +version = "2.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9209f6c32caec61e156a5616f7d80ba7683ca4a0a5641cbe5d3086ab371aaab2" +checksum = "2133e5c6fe2ae0263ff5920feed477d3b1413f89033f537966831b0cb6f61f8e" dependencies = [ "encoding_rs", "log", @@ -5713,9 +5708,9 @@ dependencies = [ [[package]] name = "tauri-plugin-updater" -version = "2.0.0-rc.0" +version = "2.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b5f10ba18d2fc65e16bdf053b7beccb621dcf880c52d2ab08bdeb2d685e3e14" +checksum = "8dfd104b50e1c17998fc131edd21ced948a9605bac7eb6827f94e099a644f924" dependencies = [ "base64 0.22.1", "dirs 5.0.1", @@ -5736,15 +5731,15 @@ dependencies = [ "time", "tokio", "url", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "zip", ] [[package]] name = "tauri-plugin-window-state" -version = "2.0.0-rc.0" +version = "2.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a86654a4937427217c7531594a60bede289e0e6d27baef0527d5678fb3d263a" +checksum = "eb6839228cbd225b95681c766cc51113e9dad62c4b3f6ebb102234413ba85ee2" dependencies = [ "bitflags 2.6.0", "log", @@ -5757,36 +5752,36 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.0.0-rc.2" +version = "2.0.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f01b129b1ebdf09563c354760dbe7c0e96a166b4e33362d9c8d207f527c7ea5" +checksum = "f4e736d3293f8347e5d2c5b250fe0e5b873499f5483578b139445dbbf802e2e5" dependencies = [ "dpi", "gtk", "http", "jni", - "raw-window-handle 0.6.2", + "raw-window-handle", "serde", "serde_json", "tauri-utils", "thiserror", "url", - "windows 0.57.0", + "windows 0.58.0", ] [[package]] name = "tauri-runtime-wry" -version = "2.0.0-rc.2" +version = "2.0.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcda27639094ace2bf25f00bc10e35ea4e3af2f92753b1bdd2a174d1fa5a6292" +checksum = "9fead81c1bd0205d5f02580e64f522704618274e784c2d1c127e4ba19acd0b79" dependencies = [ - "cocoa 0.25.0", + "cocoa 0.26.0", "gtk", "http", "jni", "log", "percent-encoding", - "raw-window-handle 0.6.2", + "raw-window-handle", "softbuffer", "tao", "tauri-runtime", @@ -5795,15 +5790,15 @@ dependencies = [ "url", "webkit2gtk", "webview2-com", - "windows 0.57.0", + "windows 0.58.0", "wry", ] [[package]] name = "tauri-specta" -version = "2.0.0-rc.16" +version = "2.0.0-rc.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc1bd0ddf756efcb3f5cd7987a169425a326a924156a7afdc4936804c5a7c7b7" +checksum = "0b37d5f9a690f0c5264e5461a2cd9a273565f9a12acf642692a16ea292e32f6b" dependencies = [ "heck 0.5.0", "serde", @@ -5825,17 +5820,17 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] name = "tauri-utils" -version = "2.0.0-rc.2" +version = "2.0.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28bb83cffa26e9cb7a2b3d0c31ab87bf277f44aaaa90f17159aef4d37aabd051" +checksum = "285af18e09665ea15fdda04cb28fb579a4d71b4e1640628489fecca98838ca9a" dependencies = [ "aes-gcm", - "brotli 3.5.0", + "brotli", "cargo_metadata", "ctor", "dunce", @@ -5923,7 +5918,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -6004,9 +5999,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.2" +version = "1.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" +checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" dependencies = [ "backtrace", "bytes", @@ -6029,7 +6024,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -6185,7 +6180,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -6240,22 +6235,23 @@ dependencies = [ [[package]] name = "tray-icon" -version = "0.14.3" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ad8319cca93189ea9ab1b290de0595960529750b6b8b501a399ed1ec3775d60" +checksum = "2b92252d649d771105448969f2b2dda4342ba48b77731b60d37c93665e26615b" dependencies = [ - "cocoa 0.25.0", - "core-graphics 0.23.2", + "core-graphics 0.24.0", "crossbeam-channel", "dirs 5.0.1", "libappindicator", "muda", - "objc", + "objc2", + "objc2-app-kit", + "objc2-foundation", "once_cell", "png", "serde", "thiserror", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6292,9 +6288,9 @@ dependencies = [ [[package]] name = "typeid" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "059d83cc991e7a42fc37bd50941885db0888e34209f8cfd9aab07ddec03bc9cf" +checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" [[package]] name = "typenum" @@ -6583,7 +6579,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", "wasm-bindgen-shared", ] @@ -6617,7 +6613,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6724,38 +6720,38 @@ dependencies = [ [[package]] name = "webview2-com" -version = "0.31.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6516cfa64c6b3212686080eeec378e662c2af54bb2a5b2a22749673f5cb2226f" +checksum = "6f61ff3d9d0ee4efcb461b14eb3acfda2702d10dc329f339303fc3e57215ae2c" dependencies = [ "webview2-com-macros", "webview2-com-sys", - "windows 0.57.0", - "windows-core 0.57.0", - "windows-implement", - "windows-interface", + "windows 0.58.0", + "windows-core 0.58.0", + "windows-implement 0.58.0", + "windows-interface 0.58.0", ] [[package]] name = "webview2-com-macros" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc" +checksum = "1d228f15bba3b9d56dde8bddbee66fa24545bd17b48d5128ccf4a8742b18e431" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] name = "webview2-com-sys" -version = "0.31.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c76d5b77320ff155660be1df3e6588bc85c75f1a9feef938cc4dc4dd60d1d7cf" +checksum = "a3a3e2eeb58f82361c93f9777014668eb3d07e7d174ee4c819575a9208011886" dependencies = [ "thiserror", - "windows 0.57.0", - "windows-core 0.57.0", + "windows 0.58.0", + "windows-core 0.58.0", ] [[package]] @@ -6814,7 +6810,7 @@ checksum = "d8cdd6999298d969289d8078dae02ce798ad23452075985cccba8b6326711ecf" dependencies = [ "cocoa 0.26.0", "objc", - "raw-window-handle 0.6.2", + "raw-window-handle", "windows-sys 0.59.0", "windows-version", ] @@ -6851,6 +6847,16 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -6866,12 +6872,25 @@ version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" dependencies = [ - "windows-implement", - "windows-interface", + "windows-implement 0.57.0", + "windows-interface 0.57.0", "windows-result 0.1.2", "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings", + "windows-targets 0.52.6", +] + [[package]] name = "windows-implement" version = "0.57.0" @@ -6880,7 +6899,18 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.75", ] [[package]] @@ -6891,7 +6921,18 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.75", ] [[package]] @@ -7207,14 +7248,14 @@ dependencies = [ [[package]] name = "wry" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b00c945786b02d7805d09a969fa36d0eee4e0bd4fb3ec2a79d2bf45a1b44cd" +checksum = "49b8049c8f239cdbfaaea4bacb9646f6b208938ceec0acd5b3e99cd05f70903f" dependencies = [ "base64 0.22.1", "block", - "cocoa 0.25.0", - "core-graphics 0.23.2", + "cocoa 0.26.0", + "core-graphics 0.24.0", "crossbeam-channel", "dpi", "dunce", @@ -7227,13 +7268,11 @@ dependencies = [ "kuchikiki", "libc", "ndk", - "ndk-context", - "ndk-sys", "objc", "objc_id", "once_cell", "percent-encoding", - "raw-window-handle 0.6.2", + "raw-window-handle", "sha2", "soup3", "tao-macros", @@ -7242,8 +7281,8 @@ dependencies = [ "webkit2gtk", "webkit2gtk-sys", "webview2-com", - "windows 0.57.0", - "windows-core 0.57.0", + "windows 0.58.0", + "windows-core 0.58.0", "windows-version", "x11-dl", ] @@ -7410,7 +7449,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -7431,7 +7470,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 3ba4625c..02eb480c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ onelauncher_gamemode = { path = "./packages/gamemode" } # # ============= TAURI ============= # # # tauri uses latest crates.io rc channel -tauri = { version = "=2.0.0-rc.2", features = [ +tauri = { version = "=2.0.0-rc.3", features = [ "rustls-tls", "tracing", "specta", @@ -39,21 +39,21 @@ tauri = { version = "=2.0.0-rc.2", features = [ ] } # tauri-build is the codegen utility for our tauri buildscript. -tauri-build = { version = "=2.0.0-rc.2" } +tauri-build = { version = "=2.0.0-rc.3" } # tauri-plugin-shell adds a bridge for opening urls and paths in the frontend. -tauri-plugin-shell = { version = "=2.0.0-rc.0" } +tauri-plugin-shell = { version = "=2.0.0-rc.1" } # tauri-plugin-window-state saves the window position and size to be restored. -tauri-plugin-window-state = { version = "=2.0.0-rc.0" } +tauri-plugin-window-state = { version = "=2.0.0-rc.1" } # tauri-plugin-single-instance ensures that only one instance of the app is running. tauri-plugin-single-instance = { version = "=2.0.0-rc.0" } # tauri-plugin-clipboard-manager adds a bridge for reading/writing to the clipboard. -tauri-plugin-clipboard-manager = { version = "=2.0.0-rc.0" } +tauri-plugin-clipboard-manager = { version = "=2.0.0-rc.1" } # tauri-plugin-updater allows for us to use it's functionality for in-app updates. -tauri-plugin-updater = { version = "=2.0.0-rc.0" } +tauri-plugin-updater = { version = "=2.0.0-rc.1" } # tauri-plugin-dialog adds a bridge for opening file manager and message dialogs. -tauri-plugin-dialog = { version = "=2.0.0-rc.0" } +tauri-plugin-dialog = { version = "=2.0.0-rc.1" } # tauri-plugin-deep-link adds a way to handle custom uri schemes (onelauncher://) -tauri-plugin-deep-link = { version = "=2.0.0-rc.0" } +tauri-plugin-deep-link = { version = "=2.0.0-rc.1" } # # ============= CORE ============= # # # rspc is used as a faster and more intuitive replacement for tauri-specta @@ -84,15 +84,11 @@ specta = { version = "=2.0.0-rc.20", features = [ ] } # tauri-specta is the tauri adapter for specta. -tauri-specta = { version = "=2.0.0-rc.16", features = [ "javascript", "typescript", "derive" ] } - +tauri-specta = { version = "=2.0.0-rc.17", features = [ "javascript", "typescript", "derive" ] } # specta-typescript is the typescript adapter for specta. specta-typescript = { version = "=0.0.7" } - # rspc-specta2 is the specta v2 (rc) adapter for rspc. rspc-tauri2 = { version = "=0.0.1" } - -# # ============= MINECRAFT ============= # # # core utilities for minecraft and mod management with pulseflow apis interpulse = { version = "1", features = [ "specta" ] } @@ -195,7 +191,7 @@ features = [ ] default-features = false -[patch.crates-io] # we hack to the high heavens +[patch.crates-io] # rspc = { git = "https://github.com/oscartbeaumont/rspc", rev = "9f26d6400affdb501837cb023678268ad72feb9b" } # rspc-tauri2 = { git = "https://github.com/specta-rs/tauri2", rev = "6b9419566e2a826fb2a62538c7647f4524ab0fea" } diff --git a/TODO.md b/TODO.md index e2fe641c..2a8ad6f5 100644 --- a/TODO.md +++ b/TODO.md @@ -4,6 +4,7 @@ - [ ] migrate api commands that currently use `tauri-specta` but don't actually rely on `tauri` to `rspc` - waiting on `rspc` to update to the latest version (hopefully once tauri comes out of rc) - [ ] bump `tauri` to stable v2 when it releases. + - [x] bump `tauri` to latest rc v2. - [ ] test all major version/loader combos launching and mod loading. - legacy fabric, babric, nilloader, java agent support - nilloader @@ -12,7 +13,7 @@ - [ ] better debug logging and mc logging, for the launcher and spawn - [ ] implement forgewrapper instead of processing ourselves - [ ] allow per-cluster sandboxing -- [ ] implement gamemode +- [x] implement gamemode - [ ] better toml support - [ ] make all tauri events into tauri_specta events - [ ] apple and windows signing diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 4c34fd57..bbd1851a 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -23,6 +23,6 @@ "@onelauncher/frontend": "workspace:*" }, "devDependencies": { - "@tauri-apps/cli": "=2.0.0-rc.3" + "@tauri-apps/cli": "=2.0.0-rc.4" } } diff --git a/apps/frontend/package.json b/apps/frontend/package.json index d7e572b1..c054d4e6 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -28,7 +28,7 @@ "@solidjs/router": "^0.14.3", "@t3-oss/env-core": "^0.11.0", "@tanstack/solid-query": "^5.51.21", - "@tauri-apps/api": "=2.0.0-rc.0", + "@tauri-apps/api": "=2.0.0-rc.1", "@tauri-apps/plugin-clipboard-manager": "=2.0.0-rc.0", "@tauri-apps/plugin-dialog": "=2.0.0-rc.0", "@tauri-apps/plugin-shell": "=2.0.0-rc.0", @@ -47,7 +47,7 @@ "devDependencies": { "@sentry/vite-plugin": "^2.22.2", "@solidjs/testing-library": "^0.8.9", - "@tauri-apps/cli": "=2.0.0-rc.3", + "@tauri-apps/cli": "=2.0.0-rc.4", "@testing-library/jest-dom": "^6.4.8", "@types/uuid": "^10.0.0", "jsdom": "^24.1.1", diff --git a/package.json b/package.json index 25c5f778..b49f43a0 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ }, "devDependencies": { "@flowr/eslint-config": "^3.12.1", - "@types/node": "^22.4.0", + "@types/node": "^22.4.1", "@unocss/eslint-plugin": "^0.62.2", "@vitest/ui": "^2.0.5", "bumpp": "^9.5.1", diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml index 66d5ca4b..b9b831b1 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -19,22 +19,13 @@ specta = [ "dep:specta" ] cli = [ "dep:indicatif" ] [dependencies] +# features[default] onelauncher_macros = { workspace = true } - -# GUI-only deps -tauri = { workspace = true, optional = true } -tauri-specta = { workspace = true, optional = true } -specta = { workspace = true, optional = true } - -# CLI-only deps -indicatif = { workspace = true, optional = true } interpulse = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } tracing-error = { workspace = true } tracing-appender = { workspace = true } - -# we use notify to track instance directories (i.e. if a user uses a file manager to change managed files, or if a crash happens) notify = { workspace = true } notify-debouncer-mini = { workspace = true } iota_stronghold = { workspace = true } @@ -74,8 +65,18 @@ base64 = { workspace = true } async-compression = { workspace = true } flate2 = { workspace = true } -[target.'cfg(windows)'.dependencies] +# features[tauri] +tauri = { workspace = true, optional = true } +tauri-specta = { workspace = true, optional = true } + +# features[specta] +specta = { workspace = true, optional = true } + +# features[cli] +indicatif = { workspace = true, optional = true } + +[target.'cfg(target_os = "windows")'.dependencies] winreg = { workspace = true } -[target.'cfg(linux)'.dependencies] +[target.'cfg(target_os = "linux")'.dependencies] onelauncher_gamemode = { workspace = true } diff --git a/packages/core/src/game/metadata.rs b/packages/core/src/game/metadata.rs index 98428dbc..80a4fb77 100644 --- a/packages/core/src/game/metadata.rs +++ b/packages/core/src/game/metadata.rs @@ -244,6 +244,7 @@ pub async fn download_libraries( }?; let num_files = libraries.len(); + // TODO: figure out why rustfmt won't format this (it's not a macro...) ingress_try_for_each( stream::iter(libraries.iter()) .map(Ok::<&Library, crate::Error>), diff --git a/packages/core/src/game/mod.rs b/packages/core/src/game/mod.rs index c7cfdab4..5cffcace 100644 --- a/packages/core/src/game/mod.rs +++ b/packages/core/src/game/mod.rs @@ -370,19 +370,17 @@ pub async fn launch_minecraft( ) .current_dir(instance_path.clone()); - // when cargo makes the DYLD_LIBRARY_PATH it breaks Minecraft + // when cargo sets the `DYLD_LIBRARY_PATH`` it breaks Minecraft #[cfg(target_os = "macos")] if std::env::var("CARGO").is_ok() { command.env_remove("DYLD_FALLBACK_LIBRARY_PATH"); } - // remove preexisting Java options, as they should be set in the cluster settings. + // remove pre-existing java options, as they should be set in the cluster settings. command.env_remove("_JAVA_OPTIONS"); command.envs(env_args); // overrides `options.txt` with our settings: i can't believe it's not yaml - use regex::Regex; - if !mc_options.is_empty() { let options_path = instance_path.join("options.txt"); let mut options_string = String::new(); @@ -390,7 +388,7 @@ pub async fn launch_minecraft( options_string = io::read_to_string(&options_path).await?; } for (key, value) in mc_options { - let re = Regex::new(&format!(r"(?m)^{}:.*$", regex::escape(key)))?; + let re = regex::Regex::new(&format!(r"(?m)^{}:.*$", regex::escape(key)))?; if !re.is_match(&options_string) { options_string.push_str(&format!("\n{}:{}", key, value)); } else { @@ -456,6 +454,7 @@ pub async fn launch_minecraft( .await; } + let enable_gamemode = state.settings.read().await.enable_gamemode; let mut state_processor = state.processor.write().await; state_processor .insert_process( @@ -465,6 +464,7 @@ pub async fn launch_minecraft( post_hook, censors, Some(credentials.id), + Some(enable_gamemode), ) .await } diff --git a/packages/core/src/store/processor.rs b/packages/core/src/store/processor.rs index 64bbe61f..fe192a38 100644 --- a/packages/core/src/store/processor.rs +++ b/packages/core/src/store/processor.rs @@ -426,6 +426,7 @@ impl Processor { #[tracing::instrument(skip(self, uuid, command, post, censors))] #[tracing::instrument(level = "trace", skip(self))] #[onelauncher_macros::memory] + #[allow(clippy::too_many_arguments)] pub async fn insert_process( &mut self, uuid: Uuid, @@ -434,6 +435,7 @@ impl Processor { post: Option, censors: HashMap, user: Option, + enable_gamemode: Option, ) -> crate::Result>> { command .stdout(Stdio::piped()) @@ -449,10 +451,14 @@ impl Processor { let stdout = proc.stdout.take().unwrap(); let stderr = proc.stderr.take().unwrap(); - // #[cfg(target_os = "linux")] - // { - // onelauncher_gamemode:: - // } + #[cfg(target_os = "linux")] + { + if enable_gamemode.is_some_and(|x| x == true) { + // TODO: maybe just ignore the error...? + onelauncher_gamemode::request_start_for_wrapper(pid) + .map_err(|e| anyhow::anyhow!("failed to enable gamemode: {e}"))?; + } + } tokio::spawn(async move { let mut stdout = BufReader::new(stdout).lines(); diff --git a/packages/core/src/store/settings.rs b/packages/core/src/store/settings.rs index 5096011c..30f9a11c 100644 --- a/packages/core/src/store/settings.rs +++ b/packages/core/src/store/settings.rs @@ -24,6 +24,9 @@ pub struct Settings { /// Whether to allow launching the same cluster under the same account. #[serde(default)] pub allow_parallel_running_clusters: bool, + /// Whether to launch Feral Gamemode on Linux systems. + #[serde(default)] + pub enable_gamemode: bool, /// A global default [`Resolution`] for Minecraft. pub resolution: Resolution, /// A global [`JavaVersions`] list and default version. @@ -99,6 +102,10 @@ impl Settings { disable_animations: false, force_fullscreen: false, allow_parallel_running_clusters: false, + #[cfg(target_os = "linux")] + enable_gamemode: true, + #[cfg(not(target_os = "linux"))] + enable_gamemode: false, resolution: Resolution::default(), java_versions: JavaVersions::new(), memory: Memory::default(), diff --git a/packages/core/src/utils/java.rs b/packages/core/src/utils/java.rs index cdb0a5a0..d333aa70 100644 --- a/packages/core/src/utils/java.rs +++ b/packages/core/src/utils/java.rs @@ -283,7 +283,7 @@ pub async fn check_java_instance(path: &Path) -> Option { .output() .ok()?; let stdout = String::from_utf8_lossy(&output.stdout); - tracing::info!("{}", stdout); + tracing::debug!("{stdout}"); let mut java_version = None; let mut java_arch = None; diff --git a/packages/gamemode/src/lib.rs b/packages/gamemode/src/lib.rs index e19f3600..370d8271 100644 --- a/packages/gamemode/src/lib.rs +++ b/packages/gamemode/src/lib.rs @@ -8,16 +8,17 @@ extern "C" { pub fn request_start_for_wrapper(pid: u32) -> Result<(), String> { match pid.try_into() { - Ok(signed) => { - unsafe { - let result = gamemode_request_start_for_wrapper(signed); - if result == 0 { - Ok(()) - } else { - Err(format!("failed to request gamemode for pid {}: {}", pid, result)) - } + Ok(signed) => unsafe { + let result = gamemode_request_start_for_wrapper(signed); + if result == 0 { + Ok(()) + } else { + Err(format!( + "failed to request gamemode for pid {}: {}", + pid, result + )) } - } + }, Err(e) => Err(format!("failed to request gamemode for pid {}: {}", pid, e)), } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c75a6706..3cc66b82 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,10 +10,10 @@ importers: devDependencies: '@flowr/eslint-config': specifier: ^3.12.1 - version: 3.12.1(@typescript-eslint/utils@8.1.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(@unocss/eslint-plugin@0.62.2(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint-plugin-solid@0.14.2(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint-plugin-vue@9.27.0(eslint@9.9.0(jiti@1.21.6)))(eslint-processor-vue-blocks@0.1.2(@vue/compiler-sfc@3.4.38)(eslint@9.9.0(jiti@1.21.6)))(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4)(vitest@2.0.5(@types/node@22.4.0)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8))(vue-eslint-parser@9.4.3(eslint@9.9.0(jiti@1.21.6))) + version: 3.12.1(@typescript-eslint/utils@8.1.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(@unocss/eslint-plugin@0.62.2(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint-plugin-solid@0.14.2(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint-plugin-vue@9.27.0(eslint@9.9.0(jiti@1.21.6)))(eslint-processor-vue-blocks@0.1.2(@vue/compiler-sfc@3.4.38)(eslint@9.9.0(jiti@1.21.6)))(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4)(vitest@2.0.5(@types/node@22.4.1)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8))(vue-eslint-parser@9.4.3(eslint@9.9.0(jiti@1.21.6))) '@types/node': - specifier: ^22.4.0 - version: 22.4.0 + specifier: ^22.4.1 + version: 22.4.1 '@unocss/eslint-plugin': specifier: ^0.62.2 version: 0.62.2(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) @@ -34,7 +34,7 @@ importers: version: 1.21.6 ts-node: specifier: ^10.9.2 - version: 10.9.2(@types/node@22.4.0)(typescript@5.5.4) + version: 10.9.2(@types/node@22.4.1)(typescript@5.5.4) tsx: specifier: ^4.17.0 version: 4.17.0 @@ -43,10 +43,10 @@ importers: version: 5.5.4 vite: specifier: ^5.4.1 - version: 5.4.1(@types/node@22.4.0)(sass@1.77.8) + version: 5.4.1(@types/node@22.4.1)(sass@1.77.8) vitest: specifier: ^2.0.5 - version: 2.0.5(@types/node@22.4.0)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8) + version: 2.0.5(@types/node@22.4.1)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8) .github/actions/clippy: dependencies: @@ -215,16 +215,16 @@ importers: version: 1.77.8 unocss: specifier: ^0.62.2 - version: 0.62.2(postcss@8.4.41)(rollup@4.21.0)(vite@5.4.1(@types/node@22.4.0)(sass@1.77.8)) + version: 0.62.2(postcss@8.4.41)(rollup@4.21.0)(vite@5.4.1(@types/node@22.4.1)(sass@1.77.8)) vite-plugin-solid: specifier: ^2.10.2 - version: 2.10.2(@testing-library/jest-dom@6.4.8)(solid-js@1.8.21)(vite@5.4.1(@types/node@22.4.0)(sass@1.77.8)) + version: 2.10.2(@testing-library/jest-dom@6.4.8)(solid-js@1.8.21)(vite@5.4.1(@types/node@22.4.1)(sass@1.77.8)) vite-plugin-solid-svg: specifier: ^0.8.1 - version: 0.8.1(solid-js@1.8.21)(vite@5.4.1(@types/node@22.4.0)(sass@1.77.8)) + version: 0.8.1(solid-js@1.8.21)(vite@5.4.1(@types/node@22.4.1)(sass@1.77.8)) vite-tsconfig-paths: specifier: ^5.0.1 - version: 5.0.1(typescript@5.5.4)(vite@5.4.1(@types/node@22.4.0)(sass@1.77.8)) + version: 5.0.1(typescript@5.5.4)(vite@5.4.1(@types/node@22.4.1)(sass@1.77.8)) apps/testing: {} @@ -1635,8 +1635,8 @@ packages: '@types/node@20.14.10': resolution: {integrity: sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==} - '@types/node@22.4.0': - resolution: {integrity: sha512-49AbMDwYUz7EXxKU/r7mXOsxwFr4BYbvB7tWYxVuLdb2ibd30ijjXINSMAHiEEZk5PCRBmW1gUeisn2VMKt3cQ==} + '@types/node@22.4.1': + resolution: {integrity: sha512-1tbpb9325+gPnKK0dMm+/LMriX0vKxf6RnB0SZUqfyVkQ4fMgUSySqhxE/y8Jvs4NyF1yHzTfG9KlnkIODxPKg==} '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -4988,7 +4988,7 @@ snapshots: '@fastify/busboy@2.1.1': {} - '@flowr/eslint-config@3.12.1(@typescript-eslint/utils@8.1.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(@unocss/eslint-plugin@0.62.2(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint-plugin-solid@0.14.2(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint-plugin-vue@9.27.0(eslint@9.9.0(jiti@1.21.6)))(eslint-processor-vue-blocks@0.1.2(@vue/compiler-sfc@3.4.38)(eslint@9.9.0(jiti@1.21.6)))(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4)(vitest@2.0.5(@types/node@22.4.0)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8))(vue-eslint-parser@9.4.3(eslint@9.9.0(jiti@1.21.6)))': + '@flowr/eslint-config@3.12.1(@typescript-eslint/utils@8.1.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(@unocss/eslint-plugin@0.62.2(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint-plugin-solid@0.14.2(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint-plugin-vue@9.27.0(eslint@9.9.0(jiti@1.21.6)))(eslint-processor-vue-blocks@0.1.2(@vue/compiler-sfc@3.4.38)(eslint@9.9.0(jiti@1.21.6)))(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4)(vitest@2.0.5(@types/node@22.4.1)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8))(vue-eslint-parser@9.4.3(eslint@9.9.0(jiti@1.21.6)))': dependencies: '@antfu/install-pkg': 0.3.5 '@clack/prompts': 0.7.0 @@ -4996,7 +4996,7 @@ snapshots: '@stylistic/eslint-plugin': 2.6.4(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) '@typescript-eslint/eslint-plugin': 8.1.0(@typescript-eslint/parser@8.1.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) '@typescript-eslint/parser': 8.1.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) - '@vitest/eslint-plugin': 1.0.3(@typescript-eslint/utils@8.1.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4)(vitest@2.0.5(@types/node@22.4.0)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8)) + '@vitest/eslint-plugin': 1.0.3(@typescript-eslint/utils@8.1.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4)(vitest@2.0.5(@types/node@22.4.1)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8)) eslint: 9.9.0(jiti@1.21.6) eslint-flat-config-utils: 0.3.0 eslint-merge-processors: 0.1.0(eslint@9.9.0(jiti@1.21.6)) @@ -5662,7 +5662,7 @@ snapshots: dependencies: undici-types: 5.26.5 - '@types/node@22.4.0': + '@types/node@22.4.1': dependencies: undici-types: 6.19.6 @@ -5800,13 +5800,13 @@ snapshots: '@typescript-eslint/types': 8.1.0 eslint-visitor-keys: 3.4.3 - '@unocss/astro@0.62.2(rollup@4.21.0)(vite@5.4.1(@types/node@22.4.0)(sass@1.77.8))': + '@unocss/astro@0.62.2(rollup@4.21.0)(vite@5.4.1(@types/node@22.4.1)(sass@1.77.8))': dependencies: '@unocss/core': 0.62.2 '@unocss/reset': 0.62.2 - '@unocss/vite': 0.62.2(rollup@4.21.0)(vite@5.4.1(@types/node@22.4.0)(sass@1.77.8)) + '@unocss/vite': 0.62.2(rollup@4.21.0)(vite@5.4.1(@types/node@22.4.1)(sass@1.77.8)) optionalDependencies: - vite: 5.4.1(@types/node@22.4.0)(sass@1.77.8) + vite: 5.4.1(@types/node@22.4.1)(sass@1.77.8) transitivePeerDependencies: - rollup - supports-color @@ -5955,7 +5955,7 @@ snapshots: dependencies: '@unocss/core': 0.62.2 - '@unocss/vite@0.62.2(rollup@4.21.0)(vite@5.4.1(@types/node@22.4.0)(sass@1.77.8))': + '@unocss/vite@0.62.2(rollup@4.21.0)(vite@5.4.1(@types/node@22.4.1)(sass@1.77.8))': dependencies: '@ampproject/remapping': 2.3.0 '@rollup/pluginutils': 5.1.0(rollup@4.21.0) @@ -5967,7 +5967,7 @@ snapshots: chokidar: 3.6.0 magic-string: 0.30.11 tinyglobby: 0.2.2 - vite: 5.4.1(@types/node@22.4.0)(sass@1.77.8) + vite: 5.4.1(@types/node@22.4.1)(sass@1.77.8) transitivePeerDependencies: - rollup - supports-color @@ -5978,13 +5978,13 @@ snapshots: '@vercel/ncc@0.38.1': {} - '@vitest/eslint-plugin@1.0.3(@typescript-eslint/utils@8.1.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4)(vitest@2.0.5(@types/node@22.4.0)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8))': + '@vitest/eslint-plugin@1.0.3(@typescript-eslint/utils@8.1.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4)(vitest@2.0.5(@types/node@22.4.1)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8))': dependencies: eslint: 9.9.0(jiti@1.21.6) optionalDependencies: '@typescript-eslint/utils': 8.1.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) typescript: 5.5.4 - vitest: 2.0.5(@types/node@22.4.0)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8) + vitest: 2.0.5(@types/node@22.4.1)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8) '@vitest/expect@2.0.5': dependencies: @@ -6021,7 +6021,7 @@ snapshots: pathe: 1.1.2 sirv: 2.0.4 tinyrainbow: 1.2.0 - vitest: 2.0.5(@types/node@22.4.0)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8) + vitest: 2.0.5(@types/node@22.4.1)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8) '@vitest/utils@2.0.5': dependencies: @@ -8173,14 +8173,14 @@ snapshots: dependencies: typescript: 5.5.4 - ts-node@10.9.2(@types/node@22.4.0)(typescript@5.5.4): + ts-node@10.9.2(@types/node@22.4.1)(typescript@5.5.4): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 22.4.0 + '@types/node': 22.4.1 acorn: 8.11.3 acorn-walk: 8.3.2 arg: 4.1.3 @@ -8269,9 +8269,9 @@ snapshots: universalify@0.2.0: {} - unocss@0.62.2(postcss@8.4.41)(rollup@4.21.0)(vite@5.4.1(@types/node@22.4.0)(sass@1.77.8)): + unocss@0.62.2(postcss@8.4.41)(rollup@4.21.0)(vite@5.4.1(@types/node@22.4.1)(sass@1.77.8)): dependencies: - '@unocss/astro': 0.62.2(rollup@4.21.0)(vite@5.4.1(@types/node@22.4.0)(sass@1.77.8)) + '@unocss/astro': 0.62.2(rollup@4.21.0)(vite@5.4.1(@types/node@22.4.1)(sass@1.77.8)) '@unocss/cli': 0.62.2(rollup@4.21.0) '@unocss/core': 0.62.2 '@unocss/extractor-arbitrary-variants': 0.62.2 @@ -8290,9 +8290,9 @@ snapshots: '@unocss/transformer-compile-class': 0.62.2 '@unocss/transformer-directives': 0.62.2 '@unocss/transformer-variant-group': 0.62.2 - '@unocss/vite': 0.62.2(rollup@4.21.0)(vite@5.4.1(@types/node@22.4.0)(sass@1.77.8)) + '@unocss/vite': 0.62.2(rollup@4.21.0)(vite@5.4.1(@types/node@22.4.1)(sass@1.77.8)) optionalDependencies: - vite: 5.4.1(@types/node@22.4.0)(sass@1.77.8) + vite: 5.4.1(@types/node@22.4.1)(sass@1.77.8) transitivePeerDependencies: - postcss - rollup @@ -8348,13 +8348,13 @@ snapshots: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 - vite-node@2.0.5(@types/node@22.4.0)(sass@1.77.8): + vite-node@2.0.5(@types/node@22.4.1)(sass@1.77.8): dependencies: cac: 6.7.14 debug: 4.3.6 pathe: 1.1.2 tinyrainbow: 1.2.0 - vite: 5.4.1(@types/node@22.4.0)(sass@1.77.8) + vite: 5.4.1(@types/node@22.4.1)(sass@1.77.8) transitivePeerDependencies: - '@types/node' - less @@ -8366,13 +8366,13 @@ snapshots: - supports-color - terser - vite-plugin-solid-svg@0.8.1(solid-js@1.8.21)(vite@5.4.1(@types/node@22.4.0)(sass@1.77.8)): + vite-plugin-solid-svg@0.8.1(solid-js@1.8.21)(vite@5.4.1(@types/node@22.4.1)(sass@1.77.8)): dependencies: solid-js: 1.8.21 svgo: 3.3.2 - vite: 5.4.1(@types/node@22.4.0)(sass@1.77.8) + vite: 5.4.1(@types/node@22.4.1)(sass@1.77.8) - vite-plugin-solid@2.10.2(@testing-library/jest-dom@6.4.8)(solid-js@1.8.21)(vite@5.4.1(@types/node@22.4.0)(sass@1.77.8)): + vite-plugin-solid@2.10.2(@testing-library/jest-dom@6.4.8)(solid-js@1.8.21)(vite@5.4.1(@types/node@22.4.1)(sass@1.77.8)): dependencies: '@babel/core': 7.24.9 '@types/babel__core': 7.20.5 @@ -8380,39 +8380,39 @@ snapshots: merge-anything: 5.1.7 solid-js: 1.8.21 solid-refresh: 0.6.3(solid-js@1.8.21) - vite: 5.4.1(@types/node@22.4.0)(sass@1.77.8) - vitefu: 0.2.5(vite@5.4.1(@types/node@22.4.0)(sass@1.77.8)) + vite: 5.4.1(@types/node@22.4.1)(sass@1.77.8) + vitefu: 0.2.5(vite@5.4.1(@types/node@22.4.1)(sass@1.77.8)) optionalDependencies: '@testing-library/jest-dom': 6.4.8 transitivePeerDependencies: - supports-color - vite-tsconfig-paths@5.0.1(typescript@5.5.4)(vite@5.4.1(@types/node@22.4.0)(sass@1.77.8)): + vite-tsconfig-paths@5.0.1(typescript@5.5.4)(vite@5.4.1(@types/node@22.4.1)(sass@1.77.8)): dependencies: debug: 4.3.6 globrex: 0.1.2 tsconfck: 3.1.1(typescript@5.5.4) optionalDependencies: - vite: 5.4.1(@types/node@22.4.0)(sass@1.77.8) + vite: 5.4.1(@types/node@22.4.1)(sass@1.77.8) transitivePeerDependencies: - supports-color - typescript - vite@5.4.1(@types/node@22.4.0)(sass@1.77.8): + vite@5.4.1(@types/node@22.4.1)(sass@1.77.8): dependencies: esbuild: 0.21.5 postcss: 8.4.41 rollup: 4.20.0 optionalDependencies: - '@types/node': 22.4.0 + '@types/node': 22.4.1 fsevents: 2.3.3 sass: 1.77.8 - vitefu@0.2.5(vite@5.4.1(@types/node@22.4.0)(sass@1.77.8)): + vitefu@0.2.5(vite@5.4.1(@types/node@22.4.1)(sass@1.77.8)): optionalDependencies: - vite: 5.4.1(@types/node@22.4.0)(sass@1.77.8) + vite: 5.4.1(@types/node@22.4.1)(sass@1.77.8) - vitest@2.0.5(@types/node@22.4.0)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8): + vitest@2.0.5(@types/node@22.4.1)(@vitest/ui@2.0.5)(jsdom@24.1.1)(sass@1.77.8): dependencies: '@ampproject/remapping': 2.3.0 '@vitest/expect': 2.0.5 @@ -8430,11 +8430,11 @@ snapshots: tinybench: 2.8.0 tinypool: 1.0.0 tinyrainbow: 1.2.0 - vite: 5.4.1(@types/node@22.4.0)(sass@1.77.8) - vite-node: 2.0.5(@types/node@22.4.0)(sass@1.77.8) + vite: 5.4.1(@types/node@22.4.1)(sass@1.77.8) + vite-node: 2.0.5(@types/node@22.4.1)(sass@1.77.8) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 22.4.0 + '@types/node': 22.4.1 '@vitest/ui': 2.0.5(vitest@2.0.5) jsdom: 24.1.1 transitivePeerDependencies: