diff --git a/Cargo.lock b/Cargo.lock index c6e1df1..5b56ad3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "addr2line" -version = "0.14.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c0929d69e78dd9bf5408269919fcbcaeb2e35e5d43e5815517cdc6a8e11a423" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" dependencies = [ "gimli", ] [[package]] name = "adler" -version = "0.2.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ages-prs" @@ -28,37 +28,44 @@ dependencies = [ [[package]] name = "ahash" -version = "0.5.8" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" + +[[package]] +name = "ahash" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb6ec8807cd25b59e6b8100815afc73f54e294f1a425a2e555971969889a8f8" +checksum = "796540673305a66d127804eef19ad696f1f204b8c1025aaca4958c17eab32877" dependencies = [ - "getrandom 0.2.0", - "lazy_static", + "getrandom 0.2.6", + "once_cell", + "version_check", ] [[package]] name = "aho-corasick" -version = "0.7.15" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ "memchr", ] [[package]] name = "anyhow" -version = "1.0.47" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d9ff5d688f1c13395289f67db01d4826b46dd694e7580accdc3e8430f2d98e" +checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" dependencies = [ "backtrace", ] [[package]] name = "async-attributes" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd3d156917d94862e779f356c5acae312b08fd3121e792c857d7928c8088423" +checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" dependencies = [ "quote", "syn", @@ -66,9 +73,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.5.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59740d83946db6a5af71ae25ddf9562c2b176b2ca42cf99a455f09f4a220d6b9" +checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" dependencies = [ "concurrent-queue", "event-listener", @@ -91,9 +98,9 @@ dependencies = [ [[package]] name = "async-global-executor" -version = "2.0.2" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6" +checksum = "c290043c9a95b05d45e952fb6383c67bcb61471f60cfa21e890dba6654234f43" dependencies = [ "async-channel", "async-executor", @@ -107,12 +114,11 @@ dependencies = [ [[package]] name = "async-io" -version = "1.4.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bbfd5cf2794b1e908ea8457e6c45f8f8f1f6ec5f74617bf4662623f47503c3b" +checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" dependencies = [ "concurrent-queue", - "fastrand", "futures-lite", "libc", "log", @@ -127,9 +133,9 @@ dependencies = [ [[package]] name = "async-lock" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" +checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" dependencies = [ "event-listener", ] @@ -157,13 +163,13 @@ dependencies = [ [[package]] name = "async-process" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f38756dd9ac84671c428afbf7c9f7495feff9ec5b0710f17100098e5b354ac" +checksum = "83137067e3a2a6a06d67168e49e68a0957d215410473a740cea95a2425c0b7c6" dependencies = [ "async-io", "blocking", - "cfg-if 1.0.0", + "cfg-if", "event-listener", "futures-lite", "libc", @@ -174,9 +180,9 @@ dependencies = [ [[package]] name = "async-std" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f06685bad74e0570f5213741bea82158279a4103d988e57bfada11ad230341" +checksum = "52580991739c5cdb36cde8b2a516371c0a3b70dda36d916cc08b82372916808c" dependencies = [ "async-attributes", "async-channel", @@ -184,7 +190,7 @@ dependencies = [ "async-io", "async-lock", "async-process", - "crossbeam-utils 0.8.0", + "crossbeam-utils", "futures-channel", "futures-core", "futures-io", @@ -195,7 +201,7 @@ dependencies = [ "memchr", "num_cpus", "once_cell", - "pin-project-lite 0.2.6", + "pin-project-lite", "pin-utils", "slab", "wasm-bindgen-futures", @@ -203,15 +209,15 @@ dependencies = [ [[package]] name = "async-task" -version = "4.0.3" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" +checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" [[package]] name = "async-trait" -version = "0.1.51" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e" +checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" dependencies = [ "proc-macro2", "quote", @@ -220,9 +226,9 @@ dependencies = [ [[package]] name = "atoi" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c897df197d57c25b37df9d8fa2f93ddbfeee9ebd2264350ac79c8ec4b795885" +checksum = "616896e05fc0e2649463a93a15183c6a16bf03413a7af88ef1285ddedfa9cda5" dependencies = [ "num-traits", ] @@ -246,24 +252,28 @@ dependencies = [ [[package]] name = "autocfg" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" +dependencies = [ + "autocfg 1.1.0", +] [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.54" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2baad346b2d4e94a24347adeee9c7a93f412ee94b9cc26e5b59dea23848e9f28" +checksum = "11a17d453482a265fd5f8479f2a3f405566e6ca627837aaddb85af8b1ab8ef61" dependencies = [ "addr2line", - "cfg-if 1.0.0", + "cc", + "cfg-if", "libc", "miniz_oxide", "object", @@ -276,12 +286,6 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d67c978b1322c8031145b1f6c236fc371292f52c565bc96018b2971afcbffe1" -[[package]] -name = "base64" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" - [[package]] name = "base64" version = "0.13.0" @@ -294,16 +298,16 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f691e63585950d8c1c43644d11bab9073e40f5060dd2822734ae7c3dc69a3a80" dependencies = [ - "base64 0.13.0", + "base64", "blowfish", - "getrandom 0.2.0", + "getrandom 0.2.6", ] [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block-buffer" @@ -314,11 +318,20 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-buffer" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +dependencies = [ + "generic-array", +] + [[package]] name = "blocking" -version = "1.0.2" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e170dbede1f740736619b776d7251cb1b9095c435c34d8ca9f57fcd2f335e9" +checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" dependencies = [ "async-channel", "async-task", @@ -341,21 +354,21 @@ dependencies = [ [[package]] name = "build_const" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39" +checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" [[package]] name = "bumpalo" -version = "3.4.0" +version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" @@ -365,27 +378,43 @@ checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" [[package]] name = "bytes" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cache-padded" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" +checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" [[package]] -name = "cc" -version = "1.0.62" +name = "cargo-platform" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1770ced377336a88a67c473594ccc14eca6f4559217c34f64aac8f83d641b40" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +dependencies = [ + "serde", +] [[package]] -name = "cfg-if" -version = "0.1.10" +name = "cargo_metadata" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714a157da7991e23d90686b9524b9e12e0407a108647f52e9328f4b3d51ac7f" +dependencies = [ + "cargo-platform", + "semver 0.11.0", + "semver-parser", + "serde", + "serde_json", +] + +[[package]] +name = "cc" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" [[package]] name = "cfg-if" @@ -424,15 +453,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "cloudabi" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467" -dependencies = [ - "bitflags", -] - [[package]] name = "colored" version = "1.9.3" @@ -454,16 +474,16 @@ dependencies = [ ] [[package]] -name = "const_fn" -version = "0.4.3" +name = "convert_case" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c478836e029dcef17fb47c89023448c64f781a046e0300e257ad8225ae59afab" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ "core-foundation-sys", "libc", @@ -471,15 +491,18 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] -name = "cpuid-bool" -version = "0.1.2" +name = "cpufeatures" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +dependencies = [ + "libc", +] [[package]] name = "crc" @@ -492,76 +515,74 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.4.4" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" +checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" dependencies = [ - "crossbeam-utils 0.7.2", - "maybe-uninit", + "cfg-if", + "crossbeam-utils", ] [[package]] name = "crossbeam-queue" -version = "0.2.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" +checksum = "1f25d8400f4a7a5778f0e4e52384a48cbd9b5c495d110786187fc750075277a2" dependencies = [ - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "maybe-uninit", + "cfg-if", + "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.7.2" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" dependencies = [ - "autocfg 1.0.1", - "cfg-if 0.1.10", + "cfg-if", "lazy_static", ] [[package]] -name = "crossbeam-utils" -version = "0.8.0" +name = "crypto-common" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec91540d98355f690a86367e566ecad2e9e579f230230eb7c21398372be73ea5" +checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" dependencies = [ - "autocfg 1.0.1", - "cfg-if 1.0.0", - "const_fn", - "lazy_static", + "generic-array", + "typenum", ] [[package]] name = "crypto-mac" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bcd97a54c7ca5ce2f6eb16f6bede5b0ab5f0055fedc17d2f0b4466e21671ca" +checksum = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a" dependencies = [ "generic-array", "subtle", ] [[package]] -name = "crypto-mac" -version = "0.10.0" +name = "ctor" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6" +checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" dependencies = [ - "generic-array", - "subtle", + "quote", + "syn", ] [[package]] name = "derive_more" -version = "0.99.11" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cb0e6161ad61ed084a36ba71fbba9e3ac5aee3606fb607fe08da6acbcf3d8c" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ + "convert_case", "proc-macro2", "quote", + "rustc_version", "syn", ] @@ -574,6 +595,17 @@ dependencies = [ "generic-array", ] +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer 0.10.2", + "crypto-common", + "subtle", +] + [[package]] name = "dotenv" version = "0.15.0" @@ -645,9 +677,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" +checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" [[package]] name = "failure" @@ -666,9 +698,9 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "1.4.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5faf057445ce5c9d4329e382b2ce7ca38550ef3b73a5348362d5f24e0c7fe3" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" dependencies = [ "instant", ] @@ -701,9 +733,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" dependencies = [ "matches", "percent-encoding", @@ -717,9 +749,9 @@ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" [[package]] name = "futures" -version = "0.3.7" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95314d38584ffbfda215621d723e0a3906f032e03ae5551e650058dac83d4797" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" dependencies = [ "futures-channel", "futures-core", @@ -732,9 +764,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.7" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0448174b01148032eed37ac4aed28963aaaa8cfa93569a08e5b479bbc6c2c151" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" dependencies = [ "futures-core", "futures-sink", @@ -742,15 +774,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.7" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18eaa56102984bed2c88ea39026cff3ce3b4c7f508ca970cedf2450ea10d4e46" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" [[package]] name = "futures-executor" -version = "0.3.7" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f8e0c9258abaea85e78ebdda17ef9666d390e987f006be6080dfe354b708cb" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" dependencies = [ "futures-core", "futures-task", @@ -759,32 +791,31 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.7" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1798854a4727ff944a7b12aa999f58ce7aa81db80d2dfaaf2ba06f065ddd2b" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" [[package]] name = "futures-lite" -version = "1.11.2" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6c079abfac3ab269e2927ec048dabc89d009ebfdda6b8ee86624f30c689658" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" dependencies = [ "fastrand", "futures-core", "futures-io", "memchr", "parking", - "pin-project-lite 0.1.11", + "pin-project-lite", "waker-fn", ] [[package]] name = "futures-macro" -version = "0.3.7" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36fccf3fc58563b4a14d265027c627c3b665d7fed489427e88e7cc929559efe" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ - "proc-macro-hack", "proc-macro2", "quote", "syn", @@ -792,24 +823,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.7" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e3ca3f17d6e8804ae5d3df7a7d35b2b3a6fe89dac84b31872720fc3060a0b11" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" [[package]] name = "futures-task" -version = "0.3.7" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d502af37186c4fef99453df03e374683f8a1eec9dcc1e66b3b82dc8278ce3c" -dependencies = [ - "once_cell", -] +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" [[package]] name = "futures-util" -version = "0.3.7" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abcb44342f62e6f3e8ac427b8aa815f724fd705dfad060b18ac7866c15bb8e34" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" dependencies = [ "futures-channel", "futures-core", @@ -818,18 +846,16 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project", + "pin-project-lite", "pin-utils", - "proc-macro-hack", - "proc-macro-nested", "slab", ] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" dependencies = [ "typenum", "version_check", @@ -837,43 +863,42 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.2.0" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8025cf36f917e6a52cce185b7c7177689b838b7ec138364e50cc2277a56cf4" +checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi 0.10.2+wasi-snapshot-preview1", ] [[package]] name = "gimli" -version = "0.23.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" [[package]] name = "gloo-timers" -version = "0.2.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47204a46aaff920a1ea58b11d03dec6f704287d27561724a4631e450654a891f" +checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" dependencies = [ "futures-channel", "futures-core", "js-sys", "wasm-bindgen", - "web-sys", ] [[package]] @@ -881,56 +906,73 @@ name = "hashbrown" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +dependencies = [ + "ahash 0.4.7", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" + +[[package]] +name = "hashlink" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d99cf782f0dc4372d26846bec3de7804ceb5df083c2d4462c0b8d2330e894fa8" +dependencies = [ + "hashbrown 0.9.1", +] [[package]] name = "heck" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.1.17" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] [[package]] name = "hex" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hmac" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deae6d9dbb35ec2c502d62b8f7b1c000a0822c3b0794ba36b3149c0a1c840dff" +checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" dependencies = [ - "crypto-mac 0.9.1", - "digest", + "crypto-mac", + "digest 0.9.0", ] [[package]] name = "hmac" -version = "0.10.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "crypto-mac 0.10.0", - "digest", + "digest 0.10.3", ] [[package]] name = "idna" -version = "0.2.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ "matches", "unicode-bidi", @@ -939,34 +981,49 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.6.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" +checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ - "autocfg 1.0.1", - "hashbrown", + "autocfg 1.1.0", + "hashbrown 0.11.2", ] [[package]] name = "instant" -version = "0.1.8" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb1fc4429a33e1f80d41dc9fea4d108a88bec1de8053878898ae448a0b52f613" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", +] + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", ] [[package]] name = "itoa" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "js-sys" -version = "0.3.45" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca059e81d9486668f12d455a4ea6daa600bd408134cd17e3d3fb5a32d1f016f8" +checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" dependencies = [ "wasm-bindgen", ] @@ -988,9 +1045,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.97" +version = "0.2.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" +checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" [[package]] name = "libflate_lz77" @@ -1001,63 +1058,38 @@ checksum = "739e9d7726dc32173fed2d69d17eef3c54682169e4e20ff1d0a45dcd37063cef" [[package]] name = "libpso" version = "0.1.0" -source = "git+http://git.sharnoth.com/jake/libpso#892d2ed220369f0ff7b7530fa734e722c2b21c2c" +source = "git+http://git.sharnoth.com/jake/libpso#4fba0529aef169c67a99709582109ca5c68f15de" dependencies = [ "chrono", "psopacket", "rand 0.6.5", ] -[[package]] -name = "linked-hash-map" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" - [[package]] name = "lock_api" -version = "0.4.1" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" dependencies = [ + "autocfg 1.1.0", "scopeguard", ] [[package]] name = "log" -version = "0.4.11" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", + "value-bag", ] -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - [[package]] name = "matches" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" - -[[package]] -name = "maybe-uninit" -version = "2.0.0" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "md-5" @@ -1065,37 +1097,52 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15" dependencies = [ - "block-buffer", - "digest", + "block-buffer 0.9.0", + "digest 0.9.0", "opaque-debug", ] +[[package]] +name = "md-5" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658646b21e0b72f7866c7038ab086d3d5e1cd6271f060fd37defb241949d0582" +dependencies = [ + "digest 0.10.3", +] + [[package]] name = "memchr" -version = "2.3.4" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.4.3" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" +checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" dependencies = [ "adler", - "autocfg 1.0.1", ] [[package]] name = "mio" -version = "0.7.13" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" dependencies = [ "libc", "log", "miow", "ntapi", + "wasi 0.11.0+wasi-snapshot-preview1", "winapi", ] @@ -1110,9 +1157,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.6" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fcc7939b5edc4e4f86b1b4a04bb1498afaaf871b1a6691838ed06fcb48d3a3f" +checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" dependencies = [ "lazy_static", "libc", @@ -1126,22 +1173,32 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nom" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "ntapi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" dependencies = [ "winapi", ] [[package]] name = "num-integer" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "num-traits", ] @@ -1151,14 +1208,14 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", ] [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ "hermit-abi", "libc", @@ -1166,15 +1223,18 @@ dependencies = [ [[package]] name = "object" -version = "0.22.0" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" +checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" +dependencies = [ + "memchr", +] [[package]] name = "once_cell" -version = "1.4.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "opaque-debug" @@ -1184,31 +1244,31 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.30" +version = "0.10.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" +checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" dependencies = [ "bitflags", - "cfg-if 0.1.10", + "cfg-if", "foreign-types", - "lazy_static", "libc", + "once_cell", "openssl-sys", ] [[package]] name = "openssl-probe" -version = "0.1.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.58" +version = "0.9.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" +checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "cc", "libc", "pkg-config", @@ -1223,9 +1283,9 @@ checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" [[package]] name = "parking_lot" -version = "0.11.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", @@ -1234,12 +1294,11 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.0" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ - "cfg-if 0.1.10", - "cloudabi 0.1.0", + "cfg-if", "instant", "libc", "redox_syscall", @@ -1254,54 +1313,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] -name = "phf" -version = "0.8.0" +name = "pest" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" dependencies = [ - "phf_shared", + "ucd-trie", ] [[package]] -name = "phf_shared" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project" -version = "1.0.1" +name = "phf" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee41d838744f60d959d7074e3afb6b35c7456d0f61cad38a24e35e6553f73841" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" dependencies = [ - "pin-project-internal", + "phf_shared", ] [[package]] -name = "pin-project-internal" -version = "1.0.1" +name = "phf_shared" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a4ffa594b66bff340084d4081df649a7dc049ac8d7fc458d8e628bfbbb2f86" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" dependencies = [ - "proc-macro2", - "quote", - "syn", + "siphasher", ] [[package]] name = "pin-project-lite" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b" - -[[package]] -name = "pin-project-lite" -version = "0.2.6" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" @@ -1311,30 +1353,30 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.19" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "polling" -version = "2.0.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a7bc6b2a29e632e45451c941832803a18cce6781db04de8a04696cdca8bde4" +checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "libc", "log", - "wepoll-sys", + "wepoll-ffi", "winapi", ] [[package]] name = "postgres" -version = "0.19.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7871ee579860d8183f542e387b176a25f2656b9fb5211e045397f745a68d1c2" +checksum = "eb76d6535496f633fa799bb872ffb4790e9cbdedda9d35564ca0252f930c0dd5" dependencies = [ - "bytes 1.0.1", + "bytes 1.1.0", "fallible-iterator", "futures", "log", @@ -1344,56 +1386,44 @@ dependencies = [ [[package]] name = "postgres-protocol" -version = "0.6.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff3e0f70d32e20923cabf2df02913be7c1842d4c772db8065c00fcfdd1d1bff3" +checksum = "79ec03bce71f18b4a27c4c64c6ba2ddf74686d69b91d8714fb32ead3adaed713" dependencies = [ - "base64 0.13.0", + "base64", "byteorder", - "bytes 1.0.1", + "bytes 1.1.0", "fallible-iterator", - "hmac 0.10.1", - "md-5", + "hmac 0.12.1", + "md-5 0.10.1", "memchr", - "rand 0.8.4", - "sha2", + "rand 0.8.5", + "sha2 0.10.2", "stringprep", ] [[package]] name = "postgres-types" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "430f4131e1b7657b0cd9a2b0c3408d77c9a43a042d300b8c77f981dffcc43a2f" +checksum = "04619f94ba0cc80999f4fc7073607cb825bc739a883cb6d20900fc5e009d6b0d" dependencies = [ - "bytes 1.0.1", + "bytes 1.1.0", "fallible-iterator", "postgres-protocol", ] [[package]] name = "ppv-lite86" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" - -[[package]] -name = "proc-macro-hack" -version = "0.5.19" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "proc-macro-nested" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "proc-macro2" -version = "1.0.30" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70" +checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" dependencies = [ "unicode-xid", ] @@ -1401,7 +1431,7 @@ dependencies = [ [[package]] name = "psopacket" version = "1.0.0" -source = "git+http://git.sharnoth.com/jake/libpso#892d2ed220369f0ff7b7530fa734e722c2b21c2c" +source = "git+http://git.sharnoth.com/jake/libpso#4fba0529aef169c67a99709582109ca5c68f15de" dependencies = [ "proc-macro2", "quote", @@ -1410,9 +1440,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.7" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" dependencies = [ "proc-macro2", ] @@ -1423,7 +1453,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" dependencies = [ - "autocfg 0.1.7", + "autocfg 0.1.8", "libc", "rand_chacha 0.1.1", "rand_core 0.4.2", @@ -1442,7 +1472,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom 0.1.15", + "getrandom 0.1.16", "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", @@ -1451,14 +1481,13 @@ dependencies = [ [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", "rand_core 0.6.3", - "rand_hc 0.3.1", ] [[package]] @@ -1467,7 +1496,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" dependencies = [ - "autocfg 0.1.7", + "autocfg 0.1.8", "rand_core 0.3.1", ] @@ -1512,7 +1541,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom 0.1.15", + "getrandom 0.1.16", ] [[package]] @@ -1521,7 +1550,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.0", + "getrandom 0.2.6", ] [[package]] @@ -1542,15 +1571,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core 0.6.3", -] - [[package]] name = "rand_isaac" version = "0.1.1" @@ -1577,7 +1597,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" dependencies = [ - "cloudabi 0.0.3", + "cloudabi", "fuchsia-cprng", "libc", "rand_core 0.4.2", @@ -1591,7 +1611,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" dependencies = [ - "autocfg 0.1.7", + "autocfg 0.1.8", "rand_core 0.4.2", ] @@ -1615,9 +1635,12 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.1.57" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +dependencies = [ + "bitflags", +] [[package]] name = "refinery" @@ -1636,7 +1659,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53260bc01535ea10c553ce0fc410609ba2dc0a9f4c9b4503e0af842dd4a6f89d" dependencies = [ "async-trait", - "cfg-if 1.0.0", + "cfg-if", "chrono", "lazy_static", "log", @@ -1665,21 +1688,20 @@ dependencies = [ [[package]] name = "regex" -version = "1.4.2" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" dependencies = [ "aho-corasick", "memchr", "regex-syntax", - "thread_local", ] [[package]] name = "regex-syntax" -version = "0.6.21" +version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "remove_dir_all" @@ -1692,26 +1714,35 @@ dependencies = [ [[package]] name = "ron" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8a58080b7bb83b2ea28c3b7a9a994fd5e310330b7c8ca5258d99b98128ecfe4" +checksum = "1b861ecaade43ac97886a512b360d01d66be9f41f3c61088b42cedf92e03d678" dependencies = [ - "base64 0.12.3", + "base64", "bitflags", "serde", ] [[package]] name = "rustc-demangle" -version = "0.1.18" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + +[[package]] +name = "rustc_version" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.7", +] [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "same-file" @@ -1740,9 +1771,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "security-framework" -version = "2.0.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1759c2e3c8580017a484a7ac56d3abc5a6c1feadf88db2f3633f12ae4268c69" +checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" dependencies = [ "bitflags", "core-foundation", @@ -1753,28 +1784,53 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.0.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f99b9d5e26d2a71633cc4f2ebae7cc9f874044e0c351a27e17892d76dce5678b" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" dependencies = [ "core-foundation-sys", "libc", ] +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", + "serde", +] + +[[package]] +name = "semver" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + [[package]] name = "serde" -version = "1.0.117" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.117" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", @@ -1794,47 +1850,58 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.59" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ "indexmap", - "itoa", + "itoa 1.0.1", "ryu", "serde", ] [[package]] name = "sha-1" -version = "0.9.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce3cdf1b5e620a498ee6f2a171885ac7e22f0e12089ec4b3d22b84921792507c" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ - "block-buffer", - "cfg-if 1.0.0", - "cpuid-bool", - "digest", + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", "opaque-debug", ] [[package]] name = "sha2" -version = "0.9.2" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e7aab86fe2149bad8c507606bdb3f4ef5e7b2380eb92350f56122cca72a42a8" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ - "block-buffer", - "cfg-if 1.0.0", - "cpuid-bool", - "digest", + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", "opaque-debug", ] +[[package]] +name = "sha2" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.3", +] + [[package]] name = "signal-hook" -version = "0.3.9" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "470c5a6397076fae0094aaf06a08e6ba6f37acb77d3b1b91ea92b4d6c8650c39" +checksum = "647c97df271007dcea485bb74ffdb57f2e683f1306c854f468a0c244badabf2d" dependencies = [ "libc", "signal-hook-registry", @@ -1851,27 +1918,27 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.3" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8f3741c7372e75519bd9346068370c9cdaabcc1f9599cbcf2a2719352286b7" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" [[package]] name = "slab" -version = "0.4.2" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" [[package]] name = "smallvec" -version = "1.4.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "socket2" -version = "0.4.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" dependencies = [ "libc", "winapi", @@ -1879,20 +1946,20 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.1.1" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f699301eec598ffd6c39832cca1416381ea459ac73c506f6ca74c8750fb52969" +checksum = "b4b7922be017ee70900be125523f38bdd644f4f06a1b16e8fa5a8ee8c34bffd4" dependencies = [ - "lazy_static", - "maplit", - "regex", + "itertools", + "nom", + "unicode_categories", ] [[package]] name = "sqlx" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1f8eb788e1733bdbf69a8f97087213ebdebd253d4782c686d3cfd586b0a9453" +checksum = "e1a98f9bf17b690f026b6fec565293a995b46dfbd6293debcb654dcffd2d1b34" dependencies = [ "sqlx-core", "sqlx-macros", @@ -1900,13 +1967,13 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e647268dc1239dd9db2d3103fefd61151971a2214882cff9efea6f60cf50840" +checksum = "36bb6a2ca3345a86493bc3b71eabc2c6c16a8bb1aa476cf5303bee27f67627d7" dependencies = [ - "ahash", + "ahash 0.6.3", "atoi", - "base64 0.13.0", + "base64", "bitflags", "byteorder", "bytes 0.5.6", @@ -1914,18 +1981,18 @@ dependencies = [ "crc", "crossbeam-channel", "crossbeam-queue", - "crossbeam-utils 0.7.2", + "crossbeam-utils", "either", "futures-channel", "futures-core", "futures-util", + "hashlink", "hex", - "hmac 0.9.0", - "itoa", + "hmac 0.10.1", + "itoa 0.4.8", "libc", "log", - "lru-cache", - "md-5", + "md-5 0.9.1", "memchr", "once_cell", "parking_lot", @@ -1934,7 +2001,7 @@ dependencies = [ "serde", "serde_json", "sha-1", - "sha2", + "sha2 0.9.9", "smallvec", "sqlformat", "sqlx-rt", @@ -1946,18 +2013,20 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7acd32cba35531345f8a94a038874baf00efd0b701c913f5b00d2870b474b64" +checksum = "2b5ada8b3b565331275ce913368565a273a74faf2a34da58c4dc010ce3286844" dependencies = [ + "cargo_metadata", "dotenv", "either", "futures", "heck", + "lazy_static", "proc-macro2", "quote", "serde_json", - "sha2", + "sha2 0.9.9", "sqlx-core", "sqlx-rt", "syn", @@ -2005,15 +2074,15 @@ dependencies = [ [[package]] name = "subtle" -version = "2.3.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343f3f510c2915908f155e94f17220b19ccfacf2a64a2a5d8004f2c3e311e7fd" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.80" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" +checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52" dependencies = [ "proc-macro2", "quote", @@ -2022,13 +2091,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.1.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", + "fastrand", "libc", - "rand 0.7.3", "redox_syscall", "remove_dir_all", "winapi", @@ -2036,18 +2105,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.22" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e9ae34b84616eedaaf1e9dd6026dbe00dcafa92aa0c8077cb69df1fcfe5e53e" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.22" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba20f23e85b10754cd195504aebf6a27e2e6cbe28c17778a0c930724628dd56" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", @@ -2055,62 +2124,62 @@ dependencies = [ ] [[package]] -name = "thread_local" -version = "1.0.1" +name = "time" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ - "lazy_static", + "libc", + "winapi", ] [[package]] -name = "time" -version = "0.1.44" +name = "tinyvec" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", + "tinyvec_macros", ] [[package]] -name = "tinyvec" -version = "0.3.4" +name = "tinyvec_macros" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.7.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79ba603c337335df6ba6dd6afc38c38a7d5e1b0c871678439ea973cd62a118e" +checksum = "0f48b6d60512a392e34dbf7fd456249fd2de3c83669ab642e021903f4015185b" dependencies = [ - "autocfg 1.0.1", - "bytes 1.0.1", + "bytes 1.1.0", "libc", "memchr", "mio", - "pin-project-lite 0.2.6", + "once_cell", + "pin-project-lite", + "socket2", "winapi", ] [[package]] name = "tokio-postgres" -version = "0.7.2" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2b1383c7e4fb9a09e292c7c6afb7da54418d53b045f1c1fac7a911411a2b8b" +checksum = "4b6c8b33df661b548dcd8f9bf87debb8c56c05657ed291122e1188698c2ece95" dependencies = [ "async-trait", "byteorder", - "bytes 1.0.1", + "bytes 1.1.0", "fallible-iterator", "futures", "log", "parking_lot", "percent-encoding", "phf", - "pin-project-lite 0.2.6", + "pin-project-lite", "postgres-protocol", "postgres-types", "socket2", @@ -2120,68 +2189,77 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.7" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" dependencies = [ - "bytes 1.0.1", + "bytes 1.1.0", "futures-core", "futures-sink", "log", - "pin-project-lite 0.2.6", + "pin-project-lite", "tokio", ] [[package]] name = "toml" -version = "0.5.7" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cf45bb0bef80604d001caaec0d09da99611b3c0fd39d3080468875cdb65645" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] [[package]] name = "typenum" -version = "1.12.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "ucd-trie" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" [[package]] name = "unicode-bidi" -version = "0.3.4" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -dependencies = [ - "matches", -] +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-normalization" -version = "0.1.13" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-xid" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "url" -version = "2.2.0" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ "form_urlencoded", "idna", @@ -2189,17 +2267,27 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "value-bag" +version = "1.0.0-alpha.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79923f7731dc61ebfba3633098bf3ac533bbd35ccd8c57e7088d9a5eebe0263f" +dependencies = [ + "ctor", + "version_check", +] + [[package]] name = "vcpkg" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "waker-fn" @@ -2209,9 +2297,9 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "walkdir" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", "winapi", @@ -2226,25 +2314,31 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.68" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42" +checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.68" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68" +checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" dependencies = [ "bumpalo", "lazy_static", @@ -2257,11 +2351,11 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.18" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7866cab0aa01de1edf8b5d7936938a7e397ee50ce24119aef3e1eaa3b6171da" +checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -2269,9 +2363,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.68" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038" +checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2279,9 +2373,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.68" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe" +checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" dependencies = [ "proc-macro2", "quote", @@ -2292,34 +2386,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.68" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307" +checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" [[package]] name = "web-sys" -version = "0.3.45" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf6ef87ad7ae8008e15a355ce696bed26012b7caa21605188cfd8214ab51e2d" +checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] -name = "wepoll-sys" -version = "3.0.1" +name = "wepoll-ffi" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcb14dea929042224824779fbc82d9fab8d2e6d3cbc0ac404de8edf489e77ff" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" dependencies = [ "cc", ] [[package]] name = "whoami" -version = "0.9.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7884773ab69074615cb8f8425d0e53f11710786158704fca70f53e71b0e05504" +checksum = "524b58fa5a20a2fb3014dd6358b70e6579692a56ef6fce928834e488f42f65e8" +dependencies = [ + "wasm-bindgen", + "web-sys", +] [[package]] name = "winapi" diff --git a/src/bin/main.rs b/src/bin/main.rs index 91f0815..d493ec2 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -65,12 +65,12 @@ fn main() { }; let fake_user = entity_gateway.create_user(fake_user).await.unwrap(); entity_gateway.create_user_settings(NewUserSettingsEntity::new(fake_user.id)).await.unwrap(); - let mut character = NewCharacterEntity::new(fake_user.id); + let mut character = NewCharacterEntity::new(fake_user.id, 1); character.name = format!("Test Char {}", i*2); let character = entity_gateway.create_character(character).await.unwrap(); entity_gateway.set_character_meseta(&character.id, item::Meseta(999999)).await.unwrap(); entity_gateway.set_bank_meseta(&character.id, item::BankName("".into()), item::Meseta(999999)).await.unwrap(); - let mut character = NewCharacterEntity::new(fake_user.id); + let mut character = NewCharacterEntity::new(fake_user.id, 1); character.slot = 2; character.name = "ItemRefactor".into(); character.exp = 80000000; diff --git a/src/entity/character.rs b/src/entity/character.rs index 432017d..7a2431d 100644 --- a/src/entity/character.rs +++ b/src/entity/character.rs @@ -2,8 +2,8 @@ use std::convert::{From, Into}; use std::collections::HashMap; use serde::{Serialize, Deserialize}; -use libpso::packet::ship::{UpdateConfig, WriteInfoboard}; -use libpso::character::character::{DEFAULT_PALETTE_CONFIG, DEFAULT_TECH_MENU}; +use libpso::packet::ship::{UpdateConfig, WriteInfoboard, KeyboardConfig, GamepadConfig}; +use libpso::character::settings::{DEFAULT_PALETTE_CONFIG, DEFAULT_TECH_MENU, DEFAULT_KEYBOARD_CONFIG1, DEFAULT_KEYBOARD_CONFIG2, DEFAULT_KEYBOARD_CONFIG3, DEFAULT_KEYBOARD_CONFIG4, DEFAULT_GAMEPAD_CONFIG}; use crate::entity::item::tech::Technique; use crate::entity::account::UserAccountId; @@ -264,6 +264,82 @@ pub struct CharacterMaterials { pub tp: u32, } +#[derive(Clone, Debug)] +pub struct CharacterKeyboardConfig { + pub keyboard_config: [u8; 0x16C], +} + +impl Default for CharacterKeyboardConfig { + fn default() -> CharacterKeyboardConfig { + CharacterKeyboardConfig { + keyboard_config: DEFAULT_KEYBOARD_CONFIG1, + } + } +} + +impl CharacterKeyboardConfig { + fn new(preset: usize) -> CharacterKeyboardConfig { + match preset { + 1 => { + CharacterKeyboardConfig { + keyboard_config: DEFAULT_KEYBOARD_CONFIG1, + } + }, + 2 => { + CharacterKeyboardConfig { + keyboard_config: DEFAULT_KEYBOARD_CONFIG2, + } + }, + 3 => { + CharacterKeyboardConfig { + keyboard_config: DEFAULT_KEYBOARD_CONFIG3, + } + }, + 4 => { + CharacterKeyboardConfig { + keyboard_config: DEFAULT_KEYBOARD_CONFIG4, + } + }, + _ => { + CharacterKeyboardConfig { + keyboard_config: DEFAULT_KEYBOARD_CONFIG1, + } + }, + } + } + + pub fn update(&mut self, new_config: &KeyboardConfig) { + self.keyboard_config = new_config.keyboard_config; + } + + pub fn as_bytes(&self) -> [u8; 0x16C] { + self.keyboard_config + } +} + +#[derive(Clone, Debug)] +pub struct CharacterGamepadConfig { + pub gamepad_config: [u8; 0x38], +} + +impl Default for CharacterGamepadConfig { + fn default() -> CharacterGamepadConfig { + CharacterGamepadConfig { + gamepad_config: DEFAULT_GAMEPAD_CONFIG, + } + } +} + +impl CharacterGamepadConfig { + pub fn update(&mut self, new_config: &GamepadConfig) { + self.gamepad_config = new_config.gamepad_config; + } + + pub fn as_bytes(&self) -> [u8; 0x38] { + self.gamepad_config + } +} + #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, Default, derive_more::Display)] pub struct CharacterEntityId(pub u32); @@ -287,10 +363,12 @@ pub struct NewCharacterEntity { pub tech_menu: CharacterTechMenu, pub option_flags: u32, + pub keyboard_config: CharacterKeyboardConfig, + pub gamepad_config: CharacterGamepadConfig, } impl NewCharacterEntity { - pub fn new(user: UserAccountId) -> NewCharacterEntity { + pub fn new(user: UserAccountId, keyboard_config_preset: usize,) -> NewCharacterEntity { NewCharacterEntity { user_id: user, slot: 0, @@ -306,6 +384,8 @@ impl NewCharacterEntity { materials: CharacterMaterials::default(), tech_menu: CharacterTechMenu::default(), option_flags: 0, + keyboard_config: CharacterKeyboardConfig::new(keyboard_config_preset), + gamepad_config: CharacterGamepadConfig::default(), } } } @@ -331,4 +411,6 @@ pub struct CharacterEntity { pub tech_menu: CharacterTechMenu, pub option_flags: u32, + pub keyboard_config: CharacterKeyboardConfig, + pub gamepad_config: CharacterGamepadConfig, } diff --git a/src/entity/gateway/inmemory.rs b/src/entity/gateway/inmemory.rs index 3d37761..5c7afb4 100644 --- a/src/entity/gateway/inmemory.rs +++ b/src/entity/gateway/inmemory.rs @@ -202,6 +202,8 @@ impl EntityGateway for InMemoryGateway { materials: character.materials, tech_menu: character.tech_menu, option_flags: character.option_flags, + keyboard_config: character.keyboard_config, + gamepad_config: character.gamepad_config, }; characters.insert(new_character.id, new_character.clone()); Ok(new_character) diff --git a/src/entity/gateway/postgres/models.rs b/src/entity/gateway/postgres/models.rs index 13df761..f2b8c94 100644 --- a/src/entity/gateway/postgres/models.rs +++ b/src/entity/gateway/postgres/models.rs @@ -49,8 +49,8 @@ pub struct PgUserSettings { id: i32, user_account: i32, blocked_users: Vec, //[u32; 0x1E], - key_config: Vec, //[u8; 0x16C], - joystick_config: Vec, //[u8; 0x38], + keyboard_config: Vec, //[u8; 0x16C], + gamepad_config: Vec, //[u8; 0x38], option_flags: i32, shortcuts: Vec, //[u8; 0xA40], symbol_chats: Vec, //[u8; 0x4E0], @@ -64,8 +64,8 @@ impl From for UserSettingsEntity { user_id: UserAccountId(other.user_account as u32), settings: settings::UserSettings { blocked_users: vec_to_array(other.blocked_users.chunks(4).map(|b| u32::from_le_bytes([b[0], b[1], b[2], b[3]])).collect()), - key_config: vec_to_array(other.key_config), - joystick_config: vec_to_array(other.joystick_config), + keyboard_config: vec_to_array(other.keyboard_config), + gamepad_config: vec_to_array(other.gamepad_config), option_flags: other.option_flags as u32, shortcuts: vec_to_array(other.shortcuts), symbol_chats: vec_to_array(other.symbol_chats), @@ -217,6 +217,8 @@ pub struct PgCharacter { tp: i16, tech_menu: Vec, + keyboard_config: Vec, + gamepad_config: Vec, } impl From for CharacterEntity { @@ -266,6 +268,12 @@ impl From for CharacterEntity { tech_menu: CharacterTechMenu { tech_menu: vec_to_array(other.tech_menu) }, + keyboard_config: CharacterKeyboardConfig { + keyboard_config: vec_to_array(other.keyboard_config) + }, + gamepad_config: CharacterGamepadConfig { + gamepad_config: vec_to_array(other.gamepad_config) + }, } } } diff --git a/src/entity/gateway/postgres/postgres.rs b/src/entity/gateway/postgres/postgres.rs index bbf116a..39be9ac 100644 --- a/src/entity/gateway/postgres/postgres.rs +++ b/src/entity/gateway/postgres/postgres.rs @@ -144,12 +144,12 @@ impl EntityGateway for PostgresGateway { } async fn create_user_settings(&mut self, settings: NewUserSettingsEntity) -> Result { - let new_settings = sqlx::query_as::<_, PgUserSettings>("insert into user_settings (user_account, blocked_users, key_config, joystick_config, option_flags, shortcuts, symbol_chats, team_name) + let new_settings = sqlx::query_as::<_, PgUserSettings>("insert into user_settings (user_account, blocked_users, keyboard_config, gamepad_config, option_flags, shortcuts, symbol_chats, team_name) values ($1, $2, $3, $4, $5, $6, $7, $8) returning *;") .bind(settings.user_id.0) .bind(settings.settings.blocked_users.iter().copied().flat_map(|i| i.to_le_bytes().to_vec()).collect::>()) - .bind(settings.settings.key_config.to_vec()) - .bind(settings.settings.joystick_config.to_vec()) + .bind(settings.settings.keyboard_config.to_vec()) + .bind(settings.settings.gamepad_config.to_vec()) .bind(settings.settings.option_flags as i32) .bind(settings.settings.shortcuts.to_vec()) .bind(settings.settings.symbol_chats.to_vec()) @@ -166,10 +166,10 @@ impl EntityGateway for PostgresGateway { } async fn save_user_settings(&mut self, settings: &UserSettingsEntity) -> Result<(), GatewayError> { - sqlx::query("update user_settings set blocked_users=$1, key_config=$2, joystick_config=$3, option_flags=$4, shortcuts=$5, symbol_chats=$6, team_name=$7 where id=$8") + sqlx::query("update user_settings set blocked_users=$1, keyboard_config=$2, gamepad_config=$3, option_flags=$4, shortcuts=$5, symbol_chats=$6, team_name=$7 where id=$8") .bind(settings.settings.blocked_users.iter().copied().flat_map(|i| i.to_le_bytes().to_vec()).collect::>()) - .bind(&settings.settings.key_config.to_vec()) - .bind(&settings.settings.joystick_config.to_vec()) + .bind(&settings.settings.keyboard_config.to_vec()) + .bind(&settings.settings.gamepad_config.to_vec()) .bind(&settings.settings.option_flags) .bind(&settings.settings.shortcuts.to_vec()) .bind(&settings.settings.symbol_chats.to_vec()) diff --git a/src/lib.rs b/src/lib.rs index 76e1020..b8ceb02 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,8 +1,6 @@ #![allow(incomplete_features)] -#![feature(maybe_uninit_extra)] #![feature(inline_const)] #![feature(drain_filter)] -#![feature(derive_default_enum)] #![feature(try_blocks)] diff --git a/src/login/character.rs b/src/login/character.rs index 69d43e7..f1192eb 100644 --- a/src/login/character.rs +++ b/src/login/character.rs @@ -385,8 +385,8 @@ impl CharacterServerState { } }; - let pkt = SendKeyAndTeamSettings::new(settings.settings.key_config, - settings.settings.joystick_config, 0, 0); + let pkt = SendKeyAndTeamSettings::new(settings.settings.keyboard_config, + settings.settings.gamepad_config, 0, 0); let pkt = SendCharacterPacket::SendKeyAndTeamSettings(Box::new(pkt)); Ok(vec![pkt]) @@ -712,7 +712,7 @@ impl InterserverActor for CharacterServerState { fn new_character_from_preview(user: &UserAccountEntity, preview: &CharacterPreview) -> NewCharacterEntity { - let mut character = NewCharacterEntity::new(user.id); + let mut character = NewCharacterEntity::new(user.id, 1); // it should not be possible for the client to specify the kbm config preset from the char create screen character.slot = preview.slot; character.name = String::from_utf16_lossy(&preview.character.name).trim_matches(char::from(0)).into(); character.section_id = preview.character.section_id.into(); diff --git a/src/ship/character.rs b/src/ship/character.rs index e5d4429..39064aa 100644 --- a/src/ship/character.rs +++ b/src/ship/character.rs @@ -82,7 +82,6 @@ impl<'a> CharacterBytesBuilder<'a> { } } - #[derive(Default)] pub struct FullCharacterBytesBuilder<'a> { character: Option<&'a CharacterEntity>, @@ -91,8 +90,8 @@ pub struct FullCharacterBytesBuilder<'a> { meseta: Option, inventory: Option<&'a CharacterInventory>, bank: Option<&'a CharacterBank>, - key_config: Option<&'a [u8; 0x16C]>, - joystick_config: Option<&'a [u8; 0x38]>, + keyboard_config: Option<&'a [u8; 0x16C]>, + gamepad_config: Option<&'a [u8; 0x38]>, symbol_chat: Option<&'a [u8; 1248]>, tech_menu: Option<&'a [u8; 40]>, option_flags: Option, @@ -148,17 +147,17 @@ impl<'a> FullCharacterBytesBuilder<'a> { } #[must_use] - pub fn key_config(self, key_config: &'a [u8; 0x16C]) -> FullCharacterBytesBuilder<'a> { + pub fn keyboard_config(self, keyboard_config: &'a [u8; 0x16C]) -> FullCharacterBytesBuilder<'a> { FullCharacterBytesBuilder { - key_config: Some(key_config), + keyboard_config: Some(keyboard_config), ..self } } #[must_use] - pub fn joystick_config(self, joystick_config: &'a [u8; 0x38]) -> FullCharacterBytesBuilder<'a> { + pub fn gamepad_config(self, gamepad_config: &'a [u8; 0x38]) -> FullCharacterBytesBuilder<'a> { FullCharacterBytesBuilder { - joystick_config: Some(joystick_config), + gamepad_config: Some(gamepad_config), ..self } } @@ -194,8 +193,8 @@ impl<'a> FullCharacterBytesBuilder<'a> { let meseta = self.meseta.unwrap(); let inventory = self.inventory.unwrap(); let bank = self.bank.unwrap(); - let key_config = self.key_config.unwrap(); - let joystick_config = self.joystick_config.unwrap(); + let keyboard_config = self.keyboard_config.unwrap(); + let gamepad_config = self.gamepad_config.unwrap(); let symbol_chat = self.symbol_chat.unwrap(); let tech_menu = self.tech_menu.unwrap(); let option_flags = self.option_flags.unwrap(); @@ -222,8 +221,8 @@ impl<'a> FullCharacterBytesBuilder<'a> { ..character::Inventory::default() }, key_team_config: character::KeyTeamConfig { - key_config: *key_config, - joystick_config: *joystick_config, + keyboard_config: *keyboard_config, + gamepad_config: *gamepad_config, ..character::KeyTeamConfig::default() }, info_board: character.info_board.as_bytes(), diff --git a/src/ship/items/transaction.rs b/src/ship/items/transaction.rs index 293a8de..bc0d0a9 100644 --- a/src/ship/items/transaction.rs +++ b/src/ship/items/transaction.rs @@ -163,7 +163,7 @@ mod test { item_manager.id_counter += self.value; entity_gateway.create_character(NewCharacterEntity { slot: self.value, - ..NewCharacterEntity::new(UserAccountId(0)) + ..NewCharacterEntity::new(UserAccountId(0), 1) // TODO: handle different keyboard_config_presets }) .await?; Ok(()) @@ -209,7 +209,7 @@ mod test { #[derive(Default, Clone)] struct DummyGateway { - d1_set: String, + _d1_set: String, d2_inc: u32, } @@ -224,10 +224,10 @@ mod test { #[async_trait::async_trait] impl ItemAction for DummyAction1 { - async fn commit(&self, item_manager: &mut ItemManager, entity_gateway: &mut EG) -> Result<(), TransactionCommitError> { + async fn commit(&self, _item_manager: &mut ItemManager, entity_gateway: &mut EG) -> Result<(), TransactionCommitError> { entity_gateway.create_character(NewCharacterEntity { slot: 1, - ..NewCharacterEntity::new(UserAccountId(0)) + ..NewCharacterEntity::new(UserAccountId(0), 1) // TODO: handle different keyboard_config_presets }) .await?; Ok(()) @@ -236,10 +236,10 @@ mod test { #[async_trait::async_trait] impl ItemAction for DummyAction2 { - async fn commit(&self, item_manager: &mut ItemManager, entity_gateway: &mut EG) -> Result<(), TransactionCommitError> { + async fn commit(&self, _item_manager: &mut ItemManager, entity_gateway: &mut EG) -> Result<(), TransactionCommitError> { entity_gateway.create_character(NewCharacterEntity { slot: 1, - ..NewCharacterEntity::new(UserAccountId(0)) + ..NewCharacterEntity::new(UserAccountId(0), 1) // TODO: handle different keyboard_config_presets }) .await?; Ok(()) @@ -279,7 +279,7 @@ mod test { #[derive(Default, Clone)] struct DummyGateway { - d1_set: String, + _d1_set: String, d2_inc: u32, } @@ -294,10 +294,10 @@ mod test { #[async_trait::async_trait] impl ItemAction for DummyAction1 { - async fn commit(&self, item_manager: &mut ItemManager, entity_gateway: &mut EG) -> Result<(), TransactionCommitError> { + async fn commit(&self, _item_manager: &mut ItemManager, entity_gateway: &mut EG) -> Result<(), TransactionCommitError> { entity_gateway.create_character(NewCharacterEntity { slot: 1, - ..NewCharacterEntity::new(UserAccountId(0)) + ..NewCharacterEntity::new(UserAccountId(0), 1) // TODO: handle different keyboard_config_presets }) .await?; Err(GatewayError::Error.into()) @@ -306,10 +306,10 @@ mod test { #[async_trait::async_trait] impl ItemAction for DummyAction2 { - async fn commit(&self, item_manager: &mut ItemManager, entity_gateway: &mut EG) -> Result<(), TransactionCommitError> { + async fn commit(&self, _item_manager: &mut ItemManager, entity_gateway: &mut EG) -> Result<(), TransactionCommitError> { entity_gateway.create_character(NewCharacterEntity { slot: 1, - ..NewCharacterEntity::new(UserAccountId(0)) + ..NewCharacterEntity::new(UserAccountId(0), 1) // TODO: handle different keyboard_config_presets }) .await?; Ok(()) diff --git a/src/ship/packet/handler/lobby.rs b/src/ship/packet/handler/lobby.rs index b0004fb..37f18da 100644 --- a/src/ship/packet/handler/lobby.rs +++ b/src/ship/packet/handler/lobby.rs @@ -32,8 +32,8 @@ pub fn block_selected(id: ClientId, .meseta(*meseta) .inventory(inventory) .bank(bank) - .key_config(&client.settings.settings.key_config) - .joystick_config(&client.settings.settings.joystick_config) + .keyboard_config(&client.character.keyboard_config.as_bytes()) + .gamepad_config(&client.character.gamepad_config.as_bytes()) .symbol_chat(&client.settings.settings.symbol_chats) .tech_menu(&client.character.tech_menu.as_bytes()) .option_flags(client.character.option_flags) diff --git a/src/ship/packet/handler/settings.rs b/src/ship/packet/handler/settings.rs index b2df392..17d0d64 100644 --- a/src/ship/packet/handler/settings.rs +++ b/src/ship/packet/handler/settings.rs @@ -19,9 +19,31 @@ pub async fn save_options(id: ClientId, clients: &mut Clients, entity_gateway: &mut EG) -> Box + Send> { - // // TODO: don't unwrap? + // TODO: don't unwrap? let client = clients.get_mut(&id).ok_or(ShipError::ClientNotFound(id)).unwrap(); client.character.option_flags = save_options.options; entity_gateway.save_character(&client.character).await.unwrap(); Box::new(None.into_iter()) } + +pub async fn keyboard_config(id: ClientId, + keyboard_config: &KeyboardConfig, + clients: &mut Clients, + entity_gateway: &mut EG) + -> Box + Send> { + let client = clients.get_mut(&id).ok_or(ShipError::ClientNotFound(id)).unwrap(); + client.character.keyboard_config.update(keyboard_config); + entity_gateway.save_character(&client.character).await.unwrap(); + Box::new(None.into_iter()) +} + +pub async fn gamepad_config(id: ClientId, + gamepad_config: &GamepadConfig, + clients: &mut Clients, + entity_gateway: &mut EG) + -> Box + Send> { + let client = clients.get_mut(&id).ok_or(ShipError::ClientNotFound(id)).unwrap(); + client.character.gamepad_config.update(gamepad_config); + entity_gateway.save_character(&client.character).await.unwrap(); + Box::new(None.into_iter()) +} \ No newline at end of file diff --git a/src/ship/ship.rs b/src/ship/ship.rs index ae0fd08..4cf5e2a 100644 --- a/src/ship/ship.rs +++ b/src/ship/ship.rs @@ -92,7 +92,6 @@ pub enum RecvShipPacket { PlayerChat(PlayerChat), CreateRoom(CreateRoom), RoomNameRequest(RoomNameRequest), - UpdateConfig(UpdateConfig), ViewInfoboardRequest(ViewInfoboardRequest), WriteInfoboard(WriteInfoboard), RoomListRequest(RoomListRequest), @@ -114,6 +113,9 @@ pub enum RecvShipPacket { RequestShipBlockList(RequestShipBlockList), ItemsToTrade(ItemsToTrade), TradeConfirmed(TradeConfirmed), + KeyboardConfig(KeyboardConfig), + GamepadConfig(GamepadConfig), + UpdateConfig(UpdateConfig), } impl RecvServerPacket for RecvShipPacket { @@ -138,7 +140,6 @@ impl RecvServerPacket for RecvShipPacket { 0x06 => Ok(RecvShipPacket::PlayerChat(PlayerChat::from_bytes(data)?)), 0xC1 => Ok(RecvShipPacket::CreateRoom(CreateRoom::from_bytes(data)?)), 0x8A => Ok(RecvShipPacket::RoomNameRequest(RoomNameRequest::from_bytes(data)?)), - 0x7ED => Ok(RecvShipPacket::UpdateConfig(UpdateConfig::from_bytes(data)?)), 0xD8 => Ok(RecvShipPacket::ViewInfoboardRequest(ViewInfoboardRequest::from_bytes(data)?)), 0xD9 => Ok(RecvShipPacket::WriteInfoboard(WriteInfoboard::from_bytes(data)?)), 0x08 => Ok(RecvShipPacket::RoomListRequest(RoomListRequest::from_bytes(data)?)), @@ -155,6 +156,9 @@ impl RecvServerPacket for RecvShipPacket { 0xD2 => Ok(RecvShipPacket::TradeConfirmed(TradeConfirmed::from_bytes(data)?)), 0xE7 => Ok(RecvShipPacket::FullCharacterData(Box::new(FullCharacterData::from_bytes(data)?))), 0x1ED => Ok(RecvShipPacket::SaveOptions(SaveOptions::from_bytes(data)?)), + 0x4ED => Ok(RecvShipPacket::KeyboardConfig(KeyboardConfig::from_bytes(data)?)), + 0x5ED => Ok(RecvShipPacket::GamepadConfig(GamepadConfig::from_bytes(data)?)), + 0x7ED => Ok(RecvShipPacket::UpdateConfig(UpdateConfig::from_bytes(data)?)), _ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]), data.to_vec())) } } @@ -743,6 +747,12 @@ impl ServerState for ShipServerState { let block = self.blocks.with_client(id, &self.clients)?; handler::trade::trade_confirmed(id, &mut self.entity_gateway, &block.client_location, &mut self.clients, &mut self.item_manager, &mut self.trades).await? }, + RecvShipPacket::KeyboardConfig(keyboard_config) => { + handler::settings::keyboard_config(id, keyboard_config, &mut self.clients, &mut self.entity_gateway).await + }, + RecvShipPacket::GamepadConfig(gamepad_config) => { + handler::settings::gamepad_config(id, gamepad_config, &mut self.clients, &mut self.entity_gateway).await + }, }) } diff --git a/tests/common.rs b/tests/common.rs index 857a80d..a44679f 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -13,7 +13,7 @@ use libpso::packet::login::{Login, Session}; use libpso::{utf8_to_array, utf8_to_utf16_array}; -pub async fn new_user_character(entity_gateway: &mut EG, username: &str, password: &str) -> (UserAccountEntity, CharacterEntity) { +pub async fn new_user_character(entity_gateway: &mut EG, username: &str, password: &str, kb_conf_preset: usize) -> (UserAccountEntity, CharacterEntity) { let new_user = NewUserAccountEntity { email: format!("{}@pso.com", username), username: username.into(), @@ -26,7 +26,7 @@ pub async fn new_user_character(entity_gateway: &mut EG, user let user = entity_gateway.create_user(new_user).await.unwrap(); let new_settings = NewUserSettingsEntity::new(user.id); let _settings = entity_gateway.create_user_settings(new_settings).await.unwrap(); - let new_character = NewCharacterEntity::new(user.id); + let new_character = NewCharacterEntity::new(user.id, kb_conf_preset); let character = entity_gateway.create_character(new_character).await.unwrap(); entity_gateway.set_character_meseta(&character.id, Meseta(0)).await.unwrap(); entity_gateway.set_bank_meseta(&character.id, BankName("".into()), Meseta(0)).await.unwrap(); diff --git a/tests/test_bank.rs b/tests/test_bank.rs index 605a3aa..75777ab 100644 --- a/tests/test_bank.rs +++ b/tests/test_bank.rs @@ -15,8 +15,8 @@ use common::*; async fn test_bank_items_sent_in_character_login() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let item = entity_gateway.create_item( item::NewItemEntity { @@ -50,8 +50,8 @@ async fn test_bank_items_sent_in_character_login() { async fn test_request_bank_items() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut bank = Vec::new(); for _ in 0..3 { @@ -98,8 +98,8 @@ async fn test_request_bank_items() { async fn test_request_stacked_bank_items() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut monomates = Vec::new(); for _ in 0..3usize { @@ -141,8 +141,8 @@ async fn test_request_stacked_bank_items() { async fn test_request_bank_items_sorted() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let item1 = entity_gateway.create_item( item::NewItemEntity { @@ -207,8 +207,8 @@ async fn test_request_bank_items_sorted() { async fn test_deposit_individual_item() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let item0 = entity_gateway.create_item( item::NewItemEntity { @@ -280,8 +280,8 @@ async fn test_deposit_individual_item() { async fn test_deposit_stacked_item() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut monomates = Vec::new(); for _ in 0..3usize { @@ -341,8 +341,8 @@ async fn test_deposit_stacked_item() { async fn test_deposit_partial_stacked_item() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut monomates = Vec::new(); for _ in 0..3usize { @@ -411,8 +411,8 @@ async fn test_deposit_partial_stacked_item() { async fn test_deposit_stacked_item_with_stack_already_in_bank() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut bank_monomates = Vec::new(); let mut inventory_monomates = Vec::new(); @@ -483,7 +483,7 @@ async fn test_deposit_stacked_item_with_stack_already_in_bank() { async fn test_deposit_stacked_item_with_full_stack_in_bank() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut inventory_monomates = Vec::new(); for _ in 0..2usize { @@ -555,7 +555,7 @@ async fn test_deposit_stacked_item_with_full_stack_in_bank() { async fn test_deposit_individual_item_in_full_bank() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut inventory = Vec::new(); inventory.push(entity_gateway.create_item( @@ -629,7 +629,7 @@ async fn test_deposit_individual_item_in_full_bank() { async fn test_deposit_stacked_item_in_full_bank() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut monomates = Vec::new(); for _ in 0..2usize { @@ -702,7 +702,7 @@ async fn test_deposit_stacked_item_in_full_bank() { async fn test_deposit_stacked_item_in_full_bank_with_partial_stack() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut monomates = Vec::new(); for _ in 0..2usize { @@ -785,7 +785,7 @@ async fn test_deposit_stacked_item_in_full_bank_with_partial_stack() { async fn test_deposit_meseta() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; entity_gateway.set_character_meseta(&char1.id, item::Meseta(300)).await.unwrap(); let mut ship = Box::new(ShipServerState::builder() @@ -821,7 +821,7 @@ async fn test_deposit_meseta() { async fn test_deposit_too_much_meseta() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; entity_gateway.set_character_meseta(&char1.id, item::Meseta(300)).await.unwrap(); entity_gateway.set_bank_meseta(&char1.id, item::BankName("".into()), item::Meseta(999980)).await.unwrap(); @@ -858,7 +858,7 @@ async fn test_deposit_too_much_meseta() { async fn test_deposit_meseta_when_bank_is_maxed() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; entity_gateway.set_character_meseta(&char1.id, item::Meseta(300)).await.unwrap(); entity_gateway.set_bank_meseta(&char1.id, item::BankName("".into()), item::Meseta(999999)).await.unwrap(); @@ -896,8 +896,8 @@ async fn test_deposit_meseta_when_bank_is_maxed() { async fn test_withdraw_individual_item() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut bank = Vec::new(); bank.push(entity_gateway.create_item( @@ -958,8 +958,8 @@ async fn test_withdraw_individual_item() { async fn test_withdraw_stacked_item() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut monomates = Vec::new(); for _ in 0..3usize { @@ -1018,8 +1018,8 @@ async fn test_withdraw_stacked_item() { async fn test_withdraw_partial_stacked_item() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut monomates = Vec::new(); for _ in 0..3usize { @@ -1084,8 +1084,8 @@ async fn test_withdraw_partial_stacked_item() { async fn test_withdraw_stacked_item_with_stack_already_in_inventory() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut inventory_monomates = Vec::new(); let mut bank_monomates = Vec::new(); @@ -1158,7 +1158,7 @@ async fn test_withdraw_stacked_item_with_stack_already_in_inventory() { async fn test_withdraw_stacked_item_with_full_stack_in_inventory() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut bank_monomates = Vec::new(); for _ in 0..2usize { @@ -1230,7 +1230,7 @@ async fn test_withdraw_stacked_item_with_full_stack_in_inventory() { async fn test_withdraw_individual_item_in_full_inventory() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut bank = Vec::new(); bank.push(entity_gateway.create_item( @@ -1300,7 +1300,7 @@ async fn test_withdraw_individual_item_in_full_inventory() { async fn test_withdraw_stacked_item_in_full_inventory() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut monomates = Vec::new(); for _ in 0..2usize { @@ -1374,7 +1374,7 @@ async fn test_withdraw_stacked_item_in_full_inventory() { async fn test_withdraw_stacked_item_in_full_inventory_with_partial_stack() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut bank_item = Vec::new(); for _ in 0..2usize { @@ -1390,7 +1390,7 @@ async fn test_withdraw_stacked_item_in_full_inventory_with_partial_stack() { entity_gateway.set_character_bank(&char1.id, &item::BankEntity::new(vec![bank_item]), item::BankName("".into())).await.unwrap(); let mut items = Vec::new(); - for i in 0..29usize { + for _i in 0..29usize { items.push(entity_gateway.create_item( item::NewItemEntity { item: item::ItemDetail::Weapon( @@ -1460,7 +1460,7 @@ async fn test_withdraw_stacked_item_in_full_inventory_with_partial_stack() { async fn test_withdraw_meseta() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; entity_gateway.set_bank_meseta(&char1.id, item::BankName("".into()), item::Meseta(300)).await.unwrap(); let mut ship = Box::new(ShipServerState::builder() @@ -1496,7 +1496,7 @@ async fn test_withdraw_meseta() { async fn test_withdraw_too_much_meseta() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; entity_gateway.set_character_meseta(&char1.id, item::Meseta(999980)).await.unwrap(); entity_gateway.set_bank_meseta(&char1.id, item::BankName("".into()), item::Meseta(300)).await.unwrap(); @@ -1533,7 +1533,7 @@ async fn test_withdraw_too_much_meseta() { async fn test_withdraw_meseta_inventory_is_maxed() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap(); entity_gateway.set_bank_meseta(&char1.id, item::BankName("".into()), item::Meseta(300)).await.unwrap(); diff --git a/tests/test_character.rs b/tests/test_character.rs index f46fa67..73eaf75 100644 --- a/tests/test_character.rs +++ b/tests/test_character.rs @@ -2,6 +2,7 @@ use elseware::common::serverstate::{ClientId, ServerState}; use elseware::entity::gateway::{EntityGateway, InMemoryGateway}; use elseware::ship::ship::{ShipServerState, RecvShipPacket}; +use libpso::character::settings::{DEFAULT_KEYBOARD_CONFIG1, DEFAULT_KEYBOARD_CONFIG2, DEFAULT_KEYBOARD_CONFIG3, DEFAULT_KEYBOARD_CONFIG4}; use libpso::packet::ship::*; #[path = "common.rs"] @@ -12,7 +13,7 @@ use common::*; async fn test_save_options() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut ship = Box::new(ShipServerState::builder() .gateway(entity_gateway.clone()) @@ -29,3 +30,73 @@ async fn test_save_options() { assert!(char.option_flags == 12345); } + +#[async_std::test] +async fn test_default3_keyboard_mappings() { + /* + check if keyboard is set to default3 when specified. this will only occur for things like creating characters from the web page. + normal client behaviour will simply use default1 when creating a character. + gamepad only has 1 default config + */ + let mut entity_gateway = InMemoryGateway::default(); + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 3).await; + assert!(char1.keyboard_config.as_bytes() == DEFAULT_KEYBOARD_CONFIG3); +} + +#[async_std::test] +async fn test_invalid_keyboard_preset_value() { + // check if keyboard_config self-corrects to DEFAULT1 if an invalid value (>4) is given + let mut entity_gateway = InMemoryGateway::default(); + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 10).await; + assert!(char1.keyboard_config.as_bytes() == DEFAULT_KEYBOARD_CONFIG1); +} + +#[async_std::test] +async fn test_change_keyboard_mappings() { + let mut entity_gateway = InMemoryGateway::default(); + + let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 2).await; + + let mut ship = Box::new(ShipServerState::builder() + .gateway(entity_gateway.clone()) + .build()); + log_in_char(&mut ship, ClientId(1), "a1", "a").await; + join_lobby(&mut ship, ClientId(1)).await; + + assert!(char1.keyboard_config.as_bytes() == DEFAULT_KEYBOARD_CONFIG2); + + // update from default2 to default4 + // the client simply sends the full 364 bytes... + ship.handle(ClientId(1), &RecvShipPacket::KeyboardConfig(KeyboardConfig{ + keyboard_config: [ + 0, 0, 0, 0, 117, 0, 0, 0, 0, 0, 0, 0, 105, 0, 0, 0, + 0, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 115, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 97, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, + 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, + 0, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, + 0, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, + 0, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0, 94, 0, 0, 0, + 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, + 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, + 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, + 0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 71, 0, 0, 0, + 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 73, 0, 0, 0, + 0, 0, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 75, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, + 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, + 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, + 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 51, 0, 0, 0, 1, 0, 0, 0 + ], + })).await.unwrap().for_each(drop); + + let characters = entity_gateway.get_characters_by_user(&user1).await.unwrap(); + let char = characters[0].as_ref().unwrap(); + + assert!(char.keyboard_config.as_bytes() == DEFAULT_KEYBOARD_CONFIG4); +} diff --git a/tests/test_exp_gain.rs b/tests/test_exp_gain.rs index 2223c8e..0db6ba9 100644 --- a/tests/test_exp_gain.rs +++ b/tests/test_exp_gain.rs @@ -15,7 +15,7 @@ use common::*; async fn test_character_gains_exp() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut ship = Box::new(ShipServerState::builder() .gateway(entity_gateway.clone()) @@ -52,7 +52,7 @@ async fn test_character_gains_exp() { async fn test_character_levels_up() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; char1.exp = 49; entity_gateway.save_character(&char1).await.unwrap(); @@ -92,7 +92,7 @@ async fn test_character_levels_up() { async fn test_character_levels_up_multiple_times() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut ship = Box::new(ShipServerState::builder() .gateway(entity_gateway.clone()) @@ -136,8 +136,8 @@ async fn test_character_levels_up_multiple_times() { async fn test_one_character_gets_full_exp_and_other_attacker_gets_partial() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut ship = Box::new(ShipServerState::builder() .gateway(entity_gateway.clone()) diff --git a/tests/test_item_actions.rs b/tests/test_item_actions.rs index 456a505..ab91b2f 100644 --- a/tests/test_item_actions.rs +++ b/tests/test_item_actions.rs @@ -14,7 +14,7 @@ use common::*; async fn test_equip_unit_from_equip_menu() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); p1_inv.push(entity_gateway.create_item( @@ -91,7 +91,7 @@ async fn test_equip_unit_from_equip_menu() { async fn test_unequip_armor_with_units() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); p1_inv.push(entity_gateway.create_item( @@ -159,7 +159,7 @@ async fn test_unequip_armor_with_units() { async fn test_sort_items() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); p1_inv.push(entity_gateway.create_item( diff --git a/tests/test_item_pickup.rs b/tests/test_item_pickup.rs index 7feb377..9520527 100644 --- a/tests/test_item_pickup.rs +++ b/tests/test_item_pickup.rs @@ -14,8 +14,8 @@ use common::*; async fn test_pick_up_individual_item() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p1_inv = Vec::new(); p1_inv.push(entity_gateway.create_item( @@ -85,8 +85,8 @@ async fn test_pick_up_individual_item() { async fn test_pick_up_item_stack_of_items_already_in_inventory() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p1_monomate = Vec::new(); p1_monomate.push(entity_gateway.create_item( @@ -99,7 +99,7 @@ async fn test_pick_up_item_stack_of_items_already_in_inventory() { }).await.unwrap()); let mut p2_items = Vec::new(); - for (slot, tool) in vec![item::tool::ToolType::Monomate, item::tool::ToolType::Monofluid].into_iter().enumerate() { + for (_slot, tool) in vec![item::tool::ToolType::Monomate, item::tool::ToolType::Monofluid].into_iter().enumerate() { let mut item = Vec::new(); for _ in 0..5usize { item.push(entity_gateway.create_item( @@ -161,8 +161,8 @@ async fn test_pick_up_item_stack_of_items_already_in_inventory() { async fn test_pick_up_item_stack_of_items_not_already_held() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p2_monomate = Vec::new(); p2_monomate.push(entity_gateway.create_item( @@ -220,8 +220,8 @@ async fn test_pick_up_item_stack_of_items_not_already_held() { async fn test_pick_up_meseta_when_inventory_full() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p1_items = Vec::new(); for _ in 0..30usize { @@ -292,11 +292,11 @@ async fn test_pick_up_meseta_when_inventory_full() { async fn test_pick_up_partial_stacked_item_when_inventory_is_otherwise_full() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p1_inv = Vec::new(); - for slot in 0..29usize { + for _slot in 0..29usize { p1_inv.push(entity_gateway.create_item( item::NewItemEntity { item: item::ItemDetail::Weapon( @@ -375,11 +375,11 @@ async fn test_pick_up_partial_stacked_item_when_inventory_is_otherwise_full() { async fn test_can_not_pick_up_item_when_inventory_full() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p1_inv = Vec::new(); - for slot in 0..30usize { + for _slot in 0..30usize { p1_inv.push(entity_gateway.create_item( item::NewItemEntity { item: item::ItemDetail::Weapon( @@ -465,7 +465,7 @@ async fn test_can_not_pick_up_item_when_inventory_full() { async fn test_can_not_drop_more_meseta_than_is_held() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; entity_gateway.set_character_meseta(&char1.id, item::Meseta(300)).await.unwrap(); @@ -504,8 +504,8 @@ async fn test_can_not_drop_more_meseta_than_is_held() { async fn test_pick_up_stack_that_would_exceed_stack_limit() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p1_monomates = Vec::new(); for _ in 0..6usize { @@ -578,8 +578,8 @@ async fn test_pick_up_stack_that_would_exceed_stack_limit() { async fn test_can_not_pick_up_meseta_when_full() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap(); entity_gateway.set_character_meseta(&char2.id, item::Meseta(300)).await.unwrap(); @@ -632,8 +632,8 @@ async fn test_can_not_pick_up_meseta_when_full() { async fn test_meseta_caps_at_999999_when_trying_to_pick_up_more() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; entity_gateway.set_character_meseta(&char1.id, item::Meseta(999998)).await.unwrap(); entity_gateway.set_character_meseta(&char2.id, item::Meseta(300)).await.unwrap(); @@ -685,8 +685,8 @@ async fn test_meseta_caps_at_999999_when_trying_to_pick_up_more() { async fn test_player_drops_partial_stack_and_other_player_picks_it_up() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut monomates = Vec::new(); for _ in 0..5usize { diff --git a/tests/test_item_use.rs b/tests/test_item_use.rs index 45c9f3e..9151a0c 100644 --- a/tests/test_item_use.rs +++ b/tests/test_item_use.rs @@ -16,7 +16,7 @@ use common::*; async fn test_use_monomate() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_items = Vec::new(); for tool in vec![item::tool::ToolType::Monomate, item::tool::ToolType::Monofluid].into_iter() { @@ -63,7 +63,7 @@ async fn test_use_monomate() { async fn test_use_monomate_twice() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_items = Vec::new(); for tool in vec![item::tool::ToolType::Monomate, item::tool::ToolType::Monofluid].into_iter() { @@ -115,7 +115,7 @@ async fn test_use_monomate_twice() { async fn test_use_last_monomate() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); for tool in vec![item::tool::ToolType::Monomate, item::tool::ToolType::Monofluid].into_iter() { @@ -157,7 +157,7 @@ async fn test_use_last_monomate() { async fn test_use_nonstackable_tool() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_items = Vec::new(); p1_items.push(entity_gateway.create_item( @@ -192,7 +192,7 @@ async fn test_use_nonstackable_tool() { async fn test_use_materials() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); for tool in vec![item::tool::ToolType::PowerMaterial, item::tool::ToolType::LuckMaterial].into_iter() { diff --git a/tests/test_mags.rs b/tests/test_mags.rs index 9886215..3a6b0fd 100644 --- a/tests/test_mags.rs +++ b/tests/test_mags.rs @@ -1,7 +1,7 @@ use elseware::common::serverstate::{ClientId, ServerState}; use elseware::entity::gateway::{EntityGateway, InMemoryGateway}; use elseware::entity::item; -use elseware::ship::ship::{ShipServerState, RecvShipPacket, SendShipPacket}; +use elseware::ship::ship::{ShipServerState, RecvShipPacket}; use elseware::entity::character::{CharacterClass, SectionID}; use libpso::packet::ship::*; @@ -15,7 +15,7 @@ use common::*; async fn test_mag_feed() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mag = entity_gateway.create_item( item::NewItemEntity { @@ -87,8 +87,8 @@ async fn test_mag_feed() { async fn test_mag_change_owner() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, mut char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, mut char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; char1.char_class = CharacterClass::RAmarl; char1.section_id = SectionID::Redria; entity_gateway.save_character(&char1).await.unwrap(); @@ -152,7 +152,7 @@ async fn test_mag_change_owner() { async fn test_mag_cell() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mag = entity_gateway.create_item( item::NewItemEntity { diff --git a/tests/test_rooms.rs b/tests/test_rooms.rs index a03fdd6..f435c45 100644 --- a/tests/test_rooms.rs +++ b/tests/test_rooms.rs @@ -4,7 +4,7 @@ use elseware::entity::item; use elseware::ship::ship::{ShipServerState, RecvShipPacket, SendShipPacket}; use libpso::packet::ship::*; -use libpso::packet::messages::*; +//use libpso::packet::messages::*; #[path = "common.rs"] mod common; @@ -15,8 +15,8 @@ use common::*; async fn test_item_ids_reset_when_rejoining_rooms() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p1_inv = Vec::new(); for _ in 0..3usize { @@ -99,7 +99,7 @@ async fn test_item_ids_reset_when_rejoining_rooms() { #[async_std::test] async fn test_load_rare_monster_default_appear_rates() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut ship = Box::new(ShipServerState::builder() .gateway(entity_gateway.clone()) .build()); @@ -119,7 +119,7 @@ async fn test_load_rare_monster_default_appear_rates() { #[async_std::test] async fn test_set_valid_quest_group() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut ship = Box::new(ShipServerState::builder() .gateway(entity_gateway.clone()) .build()); @@ -139,7 +139,7 @@ async fn test_set_valid_quest_group() { #[async_std::test] async fn test_set_invalid_quest_group() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut ship = Box::new(ShipServerState::builder() .gateway(entity_gateway.clone()) .build()); diff --git a/tests/test_shops.rs b/tests/test_shops.rs index 27d7f06..c4c4655 100644 --- a/tests/test_shops.rs +++ b/tests/test_shops.rs @@ -16,7 +16,7 @@ use common::*; async fn test_player_opens_weapon_shop() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; char1.exp = 80000000; entity_gateway.save_character(&char1).await.unwrap(); @@ -46,7 +46,7 @@ async fn test_player_opens_weapon_shop() { async fn test_player_opens_tool_shop() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; char1.exp = 80000000; entity_gateway.save_character(&char1).await.unwrap(); @@ -76,7 +76,7 @@ async fn test_player_opens_tool_shop() { async fn test_player_opens_armor_shop() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; char1.exp = 80000000; entity_gateway.save_character(&char1).await.unwrap(); @@ -106,7 +106,7 @@ async fn test_player_opens_armor_shop() { async fn test_player_buys_from_weapon_shop() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; char1.exp = 80000000; entity_gateway.save_character(&char1).await.unwrap(); entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap(); @@ -144,7 +144,7 @@ async fn test_player_buys_from_weapon_shop() { async fn test_player_buys_from_tool_shop() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; char1.exp = 80000000; entity_gateway.save_character(&char1).await.unwrap(); entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap(); @@ -181,7 +181,7 @@ async fn test_player_buys_from_tool_shop() { async fn test_player_buys_multiple_from_tool_shop() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; char1.exp = 80000000; entity_gateway.save_character(&char1).await.unwrap(); entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap(); @@ -222,7 +222,7 @@ async fn test_player_buys_multiple_from_tool_shop() { async fn test_player_buys_from_armor_shop() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; char1.exp = 80000000; entity_gateway.save_character(&char1).await.unwrap(); entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap(); @@ -259,7 +259,7 @@ async fn test_player_buys_from_armor_shop() { async fn test_player_sells_3_attr_weapon_to_shop() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); @@ -303,8 +303,8 @@ async fn test_player_sells_3_attr_weapon_to_shop() { async fn test_other_clients_see_purchase() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; char1.exp = 80000000; entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap(); entity_gateway.save_character(&char1).await.unwrap(); @@ -346,8 +346,8 @@ async fn test_other_clients_see_purchase() { async fn test_other_clients_see_stacked_purchase() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; char1.exp = 80000000; entity_gateway.save_character(&char1).await.unwrap(); entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap(); @@ -397,7 +397,7 @@ async fn test_other_clients_see_stacked_purchase() { async fn test_buying_item_without_enough_mseseta() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut ship = Box::new(ShipServerState::builder() .gateway(entity_gateway.clone()) @@ -432,7 +432,7 @@ async fn test_buying_item_without_enough_mseseta() { async fn test_player_double_buys_from_tool_shop() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; char1.exp = 80000000; entity_gateway.save_character(&char1).await.unwrap(); entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap(); @@ -497,7 +497,7 @@ async fn test_player_double_buys_from_tool_shop() { async fn test_techs_disappear_from_shop_when_bought() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; char1.exp = 80000000; entity_gateway.save_character(&char1).await.unwrap(); entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap(); @@ -559,7 +559,7 @@ async fn test_techs_disappear_from_shop_when_bought() { async fn test_units_disappear_from_shop_when_bought() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, mut char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; char1.exp = 80000000; entity_gateway.save_character(&char1).await.unwrap(); entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap(); @@ -620,7 +620,7 @@ async fn test_units_disappear_from_shop_when_bought() { async fn test_player_sells_untekked_weapon() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); @@ -664,7 +664,7 @@ async fn test_player_sells_untekked_weapon() { async fn test_player_sells_rare_item() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); @@ -708,7 +708,7 @@ async fn test_player_sells_rare_item() { async fn test_player_sells_partial_photon_drop_stack() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); @@ -751,7 +751,7 @@ async fn test_player_sells_partial_photon_drop_stack() { async fn test_player_sells_basic_frame() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); @@ -792,7 +792,7 @@ async fn test_player_sells_basic_frame() { async fn test_player_sells_max_frame() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); @@ -833,7 +833,7 @@ async fn test_player_sells_max_frame() { async fn test_player_sells_basic_barrier() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); @@ -873,7 +873,7 @@ async fn test_player_sells_basic_barrier() { async fn test_player_sells_max_barrier() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); @@ -913,7 +913,7 @@ async fn test_player_sells_max_barrier() { async fn test_player_sells_1_star_minusminus_unit() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); @@ -952,7 +952,7 @@ async fn test_player_sells_1_star_minusminus_unit() { async fn test_player_sells_5_star_plusplus_unit() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); @@ -991,7 +991,7 @@ async fn test_player_sells_5_star_plusplus_unit() { async fn test_player_sells_rare_frame() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); @@ -1032,7 +1032,7 @@ async fn test_player_sells_rare_frame() { async fn test_player_sells_rare_barrier() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); @@ -1072,7 +1072,7 @@ async fn test_player_sells_rare_barrier() { async fn test_player_sells_rare_unit() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; let mut p1_inv = Vec::new(); @@ -1111,7 +1111,7 @@ async fn test_player_sells_rare_unit() { async fn test_player_cant_sell_if_meseta_would_go_over_max() { let mut entity_gateway = InMemoryGateway::default(); - let (user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; entity_gateway.set_character_meseta(&char1.id, item::Meseta(999995)).await.unwrap(); let mut p1_inv = Vec::new(); diff --git a/tests/test_trade.rs b/tests/test_trade.rs index 2a1d5d8..65505b3 100644 --- a/tests/test_trade.rs +++ b/tests/test_trade.rs @@ -114,8 +114,8 @@ impl TradeItemBuilder { async fn test_trade_one_individual_item() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p1_inv = Vec::new(); p1_inv.push(entity_gateway.create_item( @@ -215,8 +215,8 @@ async fn test_trade_one_individual_item() { async fn test_trade_player2_to_player1() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p2_inv = Vec::new(); p2_inv.push(entity_gateway.create_item( @@ -316,8 +316,8 @@ async fn test_trade_player2_to_player1() { async fn test_reverse_trade_ack_order() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p1_inv = Vec::new(); p1_inv.push(entity_gateway.create_item( @@ -417,8 +417,8 @@ async fn test_reverse_trade_ack_order() { async fn test_trade_one_stacked_item() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_stack = futures::future::join_all((0..2).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -521,8 +521,8 @@ async fn test_trade_one_stacked_item() { async fn test_trade_partial_stacked_item() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_stack = futures::future::join_all((0..2).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -628,8 +628,8 @@ async fn test_trade_partial_stacked_item() { async fn test_trade_individual_both() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_inv = vec![ entity_gateway.create_item( @@ -793,8 +793,8 @@ async fn test_trade_individual_both() { async fn test_trade_stacked_both() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_stack = futures::future::join_all((0..2).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -963,8 +963,8 @@ async fn test_trade_stacked_both() { async fn test_trade_partial_stack_both() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_stack = futures::future::join_all((0..2).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -1139,8 +1139,8 @@ async fn test_trade_partial_stack_both() { async fn test_trade_same_stacked_item_to_eachother() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_stack = futures::future::join_all((0..3).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -1311,8 +1311,8 @@ async fn test_trade_same_stacked_item_to_eachother() { async fn test_trade_stacked_when_already_have_partial_stack() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_stack = futures::future::join_all((0..3).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -1451,8 +1451,8 @@ async fn test_trade_stacked_when_already_have_partial_stack() { async fn test_trade_individual_for_stacked() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_inv = vec![ entity_gateway.create_item( @@ -1621,8 +1621,8 @@ async fn test_trade_individual_for_stacked() { async fn test_trade_multiple_individual() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_inv = vec![ entity_gateway.create_item( @@ -1879,8 +1879,8 @@ async fn test_trade_multiple_individual() { async fn test_trade_multiple_stacked() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_stack1 = futures::future::join_all((0..2).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -2146,8 +2146,8 @@ async fn test_trade_multiple_stacked() { async fn test_trade_not_enough_inventory_space_individual() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_inv = futures::future::join_all((0..2).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -2268,8 +2268,8 @@ async fn test_trade_not_enough_inventory_space_individual() { async fn test_trade_not_enough_inventory_space_stacked() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_stack = futures::future::join_all((0..2).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -2385,8 +2385,8 @@ async fn test_trade_not_enough_inventory_space_stacked() { async fn test_trade_stack_too_big() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_stack = futures::future::join_all((0..8).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -2501,8 +2501,8 @@ async fn test_trade_stack_too_big() { async fn test_trade_meseta() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; entity_gateway.set_character_meseta(&char1.id, Meseta(2323)).await.unwrap(); @@ -2582,8 +2582,8 @@ async fn test_trade_meseta() { async fn test_trade_too_much_meseta() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; entity_gateway.set_character_meseta(&char1.id, Meseta(4000)).await.unwrap(); entity_gateway.set_character_meseta(&char2.id, Meseta(999000)).await.unwrap(); @@ -2634,8 +2634,8 @@ async fn test_trade_too_much_meseta() { async fn test_trade_invalid_amount_of_meseta() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; entity_gateway.set_character_meseta(&char1.id, Meseta(4000)).await.unwrap(); entity_gateway.set_character_meseta(&char2.id, Meseta(999000)).await.unwrap(); @@ -2686,8 +2686,8 @@ async fn test_trade_invalid_amount_of_meseta() { async fn test_trade_meseta_request_and_items_dont_match() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; entity_gateway.set_character_meseta(&char1.id, Meseta(4000)).await.unwrap(); entity_gateway.set_character_meseta(&char2.id, Meseta(999000)).await.unwrap(); @@ -2738,8 +2738,8 @@ async fn test_trade_meseta_request_and_items_dont_match() { async fn test_player_declined_trade() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut ship = Box::new(ShipServerState::builder() .gateway(entity_gateway.clone()) @@ -2769,8 +2769,8 @@ async fn test_player_declined_trade() { async fn test_back_out_of_trade_last_minute() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p1_inv = Vec::new(); p1_inv.push(entity_gateway.create_item( @@ -2835,8 +2835,8 @@ async fn test_back_out_of_trade_last_minute() { async fn test_valid_trade_when_both_inventories_are_full() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_inv = futures::future::join_all((0..30).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -2977,8 +2977,8 @@ async fn test_valid_trade_when_both_inventories_are_full() { async fn test_invalid_trade_when_both_inventories_are_full() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_inv = futures::future::join_all((0..30).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -3128,9 +3128,9 @@ async fn test_invalid_trade_when_both_inventories_are_full() { async fn test_client_tries_to_start_two_trades() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; - let (_user2, _char3) = new_user_character(&mut entity_gateway, "a3", "a").await; + let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; + let (_user2, _char3) = new_user_character(&mut entity_gateway, "a3", "a", 1).await; let mut ship = Box::new(ShipServerState::builder() .gateway(entity_gateway.clone()) @@ -3160,9 +3160,9 @@ async fn test_client_tries_to_start_two_trades() { async fn test_client_tries_trading_with_client_already_trading() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a").await; - let (_user2, _char3) = new_user_character(&mut entity_gateway, "a3", "a").await; + let (_user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, _char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; + let (_user2, _char3) = new_user_character(&mut entity_gateway, "a3", "a", 1).await; let mut ship = Box::new(ShipServerState::builder() .gateway(entity_gateway.clone()) @@ -3199,8 +3199,8 @@ async fn test_client_tries_trading_with_client_already_trading() { async fn test_add_then_remove_individual_item() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p1_inv = Vec::new(); for _ in 0..2 { @@ -3312,8 +3312,8 @@ async fn test_add_then_remove_individual_item() { async fn test_add_then_remove_stacked_item() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_stack1 = futures::future::join_all((0..2).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -3447,8 +3447,8 @@ async fn test_add_then_remove_stacked_item() { async fn test_add_then_remove_partial_stack() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_stack1 = futures::future::join_all((0..2).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -3571,8 +3571,8 @@ async fn test_add_then_remove_partial_stack() { async fn test_add_then_remove_meseta() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; entity_gateway.set_character_meseta(&char1.id, Meseta(2323)).await.unwrap(); @@ -3657,8 +3657,8 @@ async fn test_add_then_remove_meseta() { async fn test_items_to_trade_data_does_not_match() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p1_inv = Vec::new(); p1_inv.push(entity_gateway.create_item( @@ -3740,8 +3740,8 @@ async fn test_items_to_trade_data_does_not_match() { async fn test_items_to_trade_id_does_not_match() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p1_inv = Vec::new(); p1_inv.push(entity_gateway.create_item( @@ -3811,8 +3811,8 @@ async fn test_items_to_trade_id_does_not_match() { async fn test_stack_is_same_amount_in_request_and_items_to_trade() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_stack = futures::future::join_all((0..2).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -3885,8 +3885,8 @@ async fn test_stack_is_same_amount_in_request_and_items_to_trade() { async fn test_stack_is_same_amount_in_request_and_items_to_trade2() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_stack = futures::future::join_all((0..2).map(|_| { let mut entity_gateway = entity_gateway.clone(); @@ -3959,8 +3959,8 @@ async fn test_stack_is_same_amount_in_request_and_items_to_trade2() { async fn test_items_to_trade_count_less_than() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_inv = vec![ entity_gateway.create_item( @@ -4061,8 +4061,8 @@ async fn test_items_to_trade_count_less_than() { async fn test_items_to_trade_count_greater_than() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; entity_gateway.set_character_meseta(&char1.id, Meseta(23)).await.unwrap(); @@ -4171,8 +4171,8 @@ async fn test_items_to_trade_count_greater_than() { async fn test_items_to_trade_count_mismatch_with_meseta() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let p1_inv = vec![ entity_gateway.create_item( @@ -4273,8 +4273,8 @@ async fn test_items_to_trade_count_mismatch_with_meseta() { async fn test_dropping_item_after_trade() { let mut entity_gateway = InMemoryGateway::default(); - let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a").await; - let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a").await; + let (_user1, char1) = new_user_character(&mut entity_gateway, "a1", "a", 1).await; + let (_user2, char2) = new_user_character(&mut entity_gateway, "a2", "a", 1).await; let mut p1_inv = Vec::new(); p1_inv.push(entity_gateway.create_item( @@ -4364,7 +4364,7 @@ async fn test_dropping_item_after_trade() { assert!(matches!(ack[3], (ClientId(2), SendShipPacket::TradeSuccessful {..}))); assert!(matches!(ack[4], (ClientId(1), SendShipPacket::TradeSuccessful {..}))); - let ack = ship.handle(ClientId(2), &RecvShipPacket::Message(Message::new(GameMessage::PlayerDropItem(PlayerDropItem { + let _ack = ship.handle(ClientId(2), &RecvShipPacket::Message(Message::new(GameMessage::PlayerDropItem(PlayerDropItem { client: 0, target: 0, unknown1: 0,