From e53949abf705241510ed6ed9686ac409a9684523 Mon Sep 17 00:00:00 2001 From: Condorra Date: Mon, 9 Oct 2023 21:38:12 +1100 Subject: [PATCH] NPC data to separate YAML --- Cargo.lock | 594 +++++++++--------- ansi_macro/Cargo.toml | 2 +- blastmud_game/Cargo.toml | 18 +- blastmud_game/src/av.rs | 9 +- .../src/message_handler/user_commands.rs | 2 +- .../message_handler/user_commands/agree.rs | 8 +- blastmud_game/src/static_content.rs | 2 +- .../src/static_content/fixed_item.rs | 2 +- blastmud_game/src/static_content/npc.rs | 55 +- .../npc/computer_museum_npcs.rs | 149 ++--- .../npc/computer_museum_npcs.yaml | 26 + .../src/static_content/npc/melbs_citizen.rs | 378 +---------- .../src/static_content/npc/melbs_citizen.yaml | 240 +++++++ .../src/static_content/npc/melbs_dog.rs | 113 +--- .../src/static_content/npc/melbs_dog.yaml | 180 ++++++ .../src/static_content/npc/roboporter.rs | 68 +- .../src/static_content/npc/roboporter.yaml | 20 + blastmud_game/src/static_content/room.rs | 2 +- blastmud_listener/Cargo.toml | 2 +- 19 files changed, 990 insertions(+), 880 deletions(-) create mode 100644 blastmud_game/src/static_content/npc/computer_museum_npcs.yaml create mode 100644 blastmud_game/src/static_content/npc/melbs_citizen.yaml create mode 100644 blastmud_game/src/static_content/npc/melbs_dog.yaml create mode 100644 blastmud_game/src/static_content/npc/roboporter.yaml diff --git a/Cargo.lock b/Cargo.lock index 3ab4585b..9e36600c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,17 +2,11 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" - [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -47,9 +41,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -90,7 +84,7 @@ dependencies = [ "ansi_markup", "nom", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] @@ -108,13 +102,13 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-recursion" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] @@ -136,18 +130,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] name = "async-trait" -version = "0.1.71" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] @@ -158,9 +152,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -173,31 +167,20 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.1" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" - -[[package]] -name = "base64" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "bcrypt" -version = "0.13.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7e7c93a3fb23b2fdde989b2c9ec4dd153063ec81f408507f84c090cd91c6641" +checksum = "28d1c9c15093eb224f0baa400f38fcd713fc1391a6f1c389d886beef146d60a3" dependencies = [ - "base64 0.13.1", + "base64", "blowfish", "getrandom", + "subtle", "zeroize", ] @@ -209,9 +192,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "bitvec" @@ -233,7 +216,7 @@ dependencies = [ "ansi_markup", "async-recursion", "async-trait", - "base64 0.20.0", + "base64", "bcrypt", "blastmud_interfaces", "chrono", @@ -241,7 +224,7 @@ dependencies = [ "deadpool-postgres", "futures", "humantime", - "itertools", + "itertools 0.11.0", "log", "mockall", "mockall_double", @@ -363,9 +346,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytecheck" @@ -391,21 +374,24 @@ dependencies = [ [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -415,18 +401,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets", ] [[package]] @@ -476,41 +461,52 @@ dependencies = [ ] [[package]] -name = "deadpool" -version = "0.9.5" +name = "data-encoding" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421fe0f90f2ab22016f32a9881be5134fdd71c65298917084b0c7477cbc3856e" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" + +[[package]] +name = "deadpool" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb84100978c1c7b37f09ed3ce3e5f843af02c2a2c431bae5b19230dad2c1b490" dependencies = [ "async-trait", "deadpool-runtime", "num_cpus", - "retain_mut", "serde", "tokio", ] [[package]] name = "deadpool-postgres" -version = "0.10.5" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a24a9d49deefe610b8b60c767a7412e9a931d79a89415cd2d2d71630ca8d7" +checksum = "40b75ba49590d27f677d3bebaf76cd15889ca8b308bc7ba99bfa25f1d7269c13" dependencies = [ "deadpool", - "log", "serde", "tokio", "tokio-postgres", + "tracing", ] [[package]] name = "deadpool-runtime" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaa37046cc0f6c3cc6090fbdbf73ef0b8ef4cfcc37f6befc0020f63e8cf121e1" +checksum = "63dfa964fe2a66f3fde91fc70b267fe193d822c7e603e2a675a49a7f46ad3f49" dependencies = [ "tokio", ] +[[package]] +name = "deranged" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" + [[package]] name = "difflib" version = "0.4.0" @@ -536,9 +532,9 @@ checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" [[package]] name = "educe" -version = "0.4.22" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "079044df30bb07de7d846d41a184c4b00e66ebdac93ee459253474f3a47e50ae" +checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" dependencies = [ "enum-ordinalize", "proc-macro2", @@ -548,30 +544,30 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] [[package]] name = "enum-ordinalize" -version = "3.1.13" +version = "3.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4f76552f53cefc9a7f64987c3701b99d982f7690606fd67de1d09712fbf52f1" +checksum = "1bf1fa3f06bbff1ea5b1a9c7b14aa992a39657db60a2759457328d7e058f49ee" dependencies = [ "num-bigint", "num-traits", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] @@ -582,9 +578,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480" dependencies = [ "errno-dragonfly", "libc", @@ -607,6 +603,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "finl_unicode" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" + [[package]] name = "float-cmp" version = "0.9.0" @@ -699,7 +701,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] @@ -750,20 +752,20 @@ checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", ] [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -804,18 +806,17 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "headers" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", + "base64", "bytes", "headers-core", "http", @@ -834,10 +835,16 @@ dependencies = [ ] [[package]] -name = "hermit-abi" -version = "0.3.2" +name = "heck" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hmac" @@ -878,9 +885,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -957,12 +964,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.1", ] [[package]] @@ -994,6 +1001,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -1017,21 +1033,21 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "linux-raw-sys" -version = "0.4.3" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" [[package]] name = "lock_api" @@ -1045,33 +1061,25 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ + "cfg-if", "digest", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "mime" @@ -1111,7 +1119,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] @@ -1168,22 +1176,19 @@ dependencies = [ "log", "memchr", "mime", - "spin 0.9.8", + "spin", "version_check", ] [[package]] name = "nix" -version = "0.26.2" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cfg-if", "libc", - "memoffset", - "pin-utils", - "static_assertions", ] [[package]] @@ -1204,9 +1209,9 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -1225,9 +1230,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", "libm", @@ -1254,9 +1259,9 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -1269,25 +1274,27 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "ouroboros" -version = "0.15.6" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db" +checksum = "1c86de06555b970aec45229b27291b53154f21a5743a163419f4e4c0b065dcde" dependencies = [ "aliasable", "ouroboros_macro", + "static_assertions", ] [[package]] name = "ouroboros_macro" -version = "0.15.6" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" +checksum = "8cad0c4b129e9696e37cb712b243777b90ef489a0bfaa0ac34e7d9b860e4f134" dependencies = [ - "Inflector", + "heck", + "itertools 0.11.0", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] @@ -1349,7 +1356,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] @@ -1363,29 +1370,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -1395,11 +1402,11 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "postgres-protocol" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b7fa9f396f51dffd61546fd8573ee20592287996568e6175ceb0f8699ad75d" +checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" dependencies = [ - "base64 0.21.2", + "base64", "byteorder", "bytes", "fallible-iterator", @@ -1413,9 +1420,9 @@ dependencies = [ [[package]] name = "postgres-types" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f028f05971fe20f512bcc679e2c10227e57809a3af86a7606304435bc8896cd6" +checksum = "8d2234cdee9408b523530a9b6d2d6b373d1db34f6a8e51dc03ded1828d7fb67c" dependencies = [ "bytes", "fallible-iterator", @@ -1439,7 +1446,7 @@ checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" dependencies = [ "difflib", "float-cmp", - "itertools", + "itertools 0.10.5", "normalize-line-endings", "predicates-core", "regex", @@ -1496,9 +1503,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "5b1106fec09662ec6dd98ccac0f81cef56984d0b49f75c92d8cbad76e20c005c" dependencies = [ "unicode-ident", ] @@ -1525,9 +1532,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.31" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -1589,9 +1596,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.1" +version = "1.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" dependencies = [ "aho-corasick", "memchr", @@ -1601,9 +1608,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ "aho-corasick", "memchr", @@ -1612,38 +1619,31 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "rend" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" dependencies = [ "bytecheck", ] -[[package]] -name = "retain_mut" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" - [[package]] name = "ring" -version = "0.16.20" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "911b295d2d302948838c8ac142da1ee09fa7863163b44e6715bc9357905878b8" dependencies = [ "cc", + "getrandom", "libc", - "once_cell", - "spin 0.5.2", + "spin", "untrusted", - "web-sys", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -1676,14 +1676,12 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.30.0" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0446843641c69436765a35a5a77088e28c2e6a12da93e84aa3ab1cd4aa5a042" +checksum = "a4c4216490d5a413bc6d10fa4742bd7d4955941d062c0ef873141d6b0e7b30fd" dependencies = [ "arrayvec", "borsh", - "bytecheck", - "byteorder", "bytes", "num-traits", "rand", @@ -1700,11 +1698,11 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.4" +version = "0.38.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +checksum = "f25469e9ae0f3d0047ca8b93fc56843f38e6774f0914a107ff8b41be8be8e0b7" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "errno", "libc", "linux-raw-sys", @@ -1717,7 +1715,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "base64", ] [[package]] @@ -1734,9 +1732,9 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "seahash" @@ -1746,9 +1744,9 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "serde" -version = "1.0.171" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] @@ -1765,20 +1763,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.171" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] name = "serde_json" -version = "1.0.103" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -1799,11 +1797,11 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.23" +version = "0.9.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6075b41c7e3b079e5f246eb6094a44850d3a4c25a67c581c80796c80134012" +checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "itoa", "ryu", "serde", @@ -1812,9 +1810,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -1823,9 +1821,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -1855,30 +1853,30 @@ checksum = "2230cd5c29b815c9b699fb610b49a5ed65588f3509d9f0108be3a885da629333" dependencies = [ "colored", "log", - "time 0.3.23", + "time", "windows-sys 0.42.0", ] [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "socket2" @@ -1892,20 +1890,14 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", "windows-sys 0.48.0", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -1920,10 +1912,11 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stringprep" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3737bde7edce97102e0e2b15365bf7a20bfdb5f60f4f9e8d7004258a51a8da" +checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" dependencies = [ + "finl_unicode", "unicode-bidi", "unicode-normalization", ] @@ -1947,9 +1940,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.26" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -1970,41 +1963,31 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] name = "time" -version = "0.1.45" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" +checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" dependencies = [ + "deranged", "itoa", "libc", "num_threads", @@ -2015,15 +1998,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -2045,11 +2028,10 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", @@ -2057,7 +2039,7 @@ dependencies = [ "num_cpus", "pin-project-lite", "signal-hook-registry", - "socket2 0.4.9", + "socket2 0.5.4", "tokio-macros", "windows-sys 0.48.0", ] @@ -2070,14 +2052,14 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", ] [[package]] name = "tokio-postgres" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e89f6234aa8fd43779746012fcf53603cdb91fdd8399aa0de868c2d56b6dde1" +checksum = "d340244b32d920260ae7448cb72b6e238bddc3d4f7603394e7dd46ed8e48f5b8" dependencies = [ "async-trait", "byteorder", @@ -2092,9 +2074,11 @@ dependencies = [ "pin-project-lite", "postgres-protocol", "postgres-types", - "socket2 0.5.3", + "rand", + "socket2 0.5.4", "tokio", "tokio-util", + "whoami", ] [[package]] @@ -2125,9 +2109,9 @@ dependencies = [ [[package]] name = "tokio-test" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53474327ae5e166530d17f2d956afcb4f8a004de581b3cae10f12006bc8163e3" +checksum = "e89b3cbabd3ae862100094ae433e1def582cf86451b4e9bf83aa7ac1d8a7d719" dependencies = [ "async-stream", "bytes", @@ -2138,9 +2122,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.18.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54319c93411147bced34cb5609a80e0a8e44c5999c93903a81cd866630ec0bfd" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", @@ -2150,9 +2134,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", @@ -2186,9 +2170,21 @@ dependencies = [ "cfg-if", "log", "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "tracing-core" version = "0.1.31" @@ -2206,13 +2202,13 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "tungstenite" -version = "0.18.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" dependencies = [ - "base64 0.13.1", "byteorder", "bytes", + "data-encoding", "http", "httparse", "log", @@ -2225,15 +2221,15 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicase" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] @@ -2246,9 +2242,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -2267,15 +2263,15 @@ checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -2330,9 +2326,9 @@ dependencies = [ [[package]] name = "warp" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba431ef570df1287f7f8b07e376491ad54f84d26ac473489427231e1718e1f69" +checksum = "c1e92e22e03ff1230c03a1a8ee37d2f89cd489e2e541b7550d6afad96faed169" dependencies = [ "bytes", "futures-channel", @@ -2359,12 +2355,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2392,7 +2382,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -2414,7 +2404,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2435,6 +2425,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "whoami" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + [[package]] name = "winapi" version = "0.3.9" @@ -2492,17 +2492,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -2513,9 +2513,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -2525,9 +2525,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -2537,9 +2537,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -2549,9 +2549,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -2561,9 +2561,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -2573,9 +2573,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -2585,9 +2585,9 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "wyz" diff --git a/ansi_macro/Cargo.toml b/ansi_macro/Cargo.toml index 6d08e15a..9ce89c36 100644 --- a/ansi_macro/Cargo.toml +++ b/ansi_macro/Cargo.toml @@ -9,5 +9,5 @@ proc-macro = true [dependencies] nom = "7.1.1" quote = "1.0.23" -syn = "1.0.107" +syn = "2.0.38" ansi_markup = { path = "../ansi_markup" } diff --git a/blastmud_game/Cargo.toml b/blastmud_game/Cargo.toml index 9e919a3b..add60a96 100644 --- a/blastmud_game/Cargo.toml +++ b/blastmud_game/Cargo.toml @@ -6,16 +6,16 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -base64 = "0.20.0" +base64 = "0.21.4" blastmud_interfaces = { path = "../blastmud_interfaces" } ansi = { path = "../ansi" } ansi_markup = { path = "../ansi_markup" } -deadpool = "0.9.5" -deadpool-postgres = { version = "0.10.3", features = ["serde"] } +deadpool = "0.10.0" +deadpool-postgres = { version = "0.11.0", features = ["serde"] } futures = "0.3.25" log = "0.4.17" -nix = "0.26.1" -ring = "0.16.20" +nix = { version = "0.27.1", features = ["process", "signal"] } +ring = "0.17.2" serde = { version = "1.0.150", features = ["derive", "serde_derive"] } serde_yaml = "0.9.14" simple_logger = "4.0.0" @@ -29,22 +29,22 @@ serde_json = "1.0.91" phf = { version = "0.11.1", features = ["macros"] } async-trait = "0.1.60" nom = "7.1.1" -ouroboros = "0.15.5" +ouroboros = "0.18.0" chrono = { version = "0.4.23", features = ["serde"] } -bcrypt = "0.13.0" +bcrypt = "0.15.0" validator = "0.16.0" -itertools = "0.10.5" +itertools = "0.11.0" once_cell = "1.16.0" rand = "0.8.5" async-recursion = "1.0.0" rand_distr = "0.4.3" humantime = "2.1.0" rust_decimal = "1.28.0" -mockall = "0.11.3" mockall_double = "0.3.0" [dev-dependencies] tokio-test = "0.4.2" +mockall = "0.11.3" [features] default = [] diff --git a/blastmud_game/src/av.rs b/blastmud_game/src/av.rs index 99628465..eaf579ff 100644 --- a/blastmud_game/src/av.rs +++ b/blastmud_game/src/av.rs @@ -1,5 +1,5 @@ use crate::DResult; -use base64; +use base64::{self, Engine}; use ring::signature; use serde::Deserialize; use std::error::Error; @@ -33,6 +33,9 @@ pub fn check() -> DResult<()> { let sign_text = format!("cn={};{};serial={}", av.cn, av.assertion, av.serial); let key: signature::UnparsedPublicKey<&[u8]> = signature::UnparsedPublicKey::new(&signature::ECDSA_P256_SHA256_ASN1, &KEY_BYTES); - key.verify(&sign_text.as_bytes(), &base64::decode(av.sig)?) - .map_err(|_| Box::::from("Invalid age-verification.yml signature")) + key.verify( + &sign_text.as_bytes(), + &base64::engine::general_purpose::STANDARD_NO_PAD.decode(av.sig)?, + ) + .map_err(|_| Box::::from("Invalid age-verification.yml signature")) } diff --git a/blastmud_game/src/message_handler/user_commands.rs b/blastmud_game/src/message_handler/user_commands.rs index ed98dfc7..5fdd3b79 100644 --- a/blastmud_game/src/message_handler/user_commands.rs +++ b/blastmud_game/src/message_handler/user_commands.rs @@ -19,7 +19,7 @@ use std::sync::Arc; mod agree; mod allow; -pub mod attack; +mod attack; mod butcher; mod buy; mod c; diff --git a/blastmud_game/src/message_handler/user_commands/agree.rs b/blastmud_game/src/message_handler/user_commands/agree.rs index d0c8c87c..77d02f95 100644 --- a/blastmud_game/src/message_handler/user_commands/agree.rs +++ b/blastmud_game/src/message_handler/user_commands/agree.rs @@ -2,6 +2,7 @@ use super::{user_error, UResult, UserVerb, UserVerbRef, VerbContext}; use crate::models::user::{User, UserTermData}; use ansi::ansi; use async_trait::async_trait; +use base64::Engine; use chrono::Utc; pub struct Verb; @@ -54,10 +55,9 @@ fn terms<'a>(ctx: &'a VerbContext<'a>) -> UResult<&'a UserTermData> { fn first_outstanding_agreement(ctx: &VerbContext) -> UResult> { let existing_terms = &terms(ctx)?.accepted_terms; for agreement in REQUIRED_AGREEMENTS { - let shortcode = base64::encode(ring::digest::digest( - &ring::digest::SHA256, - agreement.as_bytes(), - ))[0..20] + let shortcode = base64::engine::general_purpose::STANDARD_NO_PAD.encode( + ring::digest::digest(&ring::digest::SHA256, agreement.as_bytes()), + )[0..20] .to_owned(); match existing_terms.get(&shortcode) { None => { diff --git a/blastmud_game/src/static_content.rs b/blastmud_game/src/static_content.rs index cb8cb342..fb4d54ee 100644 --- a/blastmud_game/src/static_content.rs +++ b/blastmud_game/src/static_content.rs @@ -20,7 +20,7 @@ pub mod scavtable; pub mod species; pub struct StaticItem { - pub item_code: &'static str, + pub item_code: String, pub initial_item: Box Item>, pub extra_items_on_create: Box Box>>, } diff --git a/blastmud_game/src/static_content/fixed_item.rs b/blastmud_game/src/static_content/fixed_item.rs index 11ff1364..2c5429f2 100644 --- a/blastmud_game/src/static_content/fixed_item.rs +++ b/blastmud_game/src/static_content/fixed_item.rs @@ -103,7 +103,7 @@ pub fn fixed_item_properties() -> &'static BTreeMap<&'static str, PossessionData pub fn static_items() -> Box> { Box::new(fixed_item_list().iter().map(|r| StaticItem { - item_code: &r.code, + item_code: r.code.clone(), initial_item: Box::new(|| Item { item_code: r.code.clone(), item_type: "fixed_item".to_owned(), diff --git a/blastmud_game/src/static_content/npc.rs b/blastmud_game/src/static_content/npc.rs index 758c8d7b..2dda7930 100644 --- a/blastmud_game/src/static_content/npc.rs +++ b/blastmud_game/src/static_content/npc.rs @@ -29,6 +29,7 @@ use log::info; use mockall_double::double; use once_cell::sync::OnceCell; use rand::{prelude::*, thread_rng, Rng}; +use serde::{Deserialize, Serialize}; use std::collections::BTreeMap; use std::time; use uuid::Uuid; @@ -92,15 +93,33 @@ pub struct NPCSpawnPossession { wear_layer: i64, // 0 is on top, higher under. } +#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Serialize, Deserialize)] +pub enum NPCPronounType { + Inanimate, + Neutral, + Male, + Female, +} + +pub fn npc_pronoun_type_to_pronouns(t: &NPCPronounType) -> Pronouns { + use NPCPronounType::*; + match t { + Inanimate => Pronouns::default_inanimate(), + Neutral => Pronouns::default_animate(), + Male => Pronouns::default_male(), + Female => Pronouns::default_female(), + } +} + pub struct NPC { - pub code: &'static str, - pub name: &'static str, + pub code: String, + pub name: String, pub pronouns: Pronouns, - pub description: &'static str, - pub spawn_location: &'static str, + pub description: String, + pub spawn_location: String, pub spawn_possessions: Vec, pub message_handler: Option<&'static (dyn NPCMessageHandler + Sync + Send)>, - pub aliases: Vec<&'static str>, + pub aliases: Vec, pub says: Vec, pub aggression: u64, // 1-20 sets aggro time, >= 21 = instant aggro. pub aggro_pc_only: bool, @@ -110,7 +129,7 @@ pub struct NPC { pub total_skills: BTreeMap, pub total_stats: BTreeMap, pub species: SpeciesType, - pub wander_zones: Vec<&'static str>, + pub wander_zones: Vec, pub kill_bonus: Option, pub player_consents: Vec, pub hire_data: Option, @@ -121,11 +140,11 @@ pub struct NPC { impl Default for NPC { fn default() -> Self { Self { - code: "DEFAULT", - name: "default", + code: "DEFAULT".to_owned(), + name: "default".to_owned(), pronouns: Pronouns::default_animate(), - description: "default", - spawn_location: "default", + description: "default".to_owned(), + spawn_location: "default".to_owned(), spawn_possessions: vec![], message_handler: None, aliases: vec![], @@ -160,11 +179,11 @@ pub fn npc_list() -> &'static Vec { static NPC_LIST: OnceCell> = OnceCell::new(); NPC_LIST.get_or_init(|| { let mut npcs = vec![NPC { - code: "repro_xv_chargen_statbot", - name: "Statbot", + code: "repro_xv_chargen_statbot".to_owned(), + name: "Statbot".to_owned(), description: - "A silvery shiny metal mechanical being. It lets out a whirring sound as it moves.", - spawn_location: "room/repro_xv_chargen", + "A silvery shiny metal mechanical being. It lets out a whirring sound as it moves.".to_owned(), + spawn_location: "room/repro_xv_chargen".to_owned(), message_handler: Some(&statbot::StatbotMessageHandler), says: vec![], ..Default::default() @@ -179,7 +198,7 @@ pub fn npc_list() -> &'static Vec { pub fn npc_by_code() -> &'static BTreeMap<&'static str, &'static NPC> { static NPC_CODE_MAP: OnceCell> = OnceCell::new(); - NPC_CODE_MAP.get_or_init(|| npc_list().iter().map(|npc| (npc.code, npc)).collect()) + NPC_CODE_MAP.get_or_init(|| npc_list().iter().map(|npc| (npc.code.as_str(), npc)).collect()) } pub fn npc_say_info_by_npc_code_say_code( @@ -192,7 +211,7 @@ pub fn npc_say_info_by_npc_code_say_code( .flat_map(|npc| { npc.says .iter() - .map(|says| ((npc.code, says.say_code), says)) + .map(|says| ((npc.code.as_str(), says.say_code), says)) }) .collect() }) @@ -201,7 +220,7 @@ pub fn npc_say_info_by_npc_code_say_code( pub fn npc_static_items() -> Box> { Box::new(npc_list().iter().map(|c| { StaticItem { - item_code: c.code, + item_code: c.code.clone(), initial_item: Box::new(|| { let mut flags: Vec = c.extra_flags.clone(); if c.hire_data.is_some() { @@ -463,7 +482,7 @@ impl TaskHandler for NPCWanderTaskHandler { let ex_iter = room.exits.iter().filter(|ex| { resolve_exit(room, ex) .map(|new_room| { - npc.wander_zones.contains(&new_room.zone.as_str()) && !new_room.repel_npc + npc.wander_zones.contains(&new_room.zone) && !new_room.repel_npc }) .unwrap_or(false) }); diff --git a/blastmud_game/src/static_content/npc/computer_museum_npcs.rs b/blastmud_game/src/static_content/npc/computer_museum_npcs.rs index 45cd1f47..0b6e51d4 100644 --- a/blastmud_game/src/static_content/npc/computer_museum_npcs.rs +++ b/blastmud_game/src/static_content/npc/computer_museum_npcs.rs @@ -11,7 +11,10 @@ use crate::{ regular_tasks::{TaskHandler, TaskRunContext}, services::comms::broadcast_to_room, static_content::{ - npc::KillBonus, possession_type::PossessionType, room::Direction, species::SpeciesType, + npc::{npc_pronoun_type_to_pronouns, KillBonus, NPCPronounType}, + possession_type::PossessionType, + room::Direction, + species::SpeciesType, }, DResult, }; @@ -26,6 +29,8 @@ use nom::{ combinator::{eof, opt}, sequence::{delimited, pair, preceded, terminated}, }; +use serde::Deserialize; +use serde_yaml::from_str as from_yaml_str; use std::time; async fn reply(ctx: &VerbContext<'_>, msg: &str) -> DResult<()> { @@ -349,6 +354,21 @@ impl TaskHandler for ResetGameTaskHandler { } pub static RESET_GAME_HANDLER: &'static (dyn TaskHandler + Sync + Send) = &ResetGameTaskHandler; +#[derive(Deserialize)] +enum MuseumNPC { + Geek { + code: String, + adjectives: String, + spawn_loc: String, + pronouns: NPCPronounType, + }, + Killbot { + code: String, + adjectives: String, + spawn_loc: String, + }, +} + pub fn npc_list() -> Vec { use NPCSayType::FromFixedList; let geek_stdsay = NPCSayInfo { @@ -373,56 +393,53 @@ pub fn npc_list() -> Vec { )) }; - macro_rules! geek_gender_word { - (default_male) => { - "guy" - }; - (default_female) => { - "gal" - }; - } - - macro_rules! geek { - ($code: expr, $adj: expr, $spawn: expr, $pronouns: ident) => { - NPC { - code: concat!("computer_museum_geek_", $code), - name: concat!($adj, " geek"), - pronouns: Pronouns { is_proper: false, ..Pronouns::$pronouns() }, - description: concat!("A geeky looking ", geek_gender_word!($pronouns), " with horn-rimmed glasses, and a button-down shirt. In the pocket is a pocket protector"), - spawn_location: concat!("room/computer_museum_", $spawn), - spawn_possessions: vec![ - NPCSpawnPossession { - what: PossessionType::Shirt, - action_type: LocationActionType::Worn, - wear_layer: 0, - }, - NPCSpawnPossession { - what: PossessionType::Jeans, - action_type: LocationActionType::Worn, - wear_layer: 0, - }, - ], - message_handler: None, - wander_zones: vec!("computer_museum"), - says: vec!(geek_stdsay.clone()), - player_consents: vec!(ConsentType::Medicine), - ..Default::default() - } + fn geek_gender_word(pronouns: &NPCPronounType) -> &'static str { + match pronouns { + NPCPronounType::Male => "guy", + _ => "gal", } } - macro_rules! killbot { - ($code: expr, $adj: expr, $spawn: expr) => { + let mut npcs: Vec = from_yaml_str::>(include_str!("computer_museum_npcs.yaml")) + .unwrap() + .into_iter() + .map(|npc| match npc { + MuseumNPC::Geek { code, adjectives, spawn_loc, pronouns } => + NPC { + code: format!("computer_museum_geek_{}", &code), + name: format!("{} geek", &adjectives), + pronouns: Pronouns { is_proper: false, ..npc_pronoun_type_to_pronouns(&pronouns) }, + description: format!("A geeky looking {} with horn-rimmed glasses, and a button-down shirt. In the pocket is a pocket protector", geek_gender_word(&pronouns)), + spawn_location: format!("room/computer_museum_{}", &spawn_loc), + spawn_possessions: vec![ + NPCSpawnPossession { + what: PossessionType::Shirt, + action_type: LocationActionType::Worn, + wear_layer: 0, + }, + NPCSpawnPossession { + what: PossessionType::Jeans, + action_type: LocationActionType::Worn, + wear_layer: 0, + }, + ], + message_handler: None, + wander_zones: vec!("computer_museum".to_owned()), + says: vec!(geek_stdsay.clone()), + player_consents: vec!(ConsentType::Medicine), + ..Default::default() + }, + MuseumNPC::Killbot { code, adjectives, spawn_loc } => NPC { - code: concat!("computer_museum_killbot_", $code), - name: concat!($adj, " Killbot"), + code: format!("computer_museum_killbot_{}", &code), + name: format!("{} Killbot", &adjectives), species: SpeciesType::Robot, pronouns: Pronouns { is_proper: false, ..Pronouns::default_inanimate() }, - description: concat!("A mean looking robot, complete with a vicious spiked mace and powerful solonoids for smashing it hard into whatever unfortunate victim this bot targets"), - spawn_location: concat!("room/computer_museum_", $spawn), + description: "A mean looking robot, complete with a vicious spiked mace and powerful solonoids for smashing it hard into whatever unfortunate victim this bot targets".to_owned(), + spawn_location: format!("room/computer_museum_{}", &spawn_loc), spawn_possessions: vec![], aggression: 21, aggro_pc_only: true, @@ -438,7 +455,7 @@ pub fn npc_list() -> Vec { .collect(), intrinsic_weapon: Some(PossessionType::SpikedMace), message_handler: None, - wander_zones: vec!["computer_museum"], + wander_zones: vec!["computer_museum".to_owned()], kill_bonus: Some(KillBonus { msg: "On your wristpad: Those robots have been the bane of our existence at the museum. Thanks for taking one out! Here's a small token of our gratitude.", payment: 120, @@ -447,31 +464,23 @@ pub fn npc_list() -> Vec { player_consents: vec![ConsentType::Fight], ..Default::default() } - }; - } - - vec![ - geek!("1", "excited", "lobby", default_male), - geek!("2", "mesmerised", "lobby", default_female), - killbot!("3", "abhorrent", "hw_1"), - killbot!("4", "berserk", "hw_2"), - killbot!("5", "vicious", "hw_3"), - killbot!("6", "murderous", "club_door"), - NPC { - code: "computer_museum_doorbot", - name: "Doorbot", - spawn_location: "room/computer_museum_club_door", - description: ansi!( - "A flat panel screen on the door, with a microphone listening for \ - commands directed at it, apparently hooked up to the door lock. \ - [Hint: try -doorbot move from 1 to 2 to ask Doorbot \ - to move the top disc from tower 1 to tower 2]" - ), - pronouns: Pronouns::default_inanimate(), - species: SpeciesType::Robot, - extra_flags: vec![ItemFlag::DontListInLook], - message_handler: Some(&DoorbotMsgHandler), - ..Default::default() - }, - ] + }).collect(); + npcs.push(NPC { + code: "computer_museum_doorbot".to_owned(), + name: "Doorbot".to_owned(), + spawn_location: "room/computer_museum_club_door".to_owned(), + description: ansi!( + "A flat panel screen on the door, with a microphone listening for \ + commands directed at it, apparently hooked up to the door lock. \ + [Hint: try -doorbot move from 1 to 2 to ask Doorbot \ + to move the top disc from tower 1 to tower 2]" + ) + .to_owned(), + pronouns: Pronouns::default_inanimate(), + species: SpeciesType::Robot, + extra_flags: vec![ItemFlag::DontListInLook], + message_handler: Some(&DoorbotMsgHandler), + ..Default::default() + }); + npcs } diff --git a/blastmud_game/src/static_content/npc/computer_museum_npcs.yaml b/blastmud_game/src/static_content/npc/computer_museum_npcs.yaml new file mode 100644 index 00000000..4ac54113 --- /dev/null +++ b/blastmud_game/src/static_content/npc/computer_museum_npcs.yaml @@ -0,0 +1,26 @@ +- Geek: + code: "1" + adjectives: excited + spawn_loc: lobby + pronouns: Male +- Geek: + code: "2" + adjectives: mesmerised + spawn_loc: lobby + pronouns: Female +- Killbot: + code: "3" + adjectives: abhorrent + spawn_loc: hw_1 +- Killbot: + code: "4" + adjectives: berserk + spawn_loc: hw_2 +- Killbot: + code: "5" + adjectives: vicious + spawn_loc: hw_3 +- Killbot: + code: "6" + adjectives: murderous + spawn_loc: club_door diff --git a/blastmud_game/src/static_content/npc/melbs_citizen.rs b/blastmud_game/src/static_content/npc/melbs_citizen.rs index 2f5e6753..f5247d70 100644 --- a/blastmud_game/src/static_content/npc/melbs_citizen.rs +++ b/blastmud_game/src/static_content/npc/melbs_citizen.rs @@ -1,11 +1,18 @@ -use super::{NPCSayInfo, NPCSayType, NPCSpawnPossession, NPC}; +use super::{NPCPronounType, NPCSayInfo, NPCSayType, NPCSpawnPossession, NPC}; use crate::{ - models::{ - consent::ConsentType, - item::{LocationActionType, Pronouns}, - }, - static_content::possession_type::PossessionType, + models::{consent::ConsentType, item::LocationActionType}, + static_content::{npc::npc_pronoun_type_to_pronouns, possession_type::PossessionType}, }; +use serde::Deserialize; +use serde_yaml::from_str as from_yaml_str; + +#[derive(Deserialize)] +struct Citizen { + code: String, + name: String, + spawn_loc: String, + gender: NPCPronounType, +} pub fn npc_list() -> Vec { use NPCSayType::FromFixedList; @@ -24,14 +31,16 @@ pub fn npc_list() -> Vec { )) }; - macro_rules! citizen { - ($code: expr, $name: expr, $spawn: expr, $pronouns: expr) => { + from_yaml_str::>(include_str!("melbs_citizen.yaml")) + .unwrap() + .into_iter() + .map(|c| NPC { - code: concat!("melbs_citizen_", $code), - name: $name, - pronouns: $pronouns, - description: "A fairly ordinary looking citizen of Melbs, clearly weary from the harsh reality of post-apocalyptic life", - spawn_location: concat!("room/melbs_", $spawn), + code: format!("melbs_citizen_{}", &c.code), + name: c.name, + pronouns: npc_pronoun_type_to_pronouns(&c.gender), + description: "A fairly ordinary looking citizen of Melbs, clearly weary from the harsh reality of post-apocalyptic life".to_owned(), + spawn_location: format!("room/melbs_{}", &c.spawn_loc), spawn_possessions: vec![ NPCSpawnPossession { what: PossessionType::Shirt, @@ -45,349 +54,10 @@ pub fn npc_list() -> Vec { }, ], message_handler: None, - wander_zones: vec!("melbs"), + wander_zones: vec!("melbs".to_owned()), says: vec!(melbs_citizen_stdsay.clone()), player_consents: vec!(ConsentType::Medicine, ConsentType::Sex), ..Default::default() } - } - } - - vec![ - citizen!( - "1", - "Matthew Thomas", - "kingst_latrobest", - Pronouns::default_male() - ), - citizen!("2", "Matthew Perez", "kingst_20", Pronouns::default_male()), - citizen!( - "3", - "Kimberly Jackson", - "kingst_40", - Pronouns::default_female() - ), - citizen!( - "4", - "Michael Sanchez", - "kingst_50", - Pronouns::default_male() - ), - citizen!( - "5", - "Jessica Davis", - "kingst_bourkest", - Pronouns::default_female() - ), - citizen!("6", "Robert Davis", "kingst_70", Pronouns::default_male()), - citizen!("7", "Paul Lewis", "kingst_90", Pronouns::default_male()), - citizen!( - "8", - "Andrew Moore", - "kingst_collinsst", - Pronouns::default_male() - ), - citizen!( - "9", - "Betty Thomas", - "kingst_100", - Pronouns::default_female() - ), - citizen!( - "10", - "Mary Robinson", - "kingst_110", - Pronouns::default_female() - ), - citizen!( - "11", - "Lisa Lopez", - "kingst_flinderst", - Pronouns::default_female() - ), - citizen!( - "12", - "Kimberly Martinez", - "flindersst_200", - Pronouns::default_female() - ), - citizen!( - "13", - "Anthony Nguyen", - "flindersst_190", - Pronouns::default_male() - ), - citizen!( - "14", - "Joshua Green", - "flindersst_180", - Pronouns::default_male() - ), - citizen!( - "15", - "Emily Wright", - "flindersst_170", - Pronouns::default_female() - ), - citizen!( - "16", - "Ashley Thomas", - "lonsdalest_130", - Pronouns::default_male() - ), - citizen!( - "17", - "Jessica Miller", - "kingst_80", - Pronouns::default_female() - ), - citizen!( - "18", - "Anthony Lopez", - "lonsdalest_140", - Pronouns::default_male() - ), - citizen!( - "19", - "John Lopez", - "elizabethst_lonsdalest", - Pronouns::default_male() - ), - citizen!( - "20", - "Thomas Garcia", - "williamsst_120", - Pronouns::default_male() - ), - citizen!( - "21", - "Donna Thompson", - "elizabethst_60", - Pronouns::default_female() - ), - citizen!( - "22", - "Matthew Davis", - "williamsst_100", - Pronouns::default_male() - ), - citizen!( - "23", - "Steven Jones", - "swanstonst_120", - Pronouns::default_male() - ), - citizen!( - "24", - "Linda Smith", - "swanstonst_lonsdalest", - Pronouns::default_male() - ), - citizen!( - "25", - "Karen Rodriguez", - "bourkest_180", - Pronouns::default_female() - ), - citizen!( - "26", - "Paul Scott", - "swanstonst_70", - Pronouns::default_male() - ), - citizen!( - "27", - "Ashley Thomas", - "lonsdalest_130", - Pronouns::default_male() - ), - citizen!( - "28", - "Sandra Scott", - "elizabethst_30", - Pronouns::default_female() - ), - citizen!( - "29", - "Michael Rodriguez", - "swanstonst_70", - Pronouns::default_male() - ), - citizen!( - "30", - "Donald Miller", - "elizabethst_30", - Pronouns::default_male() - ), - citizen!( - "31", - "Charles Moore", - "lonsdalest_160", - Pronouns::default_male() - ), - citizen!( - "32", - "Ashley Sanchez", - "kingst_100", - Pronouns::default_male() - ), - citizen!( - "33", - "Margaret Lewis", - "flindersst_180", - Pronouns::default_female() - ), - citizen!( - "34", - "Sandra Thompson", - "swanstonst_80", - Pronouns::default_female() - ), - citizen!( - "35", - "Sandra King", - "lonsdalest_150", - Pronouns::default_female() - ), - citizen!( - "36", - "Lisa Anderson", - "lonsdalest_210", - Pronouns::default_female() - ), - citizen!( - "37", - "Kimberly Martin", - "kingst_80", - Pronouns::default_female() - ), - citizen!( - "38", - "Susan Smith", - "latrobest_190", - Pronouns::default_female() - ), - citizen!( - "39", - "Susan Martin", - "collinsst_150", - Pronouns::default_female() - ), - citizen!( - "40", - "Linda Scott", - "williamsst_30", - Pronouns::default_female() - ), - citizen!( - "41", - "Donald Miller", - "elizabethst_80", - Pronouns::default_male() - ), - citizen!("42", "Mark Hill", "collinsst_120", Pronouns::default_male()), - citizen!( - "43", - "William Perez", - "queenst_90", - Pronouns::default_male() - ), - citizen!( - "44", - "Donald Perez", - "queenst_lonsdalest", - Pronouns::default_male() - ), - citizen!( - "45", - "Lisa Rodriguez", - "collinsst_100", - Pronouns::default_female() - ), - citizen!( - "46", - "James Adams", - "latrobest_150", - Pronouns::default_male() - ), - citizen!( - "47", - "James Moore", - "latrobest_130", - Pronouns::default_male() - ), - citizen!( - "48", - "Joseph Martin", - "bourkest_150", - Pronouns::default_male() - ), - citizen!("49", "Matthew Jones", "kingst_60", Pronouns::default_male()), - citizen!( - "50", - "Michael Sanchez", - "queenst_100", - Pronouns::default_male() - ), - citizen!( - "51", - "Donna Torres", - "flindersst_150", - Pronouns::default_female() - ), - citizen!( - "52", - "Barbara Garcia", - "swanstonst_50", - Pronouns::default_female() - ), - citizen!( - "53", - "Daniel Miller", - "bourkest_110", - Pronouns::default_male() - ), - citizen!( - "54", - "Robert Young", - "kingst_collinsst", - Pronouns::default_male() - ), - citizen!( - "55", - "Donald Flores", - "swanstonst_40", - Pronouns::default_male() - ), - citizen!( - "56", - "Charles Thomas", - "flindersst_110", - Pronouns::default_male() - ), - citizen!( - "57", - "William Torres", - "swanstonst_60", - Pronouns::default_male() - ), - citizen!( - "58", - "Barbara Gonzalez", - "collinsst_190", - Pronouns::default_female() - ), - citizen!( - "59", - "Mary Smith", - "bourkest_180", - Pronouns::default_female() - ), - citizen!( - "60", - "Michael John", - "williamsst_110", - Pronouns::default_male() - ), - ] + ).collect() } diff --git a/blastmud_game/src/static_content/npc/melbs_citizen.yaml b/blastmud_game/src/static_content/npc/melbs_citizen.yaml new file mode 100644 index 00000000..63a4e49d --- /dev/null +++ b/blastmud_game/src/static_content/npc/melbs_citizen.yaml @@ -0,0 +1,240 @@ +- code: "1" + name: Matthew Thomas + spawn_loc: kingst_latrobest + gender: Male +- code: "2" + name: Matthew Perez + spawn_loc: kingst_20 + gender: Male +- code: "3" + name: Kimberly Jackson + spawn_loc: kingst_40 + gender: Female +- code: "4" + name: Michael Sanchez + spawn_loc: kingst_50 + gender: Male +- code: "5" + name: Jessica Davis + spawn_loc: kingst_bourkest + gender: Female +- code: "6" + name: Robert Davis + spawn_loc: kingst_70 + gender: Male +- code: "7" + name: Paul Lewis + spawn_loc: kingst_90 + gender: Male +- code: "8" + name: Andrew Moore + spawn_loc: kingst_collinsst + gender: Male +- code: "9" + name: Betty Thomas + spawn_loc: kingst_100 + gender: Female +- code: "10" + name: Mary Robinson + spawn_loc: kingst_110 + gender: Female +- code: "11" + name: Lisa Lopez + spawn_loc: kingst_flinderst + gender: Female +- code: "12" + name: Kimberly Martinez + spawn_loc: flindersst_200 + gender: Female +- code: "13" + name: Anthony Nguyen + spawn_loc: flindersst_190 + gender: Male +- code: "14" + name: Joshua Green + spawn_loc: flindersst_180 + gender: Male +- code: "15" + name: Emily Wright + spawn_loc: flindersst_170 + gender: Female +- code: "16" + name: Ashley Thomas + spawn_loc: lonsdalest_130 + gender: Male +- code: "17" + name: Jessica Miller + spawn_loc: kingst_80 + gender: Female +- code: "18" + name: Anthony Lopez + spawn_loc: lonsdalest_140 + gender: Male +- code: "19" + name: John Lopez + spawn_loc: elizabethst_lonsdalest + gender: Male +- code: "20" + name: Thomas Garcia + spawn_loc: williamsst_120 + gender: Male +- code: "21" + name: Donna Thompson + spawn_loc: elizabethst_60 + gender: Female +- code: "22" + name: Matthew Davis + spawn_loc: williamsst_100 + gender: Male +- code: "23" + name: Steven Jones + spawn_loc: swanstonst_120 + gender: Male +- code: "24" + name: Linda Smith + spawn_loc: swanstonst_lonsdalest + gender: Male +- code: "25" + name: Karen Rodriguez + spawn_loc: bourkest_180 + gender: Female +- code: "26" + name: Paul Scott + spawn_loc: swanstonst_70 + gender: Male +- code: "27" + name: Ashley Thomas + spawn_loc: lonsdalest_130 + gender: Male +- code: "28" + name: Sandra Scott + spawn_loc: elizabethst_30 + gender: Female +- code: "29" + name: Michael Rodriguez + spawn_loc: swanstonst_70 + gender: Male +- code: "30" + name: Donald Miller + spawn_loc: elizabethst_30 + gender: Male +- code: "31" + name: Charles Moore + spawn_loc: lonsdalest_160 + gender: Male +- code: "32" + name: Ashley Sanchez + spawn_loc: kingst_100 + gender: Male +- code: "33" + name: Margaret Lewis + spawn_loc: flindersst_180 + gender: Female +- code: "34" + name: Sandra Thompson + spawn_loc: swanstonst_80 + gender: Female +- code: "35" + name: Sandra King + spawn_loc: lonsdalest_150 + gender: Female +- code: "36" + name: Lisa Anderson + spawn_loc: lonsdalest_210 + gender: Female +- code: "37" + name: Kimberly Martin + spawn_loc: kingst_80 + gender: Female +- code: "38" + name: Susan Smith + spawn_loc: latrobest_190 + gender: Female +- code: "39" + name: Susan Martin + spawn_loc: collinsst_150 + gender: Female +- code: "40" + name: Linda Scott + spawn_loc: williamsst_30 + gender: Female +- code: "41" + name: Donald Miller + spawn_loc: elizabethst_80 + gender: Male +- code: "42" + name: Mark Hill + spawn_loc: collinsst_120 + gender: Male +- code: "43" + name: William Perez + spawn_loc: queenst_90 + gender: Male +- code: "44" + name: Donald Perez + spawn_loc: queenst_lonsdalest + gender: Male +- code: "45" + name: Lisa Rodriguez + spawn_loc: collinsst_100 + gender: Female +- code: "46" + name: James Adams + spawn_loc: latrobest_150 + gender: Male +- code: "47" + name: James Moore + spawn_loc: latrobest_130 + gender: Male +- code: "48" + name: Joseph Martin + spawn_loc: bourkest_150 + gender: Male +- code: "49" + name: Matthew Jones + spawn_loc: kingst_60 + gender: Male +- code: "50" + name: Michael Sanchez + spawn_loc: queenst_100 + gender: Male +- code: "51" + name: Donna Torres + spawn_loc: flindersst_150 + gender: Female +- code: "52" + name: Barbara Garcia + spawn_loc: swanstonst_50 + gender: Female +- code: "53" + name: Daniel Miller + spawn_loc: bourkest_110 + gender: Male +- code: "54" + name: Robert Young + spawn_loc: kingst_collinsst + gender: Male +- code: "55" + name: Donald Flores + spawn_loc: swanstonst_40 + gender: Male +- code: "56" + name: Charles Thomas + spawn_loc: flindersst_110 + gender: Male +- code: "57" + name: William Torres + spawn_loc: swanstonst_60 + gender: Male +- code: "58" + name: Barbara Gonzalez + spawn_loc: collinsst_190 + gender: Female +- code: "59" + name: Mary Smith + spawn_loc: bourkest_180 + gender: Female +- code: "60" + name: Michael John + spawn_loc: williamsst_110 + gender: Male diff --git a/blastmud_game/src/static_content/npc/melbs_dog.rs b/blastmud_game/src/static_content/npc/melbs_dog.rs index 39f03375..c6b74537 100644 --- a/blastmud_game/src/static_content/npc/melbs_dog.rs +++ b/blastmud_game/src/static_content/npc/melbs_dog.rs @@ -1,91 +1,38 @@ use super::{KillBonus, NPC}; use crate::models::{consent::ConsentType, item::Pronouns}; use crate::static_content::{possession_type::PossessionType, species::SpeciesType}; +use serde::Deserialize; +use serde_yaml::from_str as from_yaml_str; -macro_rules! dog { - ($code:expr, $adj:expr, $spawn: expr) => { - NPC { - code: concat!("melbs_dog_", $code), - name: concat!($adj, " dog"), - pronouns: Pronouns { is_proper: false, ..Pronouns::default_inanimate() }, - aggression: 12, - wander_zones: vec!("melbs"), - description: "A malnourished looking dog. Its skeleton is visible through its thin and patchy fur. It smells terrible, and certainly doesn't look tame.", - aliases: vec!("dog"), - spawn_location: concat!("room/", $spawn), - intrinsic_weapon: Some(PossessionType::Fangs), - species: SpeciesType::Dog, - kill_bonus: Some(KillBonus { - msg: "On your wristpad: Thank you for helping Melbs with animal control! Here's your fee.", - payment: 100, - }), - player_consents: vec!(ConsentType::Fight), - ..Default::default() - } - } +#[derive(Deserialize)] +struct MelbsDog { + code: String, + adjectives: String, + spawn_room: String, } pub fn npc_list() -> Vec { - vec![ - dog!("1", "smelly black", "melbs_williamsst_80"), - dog!("2", "howling black", "melbs_swanstonst_100"), - dog!("3", "smelly black", "melbs_collinsst_160"), - dog!("4", "growling light brown", "melbs_kingst_40"), - dog!("5", "ferocious white", "melbs_swanstonst_110"), - dog!("6", "mangy grey", "melbs_kingst_30"), - dog!("7", "reeking light brown", "melbs_flindersst_210"), - dog!("8", "feral brown", "melbs_elizabethst_40"), - dog!("9", "reeking grey", "melbs_collinsst_190"), - dog!("10", "ferocious grey", "melbs_kingst_60"), - dog!("11", "howling brown", "melbs_collinsst_140"), - dog!("12", "feral black", "melbs_flindersst_160"), - dog!("13", "smelly grey", "melbs_queenst_80"), - dog!("14", "howling grey", "melbs_kingst_70"), - dog!("15", "smelly grey", "melbs_flindersst_110"), - dog!("16", "feral black", "melbs_queenst_latrobest"), - dog!("17", "howling grey", "melbs_swanstonst_110"), - dog!("18", "mangy grey", "melbs_swanstonst_80"), - dog!("19", "reeking light brown", "melbs_latrobest_180"), - dog!("20", "smelly white", "melbs_flindersst_130"), - dog!("21", "reeking grey", "melbs_flindersst_180"), - dog!("22", "growling brown", "melbs_williamsst_80"), - dog!("23", "howling black", "melbs_lonsdalest_100"), - dog!("24", "growling grey", "melbs_latrobest_140"), - dog!("25", "howling light brown", "melbs_queenst_30"), - dog!("26", "howling black", "melbs_latrobest_160"), - dog!("27", "howling grey", "melbs_collinsst_170"), - dog!("28", "growling brown", "melbs_elizabethst_latrobest"), - dog!("29", "mangy brown", "melbs_kingst_70"), - dog!("30", "growling black", "melbs_swanstonst_120"), - dog!("31", "reeking light brown", "melbs_latrobest_130"), - dog!("32", "howling white", "melbs_bourkest_160"), - dog!("33", "growling black", "melbs_elizabethst_50"), - dog!("34", "mangy black", "melbs_swanstonst_110"), - dog!("35", "ferocious grey", "melbs_collinsst_100"), - dog!("36", "mangy grey", "melbs_flindersst_100"), - dog!("37", "growling brown", "melbs_swanstonst_flindersst"), - dog!("38", "mangy light brown", "melbs_lonsdalest_200"), - dog!("39", "howling light brown", "melbs_flindersst_210"), - dog!("40", "mangy light brown", "melbs_queenst_flindersst"), - dog!("41", "reeking white", "melbs_collinsst_130"), - dog!("42", "growling light brown", "melbs_lonsdalest_130"), - dog!("43", "reeking light brown", "melbs_elizabethst_70"), - dog!("44", "mangy brown", "melbs_swanstonst_30"), - dog!("45", "growling light brown", "melbs_swanstonst_lonsdalest"), - dog!("46", "smelly brown", "melbs_queenst_lonsdalest"), - dog!("47", "growling white", "melbs_elizabethst_bourkest"), - dog!("48", "feral brown", "melbs_collinsst_140"), - dog!("49", "ferocious black", "melbs_lonsdalest_150"), - dog!("50", "mangy grey", "melbs_kingst_collinsst"), - dog!("51", "ferocious brown", "melbs_kingst_120"), - dog!("52", "growling white", "melbs_elizabethst_10"), - dog!("53", "ferocious white", "melbs_lonsdalest_190"), - dog!("54", "smelly grey", "melbs_kingst_collinsst"), - dog!("55", "reeking light brown", "melbs_elizabethst_90"), - dog!("56", "reeking grey", "melbs_swanstonst_20"), - dog!("57", "feral brown", "melbs_flindersst_180"), - dog!("58", "reeking brown", "melbs_bourkest_130"), - dog!("59", "mangy light brown", "melbs_queenst_50"), - dog!("60", "growling white", "melbs_kingst_110"), - ] + from_yaml_str::>(include_str!("melbs_dog.yaml")) + .unwrap() + .into_iter() + .map(|d| + NPC { + code: format!("melbs_dog_{}", &d.code), + name: format!("{} dog", &d.adjectives), + pronouns: Pronouns { is_proper: false, ..Pronouns::default_inanimate() }, + aggression: 12, + wander_zones: vec!("melbs".to_owned()), + description: "A malnourished looking dog. Its skeleton is visible through its thin and patchy fur. It smells terrible, and certainly doesn't look tame.".to_owned(), + aliases: vec!("dog".to_owned()), + spawn_location: format!("room/{}", d.spawn_room), + intrinsic_weapon: Some(PossessionType::Fangs), + species: SpeciesType::Dog, + kill_bonus: Some(KillBonus { + msg: "On your wristpad: Thank you for helping Melbs with animal control! Here's your fee.", + payment: 100, + }), + player_consents: vec!(ConsentType::Fight), + ..Default::default() + } + ).collect() } diff --git a/blastmud_game/src/static_content/npc/melbs_dog.yaml b/blastmud_game/src/static_content/npc/melbs_dog.yaml new file mode 100644 index 00000000..cbb715c2 --- /dev/null +++ b/blastmud_game/src/static_content/npc/melbs_dog.yaml @@ -0,0 +1,180 @@ +- code: "1" + adjectives: smelly black + spawn_room: melbs_williamsst_80 +- code: "2" + adjectives: howling black + spawn_room: melbs_swanstonst_100 +- code: "3" + adjectives: smelly black + spawn_room: melbs_collinsst_160 +- code: "4" + adjectives: growling light brown + spawn_room: melbs_kingst_40 +- code: "5" + adjectives: ferocious white + spawn_room: melbs_swanstonst_110 +- code: "6" + adjectives: mangy grey + spawn_room: melbs_kingst_30 +- code: "7" + adjectives: reeking light brown + spawn_room: melbs_flindersst_210 +- code: "8" + adjectives: feral brown + spawn_room: melbs_elizabethst_40 +- code: "9" + adjectives: reeking grey + spawn_room: melbs_collinsst_190 +- code: "10" + adjectives: ferocious grey + spawn_room: melbs_kingst_60 +- code: "11" + adjectives: howling brown + spawn_room: melbs_collinsst_140 +- code: "12" + adjectives: feral black + spawn_room: melbs_flindersst_160 +- code: "13" + adjectives: smelly grey + spawn_room: melbs_queenst_80 +- code: "14" + adjectives: howling grey + spawn_room: melbs_kingst_70 +- code: "15" + adjectives: smelly grey + spawn_room: melbs_flindersst_110 +- code: "16" + adjectives: feral black + spawn_room: melbs_queenst_latrobest +- code: "17" + adjectives: howling grey + spawn_room: melbs_swanstonst_110 +- code: "18" + adjectives: mangy grey + spawn_room: melbs_swanstonst_80 +- code: "19" + adjectives: reeking light brown + spawn_room: melbs_latrobest_180 +- code: "20" + adjectives: smelly white + spawn_room: melbs_flindersst_130 +- code: "21" + adjectives: reeking grey + spawn_room: melbs_flindersst_180 +- code: "22" + adjectives: growling brown + spawn_room: melbs_williamsst_80 +- code: "23" + adjectives: howling black + spawn_room: melbs_lonsdalest_100 +- code: "24" + adjectives: growling grey + spawn_room: melbs_latrobest_140 +- code: "25" + adjectives: howling light brown + spawn_room: melbs_queenst_30 +- code: "26" + adjectives: howling black + spawn_room: melbs_latrobest_160 +- code: "27" + adjectives: howling grey + spawn_room: melbs_collinsst_170 +- code: "28" + adjectives: growling brown + spawn_room: melbs_elizabethst_latrobest +- code: "29" + adjectives: mangy brown + spawn_room: melbs_kingst_70 +- code: "30" + adjectives: growling black + spawn_room: melbs_swanstonst_120 +- code: "31" + adjectives: reeking light brown + spawn_room: melbs_latrobest_130 +- code: "32" + adjectives: howling white + spawn_room: melbs_bourkest_160 +- code: "33" + adjectives: growling black + spawn_room: melbs_elizabethst_50 +- code: "34" + adjectives: mangy black + spawn_room: melbs_swanstonst_110 +- code: "35" + adjectives: ferocious grey + spawn_room: melbs_collinsst_100 +- code: "36" + adjectives: mangy grey + spawn_room: melbs_flindersst_100 +- code: "37" + adjectives: growling brown + spawn_room: melbs_swanstonst_flindersst +- code: "38" + adjectives: mangy light brown + spawn_room: melbs_lonsdalest_200 +- code: "39" + adjectives: howling light brown + spawn_room: melbs_flindersst_210 +- code: "40" + adjectives: mangy light brown + spawn_room: melbs_queenst_flindersst +- code: "41" + adjectives: reeking white + spawn_room: melbs_collinsst_130 +- code: "42" + adjectives: growling light brown + spawn_room: melbs_lonsdalest_130 +- code: "43" + adjectives: reeking light brown + spawn_room: melbs_elizabethst_70 +- code: "44" + adjectives: mangy brown + spawn_room: melbs_swanstonst_30 +- code: "45" + adjectives: growling light brown + spawn_room: melbs_swanstonst_lonsdalest +- code: "46" + adjectives: smelly brown + spawn_room: melbs_queenst_lonsdalest +- code: "47" + adjectives: growling white + spawn_room: melbs_elizabethst_bourkest +- code: "48" + adjectives: feral brown + spawn_room: melbs_collinsst_140 +- code: "49" + adjectives: ferocious black + spawn_room: melbs_lonsdalest_150 +- code: "50" + adjectives: mangy grey + spawn_room: melbs_kingst_collinsst +- code: "51" + adjectives: ferocious brown + spawn_room: melbs_kingst_120 +- code: "52" + adjectives: growling white + spawn_room: melbs_elizabethst_10 +- code: "53" + adjectives: ferocious white + spawn_room: melbs_lonsdalest_190 +- code: "54" + adjectives: smelly grey + spawn_room: melbs_kingst_collinsst +- code: "55" + adjectives: reeking light brown + spawn_room: melbs_elizabethst_90 +- code: "56" + adjectives: reeking grey + spawn_room: melbs_swanstonst_20 +- code: "57" + adjectives: feral brown + spawn_room: melbs_flindersst_180 +- code: "58" + adjectives: reeking brown + spawn_room: melbs_bourkest_130 +- code: "59" + adjectives: mangy light brown + spawn_room: melbs_queenst_50 +- code: "60" + adjectives: growling white + spawn_room: melbs_kingst_110 diff --git a/blastmud_game/src/static_content/npc/roboporter.rs b/blastmud_game/src/static_content/npc/roboporter.rs index 17d92ca4..06aacb79 100644 --- a/blastmud_game/src/static_content/npc/roboporter.rs +++ b/blastmud_game/src/static_content/npc/roboporter.rs @@ -14,9 +14,17 @@ use crate::{ use ansi::ansi; use async_trait::async_trait; use mockall_double::double; +use serde::Deserialize; +use serde_yaml::from_str as from_yaml_str; struct RoboporterHandler; +#[derive(Deserialize)] +struct RoboporterDesc { + code: String, + spawn_room: String, +} + #[async_trait] impl HireHandler for RoboporterHandler { async fn hire_handler( @@ -77,7 +85,7 @@ impl HireHandler for RoboporterHandler { let old_location = target.location.clone(); if let Some(return_to) = npc_by_code() .get(target.item_code.as_str()) - .map(|npc| npc.spawn_location) + .map(|npc| npc.spawn_location.as_str()) { if return_to != &target.location { target.location = return_to.to_owned(); @@ -103,40 +111,28 @@ impl HireHandler for RoboporterHandler { static ROBOPORTER_HANDLER: RoboporterHandler = RoboporterHandler; -macro_rules! roboporter { - ($code:expr, $spawn: expr) => { - NPC { - code: concat!("roboporter_", $code), - name: concat!("Roboporter ", $code), - pronouns: Pronouns { is_proper: true, ..Pronouns::default_inanimate() }, - description: "Standing at an imposing height of over 5 metres, and as wide as a truck, the Roboporter is a marvel of mechanical engineering. Its sturdy metallic frame is built for strength and endurance, with hydraulic joints that allow for precise movements. The body is covered in scuffs and scratches, evidence of its relentless hauling duties.\n\nEquipped with a plethora of massive storage compartments, the Roboporter was clearly designed to carry large and heavy loads with ease. Its reinforced chassis and powerful motors enable it to traverse all terrains, from rubble-strewn streets to treacherous wastelands. It seems to have hinges all over it so it can dynamically transform its shape to sqeeze through doors and haul cargo into indoor spaces too. The faint hum of its internal machinery is ever-present, a testament to its unwavering efficiency.\n\nThe Roboporter's front panel displays a digital interface, showcasing real-time diagnostics and its current operational status. A pair of bright LED lights function as its eyes, pulsating with a soft glow. It lacks any human-like features, emphasizing its purely functional design.\n\nDespite its lack of emotions, the Roboporter exudes an aura of dependability and reliability. It stands as a symbol of resilience in a world ravaged by chaos, ready to assist survivors in their quest for survival.", - aliases: vec!("roboporter"), - spawn_location: concat!("room/", $spawn), - intrinsic_weapon: Some(PossessionType::Fangs), - species: SpeciesType::Robot, - hire_data: Some(HireData { - handler: &ROBOPORTER_HANDLER, - frequency_secs: 600, - price: 100, - }), - extra_flags: vec![ItemFlag::CanLoad], - total_stats: vec![(StatType::Brawn, 20.0)].into_iter().collect(), - ..Default::default() - } - } -} - pub fn npc_list() -> Vec { - vec![ - roboporter!("1", "melbs_roboporter_rentals"), - roboporter!("2", "melbs_roboporter_rentals"), - roboporter!("3", "melbs_roboporter_rentals"), - roboporter!("4", "melbs_roboporter_rentals"), - roboporter!("5", "melbs_roboporter_rentals"), - roboporter!("6", "melbs_roboporter_rentals"), - roboporter!("7", "melbs_roboporter_rentals"), - roboporter!("8", "melbs_roboporter_rentals"), - roboporter!("9", "melbs_roboporter_rentals"), - roboporter!("10", "melbs_roboporter_rentals"), - ] + from_yaml_str::>(include_str!("roboporter.yaml")) + .unwrap() + .into_iter() + .map(|rp| + NPC { + code: format!("roboporter_{}", &rp.code), + name: format!("Roboporter {}", &rp.code), + pronouns: Pronouns { is_proper: true, ..Pronouns::default_inanimate() }, + description: "Standing at an imposing height of over 5 metres, and as wide as a truck, the Roboporter is a marvel of mechanical engineering. Its sturdy metallic frame is built for strength and endurance, with hydraulic joints that allow for precise movements. The body is covered in scuffs and scratches, evidence of its relentless hauling duties.\n\nEquipped with a plethora of massive storage compartments, the Roboporter was clearly designed to carry large and heavy loads with ease. Its reinforced chassis and powerful motors enable it to traverse all terrains, from rubble-strewn streets to treacherous wastelands. It seems to have hinges all over it so it can dynamically transform its shape to sqeeze through doors and haul cargo into indoor spaces too. The faint hum of its internal machinery is ever-present, a testament to its unwavering efficiency.\n\nThe Roboporter's front panel displays a digital interface, showcasing real-time diagnostics and its current operational status. A pair of bright LED lights function as its eyes, pulsating with a soft glow. It lacks any human-like features, emphasizing its purely functional design.\n\nDespite its lack of emotions, the Roboporter exudes an aura of dependability and reliability. It stands as a symbol of resilience in a world ravaged by chaos, ready to assist survivors in their quest for survival.".to_owned(), + aliases: vec!("roboporter".to_owned()), + spawn_location: format!("room/{}", &rp.spawn_room), + intrinsic_weapon: Some(PossessionType::Fangs), + species: SpeciesType::Robot, + hire_data: Some(HireData { + handler: &ROBOPORTER_HANDLER, + frequency_secs: 600, + price: 100, + }), + extra_flags: vec![ItemFlag::CanLoad], + total_stats: vec![(StatType::Brawn, 20.0)].into_iter().collect(), + ..Default::default() + } + ).collect() } diff --git a/blastmud_game/src/static_content/npc/roboporter.yaml b/blastmud_game/src/static_content/npc/roboporter.yaml new file mode 100644 index 00000000..35189506 --- /dev/null +++ b/blastmud_game/src/static_content/npc/roboporter.yaml @@ -0,0 +1,20 @@ +- code: "1" + spawn_room: melbs_roboporter_rentals +- code: "2" + spawn_room: melbs_roboporter_rentals +- code: "3" + spawn_room: melbs_roboporter_rentals +- code: "4" + spawn_room: melbs_roboporter_rentals +- code: "5" + spawn_room: melbs_roboporter_rentals +- code: "6" + spawn_room: melbs_roboporter_rentals +- code: "7" + spawn_room: melbs_roboporter_rentals +- code: "8" + spawn_room: melbs_roboporter_rentals +- code: "9" + spawn_room: melbs_roboporter_rentals +- code: "10" + spawn_room: melbs_roboporter_rentals diff --git a/blastmud_game/src/static_content/room.rs b/blastmud_game/src/static_content/room.rs index c5890af9..c6e60a66 100644 --- a/blastmud_game/src/static_content/room.rs +++ b/blastmud_game/src/static_content/room.rs @@ -563,7 +563,7 @@ pub fn room_map_by_zloc() -> &'static BTreeMap<(&'static str, &'static GridCoord pub fn room_static_items() -> Box> { Box::new(room_list().iter().map(|r| StaticItem { - item_code: &r.code, + item_code: r.code.clone(), initial_item: Box::new(|| Item { item_code: r.code.to_owned(), item_type: "room".to_owned(), diff --git a/blastmud_listener/Cargo.toml b/blastmud_listener/Cargo.toml index af0115cb..43e3e08a 100644 --- a/blastmud_listener/Cargo.toml +++ b/blastmud_listener/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" blastmud_interfaces = { path = "../blastmud_interfaces" } futures = "0.3.25" log = "0.4.17" -nix = "0.26.2" +nix = "0.27.1" once_cell = "1.17.0" rand = "0.8.5" serde = { version = "1.0.149", features = ["derive", "serde_derive"] }