aboutsummaryrefslogtreecommitdiff
path: root/console
diff options
context:
space:
mode:
author1992414357@qq.com <1992414357@qq.com>2025-05-27 07:21:37 +0800
committer1992414357@qq.com <1992414357@qq.com>2025-05-27 07:21:37 +0800
commitf8336ed832fa8e1ddd2f1783bdfc23d3279d5e6a (patch)
tree42097cd72e46736ac3a544bd3d6dc50e2327a677 /console
First commit
Diffstat (limited to 'console')
-rw-r--r--console/Cargo.lock1482
-rw-r--r--console/Cargo.toml18
-rw-r--r--console/src/bin/nogpadc.rs436
-rw-r--r--console/src/bin/nogpads.rs257
4 files changed, 2193 insertions, 0 deletions
diff --git a/console/Cargo.lock b/console/Cargo.lock
new file mode 100644
index 0000000..17c623e
--- /dev/null
+++ b/console/Cargo.lock
@@ -0,0 +1,1482 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 4
+
+[[package]]
+name = "addr2line"
+version = "0.24.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1"
+dependencies = [
+ "gimli",
+]
+
+[[package]]
+name = "adler2"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
+
+[[package]]
+name = "aho-corasick"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "android-tzdata"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
+
+[[package]]
+name = "android_system_properties"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "anstream"
+version = "0.6.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b"
+dependencies = [
+ "anstyle",
+ "anstyle-parse",
+ "anstyle-query",
+ "anstyle-wincon",
+ "colorchoice",
+ "is_terminal_polyfill",
+ "utf8parse",
+]
+
+[[package]]
+name = "anstyle"
+version = "1.0.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9"
+
+[[package]]
+name = "anstyle-parse"
+version = "0.2.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9"
+dependencies = [
+ "utf8parse",
+]
+
+[[package]]
+name = "anstyle-query"
+version = "1.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c"
+dependencies = [
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "anstyle-wincon"
+version = "3.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e"
+dependencies = [
+ "anstyle",
+ "once_cell",
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "autocfg"
+version = "1.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
+
+[[package]]
+name = "backtrace"
+version = "0.3.75"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002"
+dependencies = [
+ "addr2line",
+ "cfg-if",
+ "libc",
+ "miniz_oxide",
+ "object",
+ "rustc-demangle",
+ "windows-targets",
+]
+
+[[package]]
+name = "bincode"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740"
+dependencies = [
+ "bincode_derive",
+ "serde",
+ "unty",
+]
+
+[[package]]
+name = "bincode_derive"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09"
+dependencies = [
+ "virtue",
+]
+
+[[package]]
+name = "bitflags"
+version = "2.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
+
+[[package]]
+name = "block-buffer"
+version = "0.10.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
+dependencies = [
+ "generic-array",
+]
+
+[[package]]
+name = "bumpalo"
+version = "3.17.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf"
+
+[[package]]
+name = "bytes"
+version = "1.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
+
+[[package]]
+name = "cc"
+version = "1.2.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5f4ac86a9e5bc1e2b3449ab9d7d3a6a405e3d1bb28d7b9be8614f55846ae3766"
+dependencies = [
+ "shlex",
+]
+
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "cfg_aliases"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
+
+[[package]]
+name = "chrono"
+version = "0.4.41"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d"
+dependencies = [
+ "android-tzdata",
+ "iana-time-zone",
+ "js-sys",
+ "num-traits",
+ "wasm-bindgen",
+ "windows-link",
+]
+
+[[package]]
+name = "clap"
+version = "4.5.38"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000"
+dependencies = [
+ "clap_builder",
+ "clap_derive",
+]
+
+[[package]]
+name = "clap_builder"
+version = "4.5.38"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120"
+dependencies = [
+ "anstream",
+ "anstyle",
+ "clap_lex",
+ "strsim",
+]
+
+[[package]]
+name = "clap_derive"
+version = "4.5.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7"
+dependencies = [
+ "heck",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "clap_lex"
+version = "0.7.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
+
+[[package]]
+name = "clearscreen"
+version = "4.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8c41dc435a7b98e4608224bbf65282309f5403719df9113621b30f8b6f74e2f4"
+dependencies = [
+ "nix",
+ "terminfo",
+ "thiserror 2.0.12",
+ "which",
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "colorchoice"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
+
+[[package]]
+name = "core-foundation-sys"
+version = "0.8.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
+
+[[package]]
+name = "cpufeatures"
+version = "0.2.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "crypto-common"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
+dependencies = [
+ "generic-array",
+ "typenum",
+]
+
+[[package]]
+name = "csv"
+version = "1.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "acdc4883a9c96732e4733212c01447ebd805833b7275a73ca3ee080fd77afdaf"
+dependencies = [
+ "csv-core",
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "csv-core"
+version = "0.1.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7d02f3b0da4c6504f86e9cd789d8dbafab48c2321be74e9987593de5a894d93d"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "digest"
+version = "0.10.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
+dependencies = [
+ "block-buffer",
+ "crypto-common",
+]
+
+[[package]]
+name = "dirs-next"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
+dependencies = [
+ "cfg-if",
+ "dirs-sys-next",
+]
+
+[[package]]
+name = "dirs-sys-next"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
+dependencies = [
+ "libc",
+ "redox_users",
+ "winapi",
+]
+
+[[package]]
+name = "either"
+version = "1.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
+
+[[package]]
+name = "encode_unicode"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0"
+
+[[package]]
+name = "env_home"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe"
+
+[[package]]
+name = "env_logger"
+version = "0.10.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580"
+dependencies = [
+ "humantime",
+ "is-terminal",
+ "log",
+ "regex",
+ "termcolor",
+]
+
+[[package]]
+name = "equivalent"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
+
+[[package]]
+name = "errno"
+version = "0.3.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18"
+dependencies = [
+ "libc",
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "fnv"
+version = "1.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
+
+[[package]]
+name = "generic-array"
+version = "0.14.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
+dependencies = [
+ "typenum",
+ "version_check",
+]
+
+[[package]]
+name = "getrandom"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "wasi 0.11.0+wasi-snapshot-preview1",
+]
+
+[[package]]
+name = "getrandom"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "r-efi",
+ "wasi 0.14.2+wasi-0.2.4",
+]
+
+[[package]]
+name = "gimli"
+version = "0.31.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
+
+[[package]]
+name = "hashbrown"
+version = "0.15.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3"
+
+[[package]]
+name = "heck"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
+
+[[package]]
+name = "hermit-abi"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08"
+
+[[package]]
+name = "hex"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
+
+[[package]]
+name = "humantime"
+version = "2.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f"
+
+[[package]]
+name = "iana-time-zone"
+version = "0.1.63"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8"
+dependencies = [
+ "android_system_properties",
+ "core-foundation-sys",
+ "iana-time-zone-haiku",
+ "js-sys",
+ "log",
+ "wasm-bindgen",
+ "windows-core",
+]
+
+[[package]]
+name = "iana-time-zone-haiku"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
+dependencies = [
+ "cc",
+]
+
+[[package]]
+name = "indexmap"
+version = "2.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e"
+dependencies = [
+ "equivalent",
+ "hashbrown",
+]
+
+[[package]]
+name = "is-terminal"
+version = "0.4.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9"
+dependencies = [
+ "hermit-abi",
+ "libc",
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "is_terminal_polyfill"
+version = "1.70.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
+
+[[package]]
+name = "itoa"
+version = "1.0.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
+
+[[package]]
+name = "js-sys"
+version = "0.3.77"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
+dependencies = [
+ "once_cell",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "lazy_static"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
+
+[[package]]
+name = "libc"
+version = "0.2.172"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
+
+[[package]]
+name = "libredox"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
+dependencies = [
+ "bitflags",
+ "libc",
+]
+
+[[package]]
+name = "linux-raw-sys"
+version = "0.9.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12"
+
+[[package]]
+name = "lock_api"
+version = "0.4.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
+dependencies = [
+ "autocfg",
+ "scopeguard",
+]
+
+[[package]]
+name = "log"
+version = "0.4.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
+
+[[package]]
+name = "memchr"
+version = "2.7.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
+
+[[package]]
+name = "minimal-lexical"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
+
+[[package]]
+name = "miniz_oxide"
+version = "0.8.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a"
+dependencies = [
+ "adler2",
+]
+
+[[package]]
+name = "mio"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd"
+dependencies = [
+ "libc",
+ "wasi 0.11.0+wasi-snapshot-preview1",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "nix"
+version = "0.29.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
+dependencies = [
+ "bitflags",
+ "cfg-if",
+ "cfg_aliases",
+ "libc",
+]
+
+[[package]]
+name = "nogamepads-console"
+version = "0.1.0"
+dependencies = [
+ "clap",
+ "nogamepads-core",
+ "prettytable-rs",
+ "rand 0.9.1",
+ "rpassword",
+ "serde",
+ "serde_yaml",
+]
+
+[[package]]
+name = "nogamepads-core"
+version = "0.1.0"
+dependencies = [
+ "bincode",
+ "chrono",
+ "clap",
+ "clearscreen",
+ "env_logger",
+ "hex",
+ "log",
+ "serde",
+ "sha1",
+ "shell-words",
+ "tokio",
+]
+
+[[package]]
+name = "nom"
+version = "7.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
+dependencies = [
+ "memchr",
+ "minimal-lexical",
+]
+
+[[package]]
+name = "num-traits"
+version = "0.2.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
+dependencies = [
+ "autocfg",
+]
+
+[[package]]
+name = "object"
+version = "0.36.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.21.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
+
+[[package]]
+name = "parking_lot"
+version = "0.12.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
+dependencies = [
+ "lock_api",
+ "parking_lot_core",
+]
+
+[[package]]
+name = "parking_lot_core"
+version = "0.9.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "redox_syscall",
+ "smallvec",
+ "windows-targets",
+]
+
+[[package]]
+name = "phf"
+version = "0.11.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"
+dependencies = [
+ "phf_shared",
+]
+
+[[package]]
+name = "phf_codegen"
+version = "0.11.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a"
+dependencies = [
+ "phf_generator",
+ "phf_shared",
+]
+
+[[package]]
+name = "phf_generator"
+version = "0.11.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"
+dependencies = [
+ "phf_shared",
+ "rand 0.8.5",
+]
+
+[[package]]
+name = "phf_shared"
+version = "0.11.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"
+dependencies = [
+ "siphasher",
+]
+
+[[package]]
+name = "pin-project-lite"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
+dependencies = [
+ "zerocopy",
+]
+
+[[package]]
+name = "prettytable-rs"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eea25e07510aa6ab6547308ebe3c036016d162b8da920dbb079e3ba8acf3d95a"
+dependencies = [
+ "csv",
+ "encode_unicode",
+ "is-terminal",
+ "lazy_static",
+ "term",
+ "unicode-width",
+]
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.95"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.40"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "r-efi"
+version = "5.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"
+
+[[package]]
+name = "rand"
+version = "0.8.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
+dependencies = [
+ "rand_core 0.6.4",
+]
+
+[[package]]
+name = "rand"
+version = "0.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97"
+dependencies = [
+ "rand_chacha",
+ "rand_core 0.9.3",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
+dependencies = [
+ "ppv-lite86",
+ "rand_core 0.9.3",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
+
+[[package]]
+name = "rand_core"
+version = "0.9.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
+dependencies = [
+ "getrandom 0.3.3",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.5.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af"
+dependencies = [
+ "bitflags",
+]
+
+[[package]]
+name = "redox_users"
+version = "0.4.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"
+dependencies = [
+ "getrandom 0.2.16",
+ "libredox",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "regex"
+version = "1.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-automata",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-automata"
+version = "0.4.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.8.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
+
+[[package]]
+name = "rpassword"
+version = "7.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "66d4c8b64f049c6721ec8ccec37ddfc3d641c4a7fca57e8f2a89de509c73df39"
+dependencies = [
+ "libc",
+ "rtoolbox",
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "rtoolbox"
+version = "0.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a7cc970b249fbe527d6e02e0a227762c9108b2f49d81094fe357ffc6d14d7f6f"
+dependencies = [
+ "libc",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "rustc-demangle"
+version = "0.1.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
+
+[[package]]
+name = "rustix"
+version = "1.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266"
+dependencies = [
+ "bitflags",
+ "errno",
+ "libc",
+ "linux-raw-sys",
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "rustversion"
+version = "1.0.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2"
+
+[[package]]
+name = "ryu"
+version = "1.0.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
+
+[[package]]
+name = "scopeguard"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
+
+[[package]]
+name = "serde"
+version = "1.0.219"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.219"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "serde_yaml"
+version = "0.9.34+deprecated"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47"
+dependencies = [
+ "indexmap",
+ "itoa",
+ "ryu",
+ "serde",
+ "unsafe-libyaml",
+]
+
+[[package]]
+name = "sha1"
+version = "0.10.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
+dependencies = [
+ "cfg-if",
+ "cpufeatures",
+ "digest",
+]
+
+[[package]]
+name = "shell-words"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
+
+[[package]]
+name = "shlex"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
+
+[[package]]
+name = "signal-hook-registry"
+version = "1.4.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "siphasher"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
+
+[[package]]
+name = "smallvec"
+version = "1.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9"
+
+[[package]]
+name = "socket2"
+version = "0.5.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef"
+dependencies = [
+ "libc",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "strsim"
+version = "0.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
+
+[[package]]
+name = "syn"
+version = "2.0.101"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "term"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f"
+dependencies = [
+ "dirs-next",
+ "rustversion",
+ "winapi",
+]
+
+[[package]]
+name = "termcolor"
+version = "1.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
+dependencies = [
+ "winapi-util",
+]
+
+[[package]]
+name = "terminfo"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d4ea810f0692f9f51b382fff5893887bb4580f5fa246fde546e0b13e7fcee662"
+dependencies = [
+ "fnv",
+ "nom",
+ "phf",
+ "phf_codegen",
+]
+
+[[package]]
+name = "thiserror"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
+dependencies = [
+ "thiserror-impl 1.0.69",
+]
+
+[[package]]
+name = "thiserror"
+version = "2.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708"
+dependencies = [
+ "thiserror-impl 2.0.12",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "2.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "tokio"
+version = "1.45.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2513ca694ef9ede0fb23fe71a4ee4107cb102b9dc1930f6d0fd77aae068ae165"
+dependencies = [
+ "backtrace",
+ "bytes",
+ "libc",
+ "mio",
+ "parking_lot",
+ "pin-project-lite",
+ "signal-hook-registry",
+ "socket2",
+ "tokio-macros",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "tokio-macros"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "typenum"
+version = "1.18.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
+
+[[package]]
+name = "unicode-width"
+version = "0.1.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
+
+[[package]]
+name = "unsafe-libyaml"
+version = "0.2.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861"
+
+[[package]]
+name = "unty"
+version = "0.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae"
+
+[[package]]
+name = "utf8parse"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
+
+[[package]]
+name = "version_check"
+version = "0.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
+
+[[package]]
+name = "virtue"
+version = "0.0.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1"
+
+[[package]]
+name = "wasi"
+version = "0.11.0+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
+
+[[package]]
+name = "wasi"
+version = "0.14.2+wasi-0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3"
+dependencies = [
+ "wit-bindgen-rt",
+]
+
+[[package]]
+name = "wasm-bindgen"
+version = "0.2.100"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
+dependencies = [
+ "cfg-if",
+ "once_cell",
+ "rustversion",
+ "wasm-bindgen-macro",
+]
+
+[[package]]
+name = "wasm-bindgen-backend"
+version = "0.2.100"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
+dependencies = [
+ "bumpalo",
+ "log",
+ "proc-macro2",
+ "quote",
+ "syn",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-macro"
+version = "0.2.100"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
+dependencies = [
+ "quote",
+ "wasm-bindgen-macro-support",
+]
+
+[[package]]
+name = "wasm-bindgen-macro-support"
+version = "0.2.100"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+ "wasm-bindgen-backend",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-shared"
+version = "0.2.100"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "which"
+version = "7.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "24d643ce3fd3e5b54854602a080f34fb10ab75e0b813ee32d00ca2b44fa74762"
+dependencies = [
+ "either",
+ "env_home",
+ "rustix",
+ "winsafe",
+]
+
+[[package]]
+name = "winapi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
+[[package]]
+name = "winapi-util"
+version = "0.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
+dependencies = [
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
+
+[[package]]
+name = "windows-core"
+version = "0.61.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
+dependencies = [
+ "windows-implement",
+ "windows-interface",
+ "windows-link",
+ "windows-result",
+ "windows-strings",
+]
+
+[[package]]
+name = "windows-implement"
+version = "0.60.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "windows-interface"
+version = "0.59.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "windows-link"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
+
+[[package]]
+name = "windows-result"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
+dependencies = [
+ "windows-link",
+]
+
+[[package]]
+name = "windows-strings"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
+dependencies = [
+ "windows-link",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.59.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
+dependencies = [
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
+
+[[package]]
+name = "winsafe"
+version = "0.0.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904"
+
+[[package]]
+name = "wit-bindgen-rt"
+version = "0.39.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1"
+dependencies = [
+ "bitflags",
+]
+
+[[package]]
+name = "zerocopy"
+version = "0.8.25"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb"
+dependencies = [
+ "zerocopy-derive",
+]
+
+[[package]]
+name = "zerocopy-derive"
+version = "0.8.25"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
diff --git a/console/Cargo.toml b/console/Cargo.toml
new file mode 100644
index 0000000..03ec382
--- /dev/null
+++ b/console/Cargo.toml
@@ -0,0 +1,18 @@
+[package]
+name = "nogamepads-console"
+description = "This crate provides a set of tools for simulating and deploying the client and server of the NoGamepads library."
+
+homepage = "https://github.com/CatilGrass/NoGamepads"
+repository = "https://github.com/CatilGrass/NoGamepads"
+
+version = "0.1.0"
+edition = "2024"
+
+[dependencies]
+nogamepads-core = { path = "../core" }
+clap = { version = "4.5.38", features = ["derive"] }
+rand = { version = "0.9.1", features = [] }
+rpassword = "7.4.0"
+serde = { version = "1.0.219", features = ["derive"] }
+serde_yaml = "0.9.34"
+prettytable-rs = "0.10.0" \ No newline at end of file
diff --git a/console/src/bin/nogpadc.rs b/console/src/bin/nogpadc.rs
new file mode 100644
index 0000000..a4b6245
--- /dev/null
+++ b/console/src/bin/nogpadc.rs
@@ -0,0 +1,436 @@
+use crate::AccountCommands::{Add, Customize, List, Remove};
+use crate::Commands::{Account, Connect};
+use clap::{Args, Parser, Subcommand};
+use nogamepads_core::pad_io::client::nogamepads_client::PadClient;
+use nogamepads_core::pad_data::pad_player_info::nogamepads_player_info::PlayerInfo;
+use nogamepads_core::DEFAULT_PORT;
+use prettytable::{row, Table};
+use rand::Rng;
+use std::env::current_dir;
+use std::fs::{create_dir_all, remove_file, File};
+use std::io::{BufReader, Write};
+use std::net::{IpAddr, Ipv4Addr};
+use std::path::PathBuf;
+use std::process::exit;
+use std::str::FromStr;
+
+/// NoGamePads Console - Client Cli
+#[derive(Parser, Debug)]
+#[command(author, version, about, long_about = None)]
+struct NoGamepadClientCli {
+ #[command(subcommand)]
+ command: Commands,
+}
+
+/// 主要命令
+#[derive(Subcommand, Debug)]
+enum Commands {
+
+ // 账户设置
+ #[command(subcommand, about = "Operation of player account")]
+ Account(AccountCommands),
+
+ // 连接到服务器
+ #[command(about = "Connect a player to server")]
+ Connect(ConnectArgs)
+}
+
+/// 账户设置 命令
+#[derive(Subcommand, Debug)]
+enum AccountCommands {
+
+ // 列出所有账号
+ #[command(about = "List all local players")]
+ List(ListAccountArgs),
+
+ // 添加账号
+ #[command(about = "Add a local player")]
+ Add(AddAccountArgs),
+
+ // 移除账号
+ #[command(about = "Remove a local player")]
+ Remove(RemoveAccountArgs),
+
+ // 自定义账号显示信息
+ #[command(about = "Customize how the player appears")]
+ Customize(CustomizeAccountArgs)
+}
+
+/// 列出所有账号 参数
+#[derive(Args, Debug)]
+struct ListAccountArgs { }
+
+/// 添加账号 参数
+#[derive(Args, Debug)]
+struct AddAccountArgs {
+
+ // 注册的角色 ID
+ #[arg(value_name = "NAME")]
+ id: String
+}
+
+/// 移除账号 参数
+#[derive(Args, Debug)]
+struct RemoveAccountArgs {
+
+ // 删除的角色 ID
+ #[arg(value_name = "NAME")]
+ id: String
+}
+
+/// 自定义账号显示信息 参数
+#[derive(Args, Debug)]
+struct CustomizeAccountArgs {
+
+ // 定制的角色 ID
+ #[arg(value_name = "WHO")]
+ id: String,
+
+ // 昵称
+ #[arg(short, long, help = "Nickname")]
+ name: Option<String>,
+
+ // 颜色
+ #[arg(short = 'H', long = "hsv", num_args = 3, value_names = ["H", "S", "V"], help = "Player color, h(0 - 360), s(0 - 1), v(0 - 1)")]
+ hsv: Option<Vec<f64>>
+}
+
+/// 连接到服务器
+#[derive(Args, Debug)]
+struct ConnectArgs {
+
+ // 连接的玩家
+ #[arg(value_name = "WHO")]
+ id: String,
+
+ // 目标服务器
+ #[arg(value_name = "WHERE", default_value = "127.0.0.1")]
+ target: String,
+
+ // 目标端口
+ #[arg(short, long, default_value = "5989")] // <---- DEFAULT_PORT
+ port: Option<u16>,
+
+ // 启用调试
+ #[arg(long)]
+ debug: bool,
+}
+
+/// 配置文件后缀名称
+const EXTENSION_NAME : &str = "yaml";
+
+fn main() {
+
+ // 初始化
+ let root = get_config_folder_path();
+ if ! root.exists() {
+ create_dir_all(root.as_path()).unwrap();
+ }
+
+ // 命令行
+ let cli = NoGamepadClientCli::parse();
+ match cli.command {
+
+ // 账户设置部分
+ Account(commands) => {
+ match commands {
+
+ // 添加账号
+ Add(args) => {
+ if is_account_exist(&args.id) {
+ println!("Account already exists!");
+ } else {
+ // 账号 ID 和 配置路径
+ let account_id = process_inputted_text(args.id);
+ let account_config_path = get_account_config_path(&account_id);
+
+ // 为新号准备的配置文件
+ let mut new_info = PlayerInfo::new();
+
+ // 密码输入和密码验证
+ let password = rpassword::prompt_password("Type password: ").unwrap();
+ let password_confirm = rpassword::prompt_password("Confirm password: ").unwrap();
+ if ! password_confirm.eq(&password) {
+ println!("Password does not match!");
+ exit(1);
+ }
+
+ // 随机生成 色调 值
+ let mut rng = rand::rng();
+ let random_hue: i32 = rng.random_range(0..=360);
+
+ // 建立账号信息并预填入信息
+ new_info.setup_account_info(account_id.as_str(), password.as_str());
+ new_info.set_nickname(account_id.as_str());
+ new_info.set_customize_color_hsv(random_hue, 0.8, 0.8);
+
+ // 新配置信息的文本
+ let new_info_yaml = serde_yaml::to_string(&new_info);
+
+ // 将信息写入文件系统
+ let mut buffer = File::create(account_config_path).unwrap();
+ buffer.write_all(new_info_yaml.unwrap().as_bytes()).unwrap();
+
+ println!("Account created.");
+ }
+ },
+
+ // 移除账号
+ Remove(args) => {
+ if ! is_account_exist(&args.id) {
+ println!("Account not found!");
+ } else {
+ // 账号 ID 和 配置路径
+ let account_id = process_inputted_text(args.id);
+ let account_config_path = get_account_config_path(&account_id);
+
+ // 删除文件
+ remove_file(account_config_path).unwrap();
+
+ println!("Account removed.");
+ }
+ },
+
+ // 列出所有账号
+ List(_args) => {
+ // 账号信息文件夹
+ let folder_path = get_config_folder_path();
+
+ // 输出表格
+ let mut info_table = Table::new();
+
+ // 表头
+ info_table.add_row(row!["ACCOUNT_ID", "NICKNAME", "COLOR", "HASH"]);
+
+ // 遍历目录下文件,将信息逐一填入表格
+ for item in folder_path.read_dir().unwrap() {
+ if let Ok(path) = item {
+ // 文件名
+ let file_name = path.file_name().into_string().unwrap();
+ let ext = format!(".{}", EXTENSION_NAME);
+
+ // 判断是否为指定后缀
+ if file_name.contains(ext.as_str()) {
+
+ // 去除后缀内容,截取为 ID
+ let id = file_name.replace(ext.as_str(), "");
+
+ // 读取并加载其中的玩家信息
+ let file = File::open(get_account_config_path(&id)).unwrap();
+ let reader = BufReader::new(file);
+ let info: PlayerInfo = serde_yaml::from_reader(reader).unwrap();
+
+ // 填入表格
+ info_table.add_row(row![
+ &id, // ACCOUNT_ID
+ info.customize.nickname, // NICKNAME
+ hsv_to_hex( // COLOR
+ info.customize.color_hue,
+ info.customize.color_saturation,
+ info.customize.color_value),
+ info.account.player_hash // HASH
+ ]);
+ }
+ }
+ }
+ println!("{}", info_table.to_string())
+ },
+
+ // 自定义账号显示信息
+ Customize(args) => {
+
+ // 加载配置文件
+ let file = File::open(get_account_config_path(&args.id)).unwrap();
+ let reader = BufReader::new(file);
+ let mut info: PlayerInfo = serde_yaml::from_reader(reader).unwrap();
+
+ // HSV 参数
+ if args.hsv.is_some() {
+ let hsv = args.hsv.unwrap();
+ let hue = hsv[0].round().clamp(0.0, 360.0);
+ let sat = hsv[1].clamp(0.0, 1.0);
+ let val = hsv[2].clamp(0.0, 1.0);
+
+ info.customize.color_hue = hue as i32;
+ info.customize.color_saturation = sat;
+ info.customize.color_value = val;
+
+ println!("Set {}'s HSV color to: {}, {}, {}.", &args.id, hue, sat, val);
+ }
+
+ // 昵称 参数
+ if args.name.is_some() {
+ let name = args.name.unwrap();
+ info.customize.nickname = name.clone();
+
+ println!("Set {}'s display name to: {}.", &args.id, name);
+ }
+
+ // 写入配置文件
+ let yaml_content = serde_yaml::to_string(&info);
+ let mut buffer = File::create(get_account_config_path(&args.id)).unwrap();
+ buffer.write_all(yaml_content.unwrap().as_bytes()).unwrap();
+ },
+ }
+ },
+
+ // 连接到服务器
+ Connect(args) => {
+ if ! is_account_exist(&args.id) {
+ println!("Player not found!");
+ exit(1);
+ }
+
+ // 加载配置文件
+ let file = File::open(get_account_config_path(&args.id)).unwrap();
+ let reader = BufReader::new(file);
+ let info: PlayerInfo = serde_yaml::from_reader(reader).unwrap();
+
+ // 从参数获得 Ip 地址 (或默认)
+ let addr : IpAddr;
+ match IpAddr::from_str(&args.target) {
+ Ok(result) => { addr = result; }
+ Err(_err) => {
+ addr = IpAddr::from(Ipv4Addr::new(127, 0, 0, 1));
+ }
+ }
+
+ // 从参数获得端口地址 (或默认)
+ let port : u16 = if args.port.is_some() { args.port.unwrap() } else { DEFAULT_PORT }
+ .clamp(0, 65535);
+
+ // 绑定目标地址
+ let mut client = PadClient::bind_addr_with_port(addr, port);
+
+ // 启动调试模式 ?
+ if args.debug {
+ println!("- DEBUG MODE -");
+ client.enable_console();
+ }
+
+ // 写入玩家信息
+ client.bind_player(info);
+
+ // 连接
+ client.connect();
+ println!("Connected {} to {}:{}", args.id, addr.to_string(), port.to_string());
+ }
+ }
+}
+
+/// # 处理输入的文本
+///
+/// 将输入的文本进行初步处理,以适合文件名称显示
+///
+/// ## 参数 - Parameters
+///
+/// | Field | Type | Description |
+/// | ------ | --------------------- | ----------- |
+/// | input | String | 输入原始文本 |
+/// | -> | String | 处理后的结果 |
+fn process_inputted_text(input: String) -> String {
+ // 截取前后文本,并转换为小写
+ let s = input.trim().to_lowercase();
+ let mut result = String::new();
+
+ // 处理其中的特殊符号,部分用于分割的符号需要转换为下划线
+ for c in s.chars() {
+ match c {
+ '\n' | '_' => continue,
+ '-' | '.' | ',' | ' ' => result.push('_'),
+ _ => result.push(c),
+ }
+ }
+
+ // 仅保留 ASCII 字符
+ result.chars()
+ .filter(|&c| c.is_ascii_alphanumeric() || c == '_')
+ .collect()
+}
+
+/// # 将 HSV 数值转换为 HEX 颜色码字符串
+///
+/// 在显示玩家信息时,因 HSV 不如 RGB 直观,便转换为 HEX 字符串
+///
+/// ## 参数 - Parameters
+///
+/// | Field | Type | Description |
+/// | ------ | --------------------- | ----------- |
+/// | h | i32 | 色相值 (0 - 360) |
+/// | s | f64 | 饱和度 (0 - 1) |
+/// | v | f64 | 明亮度 (0 - 1) |
+/// | -> | String | HEX 字符串 |
+fn hsv_to_hex(h: i32, s: f64, v: f64) -> String {
+ let h = (h as f64).clamp(0.0, 360.0);
+ let s = s.clamp(0.0, 1.0);
+ let v = v.clamp(0.0, 1.0);
+
+ let c = v * s;
+ let x = c * (1.0 - ((h / 60.0) % 2.0 - 1.0).abs());
+ let m = v - c;
+
+ let (r, g, b) = match (h / 60.0) as usize {
+ 0 => (c, x, 0.0),
+ 1 => (x, c, 0.0),
+ 2 => (0.0, c, x),
+ 3 => (0.0, x, c),
+ 4 => (x, 0.0, c),
+ 5 => (c, 0.0, x),
+ _ => (0.0, 0.0, 0.0),
+ };
+
+ let r = ((r + m) * 255.0).round() as u8;
+ let g = ((g + m) * 255.0).round() as u8;
+ let b = ((b + m) * 255.0).round() as u8;
+ format!("#{:02X}{:02X}{:02X}", r, g, b)
+}
+
+/// # 获得配置文件目录地址
+///
+/// ## 参数 - Parameters
+///
+/// | Field | Type | Description |
+/// | ------ | --------------------- | ----------- |
+/// | -> | PathBuf | 地址 |
+fn get_config_folder_path() -> PathBuf {
+ current_dir().unwrap().join(".nogpadc")
+}
+
+/// # 获得账户配置文件地址
+///
+/// 输入指定的账户ID,获得其配置文件的目录
+///
+/// ## 参数 - Parameters
+///
+/// | Field | Type | Description |
+/// | ------ | --------------------- | ----------- |
+/// | id | &str | 账户 ID |
+/// | -> | PathBuf | 地址 |
+fn get_account_config_path(id: &str) -> PathBuf {
+ get_config_folder_path().join(format!("{}.{}", process_inputted_text(id.to_string()), EXTENSION_NAME))
+}
+
+/// # 判断账户是否存在
+///
+/// 输入指定的账户ID,获得其配置文件的目录
+///
+/// ## 参数 - Parameters
+///
+/// | Field | Type | Description |
+/// | ------ | --------------------- | ----------- |
+/// | id | &str | 账户 ID |
+/// | -> | bool | 是否存在 |
+fn is_account_exist(id: &str) -> bool {
+ let id = process_inputted_text(id.to_string());
+ let path = get_config_folder_path();
+ let dir = path.as_path().read_dir().unwrap();
+ let mut found = false;
+ for item in dir {
+ if let Ok(path) = item {
+ if path.file_name().eq(format!("{}.{}", id, EXTENSION_NAME).as_str()) {
+ found = true;
+ }
+ }
+ }
+ found
+} \ No newline at end of file
diff --git a/console/src/bin/nogpads.rs b/console/src/bin/nogpads.rs
new file mode 100644
index 0000000..95f5ec7
--- /dev/null
+++ b/console/src/bin/nogpads.rs
@@ -0,0 +1,257 @@
+use clap::{arg, Args, Parser, Subcommand};
+use nogamepads_core::pad_io::server::nogamepads_server::{PadServer};
+use nogamepads_core::DEFAULT_PORT;
+use serde::{Deserialize, Serialize};
+use std::env::current_dir;
+use std::fs::{create_dir, File};
+use std::io::{BufReader, Write};
+use std::net::{IpAddr, Ipv4Addr};
+use std::path::PathBuf;
+use nogamepads_core::pad_data::game_profile::game_profile::GameProfile;
+
+/// NoGamePads Console - Server Cli
+#[derive(Parser, Debug)]
+#[command(author, version, about, long_about = None)]
+struct NoGamepadServerCli {
+ #[command(subcommand)]
+ command: Commands,
+}
+
+/// 主要命令
+#[derive(Subcommand, Debug)]
+enum Commands {
+
+ // 服务端配置
+ #[command(about = "Configure the server")]
+ Config(ConfigArgs),
+
+ // 运行服务端
+ #[command(about = "Run the server")]
+ Run(RunArgs)
+}
+
+/// 服务端配置 参数
+#[derive(Args, Debug)]
+struct ConfigArgs {
+
+ // 绑定的端口号
+ #[arg(short, long, help = "Server port (0 = Default)")] // <---- DEFAULT_PORT
+ port: Option<u16>,
+
+ // 游戏名称
+ #[arg(short ='n', long = "name")]
+ game_name: Option<String>,
+
+ // 游戏描述
+ #[arg(short = 'd', long = "description")]
+ game_description: Option<String>,
+
+ // 游戏组织
+ #[arg(short = 'o', long = "organization")]
+ organization: Option<String>,
+
+ // 游戏版本
+ #[arg(short = 'v', long = "version")]
+ version: Option<String>,
+
+ // 工作室 & 游戏 主页
+ #[arg(short = 'w', long = "website")]
+ website: Option<String>,
+
+ // 交流邮箱
+ #[arg(short = 'e', long = "email")]
+ email: Option<String>
+}
+
+/// 运行服务端 参数
+#[derive(Args, Debug)]
+struct RunArgs {
+
+ // 调试模式
+ #[arg(long)]
+ debug: bool,
+}
+
+/// 本地存储的配置信息
+#[derive(Serialize, Deserialize, PartialEq, Debug)]
+struct ServerConfig {
+ port: u16,
+ profile: GameProfile,
+}
+
+impl Default for ServerConfig {
+ fn default() -> Self {
+ ServerConfig {
+ port: DEFAULT_PORT,
+ profile: GameProfile::default(),
+ }
+ }
+}
+
+/// # 快速生成 更新服务端信息 的宏
+macro_rules! update_config {
+ ($config:expr, $args:expr, $($field:ident),+) => {
+ $(
+ if let Some(ref value) = $args.$field {
+ $config.profile.$field = value.clone();
+ println!("Changed profile \"{}\" to \"{}\"",
+ stringify!($field),
+ value
+ );
+ }
+ )+
+ };
+}
+
+fn main () {
+
+ // 命令行
+ let cli = NoGamepadServerCli::parse();
+ match cli.command {
+
+ // 服务端配置
+ Commands::Config(args) => {
+ // 读取服务端配置
+ let mut config = read_config();
+
+ // 端口信息配置:
+ // 端口数值被限定在 0 - 65535,但是若端口参数为 0,则会被设置为默认端口
+ if args.port.is_some() {
+ let port = args.port.unwrap_or(DEFAULT_PORT).clamp(0, 65535);
+ config.port = if port == 0 { DEFAULT_PORT } else { port };
+ }
+
+ // 其他信息配置
+ update_config!(
+ config, args,
+ game_name,
+ game_description,
+ organization,
+ version,
+ website,
+ email
+ );
+
+ // 写入配置
+ write_config(config);
+ },
+
+ // 运行服务端
+ Commands::Run(args) => {
+ // 读取服务端配置
+ let config = read_config();
+
+ // 根据调试选项启动服务端
+ if args.debug {
+ println!("- DEBUG MODE -");
+ println!("Server started!");
+ PadServer::default()
+ .addr(IpAddr::from(Ipv4Addr::new(127, 0, 0, 1)), config.port)
+ .put_profile(config.profile)
+ .enable_console()
+ .build()
+ .start_listening();
+ } else {
+ println!("Server started!");
+ PadServer::default()
+ .addr(IpAddr::from(Ipv4Addr::new(127, 0, 0, 1)), config.port)
+ .put_profile(config.profile)
+ .build()
+ .start_listening();
+ }
+ }
+ }
+}
+
+/// # 获得配置文件目录地址
+///
+/// ## 参数 - Parameters
+///
+/// | Field | Type | Description |
+/// | ------ | --------------------- | ----------- |
+/// | -> | PathBuf | 地址 |
+#[allow(dead_code)]
+fn get_config_folder_path () -> PathBuf {
+ current_dir().unwrap().join(".nogpads")
+}
+
+/// # 获得配置文件地址
+///
+/// ## 参数 - Parameters
+///
+/// | Field | Type | Description |
+/// | ------ | --------------------- | ----------- |
+/// | -> | PathBuf | 地址 |
+#[allow(dead_code)]
+fn get_config_file_path () -> PathBuf {
+ get_config_folder_path().join("config.yaml")
+}
+
+/// # 获得布局文件地址
+///
+/// ## 参数 - Parameters
+///
+/// | Field | Type | Description |
+/// | ------ | --------------------- | ----------- |
+/// | -> | PathBuf | 地址 |
+#[allow(dead_code)]
+fn get_layout_file_path () -> PathBuf {
+ get_config_folder_path().join("layout.yaml")
+}
+
+/// # 获得皮肤资源地址
+///
+/// ## 参数 - Parameters
+///
+/// | Field | Type | Description |
+/// | ------ | --------------------- | ----------- |
+/// | -> | PathBuf | 地址 |
+#[allow(dead_code)]
+fn get_assets_package_path () -> PathBuf {
+ get_config_folder_path().join("assets.zip")
+}
+
+/// # 读取配置信息
+///
+/// 读取 服务端控制台 的配置信息
+///
+/// ## 参数 - Parameters
+///
+/// | Field | Type | Description |
+/// | ------ | --------------------- | ----------- |
+/// | -> | ServerConfig | 配置信息 |
+fn read_config () -> ServerConfig {
+ let config_folder_path = get_config_folder_path();
+ let config_file_path = get_config_file_path();
+
+ if ! config_folder_path.exists() {
+ create_dir(&config_folder_path).unwrap();
+ }
+
+ if ! config_file_path.exists() {
+ let config = ServerConfig::default();
+ let config_text = serde_yaml::to_string(&config).unwrap();
+ File::create(&config_file_path).unwrap().write_all(config_text.as_bytes()).unwrap();
+ config
+ } else {
+ let config_file = File::open(&config_file_path).unwrap();
+ let config_reader = BufReader::new(config_file);
+ serde_yaml::from_reader(config_reader).unwrap()
+ }
+}
+
+/// # 写入配置信息
+///
+/// 将 服务端控制台 的配置信息写入本地
+///
+/// ## 参数 - Parameters
+///
+/// | Field | Type | Description |
+/// | ------ | --------------------- | ----------- |
+/// | config | ServerConfig | 配置信息 |
+fn write_config (config: ServerConfig) {
+ let config_file_path = get_config_file_path();
+
+ let config_text = serde_yaml::to_string(&config).unwrap();
+ File::create(config_file_path).unwrap().write_all(config_text.as_bytes()).unwrap();
+} \ No newline at end of file