From ee49ebe8074b9a3afb2ce220a68da906b04863df Mon Sep 17 00:00:00 2001 From: Acrimon Date: Mon, 29 Jul 2019 13:42:26 +0000 Subject: [PATCH] Update rand, log and scan_fmt --- Cargo.lock | 83 +++++++-------- chat-cli/Cargo.toml | 2 +- client/Cargo.toml | 4 +- common/Cargo.toml | 6 +- server-cli/Cargo.toml | 2 +- server/Cargo.toml | 12 +-- server/src/cmd.rs | 209 ++++++++++++++++++++------------------ voxygen/Cargo.toml | 6 +- world/Cargo.toml | 2 +- world/src/sim/location.rs | 13 +-- world/src/sim/mod.rs | 22 +++- 11 files changed, 189 insertions(+), 172 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a817802a2b..8b4d65a843 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -765,7 +765,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -811,8 +811,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -986,10 +986,10 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1001,7 +1001,7 @@ dependencies = [ "derivative 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "draw_state 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_core 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1012,7 +1012,7 @@ dependencies = [ "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "derivative 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "draw_state 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1022,7 +1022,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gfx_core 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_gl 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1093,7 +1093,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1138,7 +1138,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1396,9 +1396,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "lazy_static" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "lazycell" @@ -1466,12 +1463,12 @@ name = "log" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "log" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1582,7 +1579,7 @@ dependencies = [ "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1595,7 +1592,7 @@ version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2005,7 +2002,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2121,7 +2118,7 @@ name = "rand" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "getrandom 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2164,7 +2161,7 @@ name = "rand_core" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "getrandom 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2291,7 +2288,7 @@ dependencies = [ [[package]] name = "regex" -version = "1.2.0" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2398,10 +2395,10 @@ dependencies = [ [[package]] name = "scan_fmt" -version = "0.1.3" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2524,7 +2521,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2573,7 +2570,7 @@ dependencies = [ "derivative 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "hibitset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "mopa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "nonzero_signed 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2596,11 +2593,6 @@ dependencies = [ "sum_type 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "spin" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "stable_deref_trait" version = "1.1.1" @@ -2811,7 +2803,7 @@ version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2837,7 +2829,7 @@ dependencies = [ name = "veloren-chat-cli" version = "0.2.0" dependencies = [ - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_env_logger 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "veloren-client 0.2.0", "veloren-common 0.2.0", @@ -2847,7 +2839,7 @@ dependencies = [ name = "veloren-client" version = "0.2.0" dependencies = [ - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", "uvth 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2865,7 +2857,7 @@ dependencies = [ "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "lz4-compress 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2885,10 +2877,10 @@ version = "0.2.0" dependencies = [ "chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "scan_fmt 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "scan_fmt 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", "specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2903,7 +2895,7 @@ name = "veloren-server-cli" version = "0.2.0" dependencies = [ "heaptrack 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_env_logger 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "veloren-common 0.2.0", "veloren-server 0.2.0", @@ -2934,7 +2926,7 @@ dependencies = [ "heaptrack 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "msgbox 0.1.1 (git+https://github.com/bekker/msgbox-rs.git)", "num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "portpicker 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2960,7 +2952,7 @@ dependencies = [ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "minifb 0.12.0 (git+https://github.com/emoon/rust_minifb.git)", "noise 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "vek 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)", "veloren-common 0.2.0", ] @@ -3106,7 +3098,7 @@ dependencies = [ "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3258,7 +3250,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c2d2199eba47ebcb9977ce28179649bdd59305ef465c4e6f9b65aaa41c24e6b5" "checksum gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df6a3b73e04fafc07f5ebc083f1096a773412e627828e1103a55e921f81187d8" "checksum gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3162ff940526ddff71bf1f630facee6b5e05d282d125ba0c4c803842819b80c3" -"checksum getrandom 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "e65cce4e5084b14874c4e7097f38cab54f47ee554f9194673456ea379dcc4c55" +"checksum getrandom 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8e190892c840661957ba9f32dacfb3eb405e657f9f9f60485605f0bb37d6f8" "checksum gfx 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)" = "619e38a31e275efaf92c6a94f977db8aac396e3cb6998c176cfde32ce3239b69" "checksum gfx_core 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4e1127b02a9d4fcc880091d8a0f4419efd598de4f1649edcd005c76e5792176f" "checksum gfx_device_gl 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3fdb9c21d057f32d5a9fc7b8737a28e09a93006a095e0a129723b424cffd2003" @@ -3309,7 +3301,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" "checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -"checksum log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c275b6ad54070ac2d665eef9197db647b32239c9d244bfb6f041a766d00da5b3" +"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum lz4-compress 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f966533a922a9bba9e95e594c1fdb3b9bf5fdcdb11e37e51ad84cd76e468b91" "checksum lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" "checksum mach 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "86dd2487cdfea56def77b88438a2c915fb45113c5319bfe7e14306ca4cd0b0e1" @@ -3400,7 +3392,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum redox_users 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe5204c3a17e97dde73f285d49be585df59ed84b50a872baf416e73b62c3828" "checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" -"checksum regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6b23da8dfd98a84bd7e08700190a5d9f7d2d38abd4369dd1dae651bc40bfd2cc" +"checksum regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d9d8297cc20bbb6184f8b45ff61c8ee6a9ac56c156cec8e38c3e5084773c44ad" "checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" "checksum regex-syntax 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "cd5485bf1523a9ed51c4964273f22f63f24e31632adb5dad134f488f86a3875c" "checksum rodio 0.8.1 (git+https://github.com/desttinghim/rodio.git?rev=dd93f905c1afefaac03c496a666ecab27d3e391b)" = "" @@ -3412,7 +3404,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rusttype 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "654103d61a05074b268a107cf6581ce120f0fc0115f2610ed9dfea363bb81139" "checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" "checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" -"checksum scan_fmt 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8b87497427f9fbe539ee6b9626f5a5e899331fdf1c1d62f14c637a462969db30" +"checksum scan_fmt 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "380bd38616913c3d95eb7c7fb212ac59f2c4bc02686e5627490a9ae285284fa2" "checksum scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" @@ -3434,7 +3426,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum smithay-client-toolkit 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2ccb8c57049b2a34d2cc2b203fa785020ba0129d31920ef0d317430adaf748fa" "checksum specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)" = "de65613ada4338aa7ba71eca60eca24c60483433eec0077bc4f33cfc31f4bdf0" "checksum sphynx 0.1.0 (git+https://gitlab.com/veloren/sphynx.git)" = "" -"checksum spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44363f6f51401c34e7be73db0db371c04705d35efbe9f7d6082e03a921a32c55" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum stb_truetype 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "69b7df505db8e81d54ff8be4693421e5b543e08214bd8d99eb761fcb4d5668ba" diff --git a/chat-cli/Cargo.toml b/chat-cli/Cargo.toml index 71e42c8c00..87768dfbaf 100644 --- a/chat-cli/Cargo.toml +++ b/chat-cli/Cargo.toml @@ -8,5 +8,5 @@ edition = "2018" client = { package = "veloren-client", path = "../client" } common = { package = "veloren-common", path = "../common" } -log = "0.4.7" +log = "0.4.8" pretty_env_logger = "0.3.0" diff --git a/client/Cargo.toml b/client/Cargo.toml index 9e45536de9..ef9eca41ba 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -7,8 +7,8 @@ edition = "2018" [dependencies] common = { package = "veloren-common", path = "../common" } -uvth = "3.1.0" +uvth = "3.1.1" num_cpus = "1.10.1" -log = "0.4.7" +log = "0.4.8" specs = "0.14.2" vek = "0.9.8" diff --git a/common/Cargo.toml b/common/Cargo.toml index 9a78e92440..118663b2fe 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -13,11 +13,11 @@ dot_vox = "4.0.0" image = "0.22.0" mio = "0.6.19" mio-extras = "2.0.5" -serde = "1.0.97" -serde_derive = "1.0.97" +serde = "1.0.98" +serde_derive = "1.0.98" serde_json = "1.0.40" bincode = "1.1.4" -log = "0.4.7" +log = "0.4.8" rand = "0.7.0" rayon = "1.1.0" lazy_static = "1.3.0" diff --git a/server-cli/Cargo.toml b/server-cli/Cargo.toml index ad8bc148c2..a8dd67884d 100644 --- a/server-cli/Cargo.toml +++ b/server-cli/Cargo.toml @@ -9,5 +9,5 @@ server = { package = "veloren-server", path = "../server" } common = { package = "veloren-common", path = "../common" } heaptrack = "0.3.0" -log = "0.4.7" +log = "0.4.8" pretty_env_logger = "0.3.0" diff --git a/server/Cargo.toml b/server/Cargo.toml index d3a059f14f..114c030dc3 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -8,14 +8,14 @@ edition = "2018" common = { package = "veloren-common", path = "../common" } world = { package = "veloren-world", path = "../world" } -log = "0.4.7" +log = "0.4.8" specs = "0.14.2" vek = "0.9.8" -uvth = "3.1.0" +uvth = "3.1.1" lazy_static = "1.3.0" -scan_fmt = "0.1.3" +scan_fmt = "0.2.3" ron = "0.5.1" -serde = "1.0" -serde_derive = "1.0" -rand = "0.5.6" +serde = "1.0.98" +serde_derive = "1.0.98" +rand = "0.7.0" chrono = "0.4.7" diff --git a/server/src/cmd.rs b/server/src/cmd.rs index 3b8e41ad9a..e98c2400f6 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -15,7 +15,7 @@ use specs::{Builder, Entity as EcsEntity, Join}; use vek::*; use lazy_static::lazy_static; -use scan_fmt::scan_fmt; +use scan_fmt::{scan_fmt, scan_fmt_some}; /// Struct representing a command that a user can run from server chat. pub struct ChatCommand { @@ -155,7 +155,8 @@ lazy_static! { } fn handle_jump(server: &mut Server, entity: EcsEntity, args: String, action: &ChatCommand) { - let (opt_x, opt_y, opt_z) = scan_fmt!(&args, action.arg_fmt, f32, f32, f32); + let (opt_x, opt_y, opt_z) = scan_fmt_some!(&args, action.arg_fmt, f32, f32, f32); + match (opt_x, opt_y, opt_z) { (Some(x), Some(y), Some(z)) => { match server.state.read_component_cloned::(entity) { @@ -178,7 +179,14 @@ fn handle_jump(server: &mut Server, entity: EcsEntity, args: String, action: &Ch } fn handle_goto(server: &mut Server, entity: EcsEntity, args: String, action: &ChatCommand) { - let (opt_x, opt_y, opt_z) = scan_fmt!(&args, action.arg_fmt, f32, f32, f32); + let (mut opt_x, mut opt_y, mut opt_z) = (None, None, None); + + if let Ok((opt_x1, opt_y1, opt_z1)) = scan_fmt!(&args, action.arg_fmt, f32, f32, f32) { + opt_x = Some(opt_x1); + opt_y = Some(opt_y1); + opt_z = Some(opt_z1); + } + match server.state.read_component_cloned::(entity) { Some(_pos) => match (opt_x, opt_y, opt_z) { (Some(x), Some(y), Some(z)) => { @@ -212,11 +220,11 @@ fn handle_kill(server: &mut Server, entity: EcsEntity, _args: String, _action: & fn handle_time(server: &mut Server, entity: EcsEntity, args: String, action: &ChatCommand) { let time = scan_fmt!(&args, action.arg_fmt, String); let new_time = match time.as_ref().map(|s| s.as_str()) { - Some("night") => NaiveTime::from_hms(0, 0, 0), - Some("dawn") => NaiveTime::from_hms(5, 0, 0), - Some("day") => NaiveTime::from_hms(12, 0, 0), - Some("dusk") => NaiveTime::from_hms(17, 0, 0), - Some(n) => match n.parse() { + Ok("night") => NaiveTime::from_hms(0, 0, 0), + Ok("dawn") => NaiveTime::from_hms(5, 0, 0), + Ok("day") => NaiveTime::from_hms(12, 0, 0), + Ok("dusk") => NaiveTime::from_hms(17, 0, 0), + Ok(n) => match n.parse() { Ok(n) => n, Err(_) => match NaiveTime::parse_from_str(n, "%H:%M") { Ok(time) => time, @@ -229,7 +237,7 @@ fn handle_time(server: &mut Server, entity: EcsEntity, args: String, action: &Ch } }, }, - None => { + Err(_) => { let time_in_seconds = server.state.ecs_mut().read_resource::().0; let current_time = NaiveTime::from_num_seconds_from_midnight(time_in_seconds as u32, 0); server.clients.notify( @@ -265,8 +273,8 @@ fn handle_health(server: &mut Server, entity: EcsEntity, args: String, action: & .get_mut(entity) { Some(stats) => match opt_hp { - Some(hp) => stats.health.set_to(hp, comp::HealthSource::Command), - None => { + Ok(hp) => stats.health.set_to(hp, comp::HealthSource::Command), + Err(_) => { server.clients.notify( entity, ServerMsg::private(String::from("You must specify health amount!")), @@ -283,7 +291,7 @@ fn handle_health(server: &mut Server, entity: EcsEntity, args: String, action: & fn handle_alias(server: &mut Server, entity: EcsEntity, args: String, action: &ChatCommand) { let opt_alias = scan_fmt!(&args, action.arg_fmt, String); match opt_alias { - Some(alias) => { + Ok(alias) => { server .state .ecs_mut() @@ -291,7 +299,7 @@ fn handle_alias(server: &mut Server, entity: EcsEntity, args: String, action: &C .get_mut(entity) .map(|player| player.alias = alias); } - None => server + Err(_) => server .clients .notify(entity, ServerMsg::private(String::from(action.help_string))), } @@ -300,7 +308,7 @@ fn handle_alias(server: &mut Server, entity: EcsEntity, args: String, action: &C fn handle_tp(server: &mut Server, entity: EcsEntity, args: String, action: &ChatCommand) { let opt_alias = scan_fmt!(&args, action.arg_fmt, String); match opt_alias { - Some(alias) => { + Ok(alias) => { let ecs = server.state.ecs(); let opt_player = (&ecs.entities(), &ecs.read_storage::()) .join() @@ -338,54 +346,55 @@ fn handle_tp(server: &mut Server, entity: EcsEntity, args: String, action: &Chat } } } - None => server + Err(_) => server .clients .notify(entity, ServerMsg::private(String::from(action.help_string))), } } fn handle_spawn(server: &mut Server, entity: EcsEntity, args: String, action: &ChatCommand) { - let (opt_align, opt_id, opt_amount) = scan_fmt!(&args, action.arg_fmt, String, NpcKind, String); - // This should be just an enum handled with scan_fmt! - let opt_agent = alignment_to_agent(&opt_align.unwrap_or(String::new()), entity); - let _objtype = scan_fmt!(&args, action.arg_fmt, String); - // Make sure the amount is either not provided or a valid value - let opt_amount = opt_amount - .map_or(Some(1), |a| a.parse().ok()) - .and_then(|a| if a > 0 { Some(a) } else { None }); + match scan_fmt!(&args, action.arg_fmt, String, NpcKind, String) { + Ok((opt_align, id, opt_amount)) => { + if let Some(agent) = alignment_to_agent(&opt_align, entity) { + let _objtype = scan_fmt!(&args, action.arg_fmt, String); + let amount = Some(opt_amount) + .map_or(Some(1), |a| a.parse().ok()) + .and_then(|a| if a > 0 { Some(a) } else { None }) + .unwrap(); - match (opt_agent, opt_id, opt_amount) { - (Some(agent), Some(id), Some(amount)) => { - match server.state.read_component_cloned::(entity) { - Some(pos) => { - for _ in 0..amount { - let vel = Vec3::new( - rand::thread_rng().gen_range(-2.0, 3.0), - rand::thread_rng().gen_range(-2.0, 3.0), - 10.0, + match server.state.read_component_cloned::(entity) { + Some(pos) => { + for _ in 0..amount { + let vel = Vec3::new( + rand::thread_rng().gen_range(-2.0, 3.0), + rand::thread_rng().gen_range(-2.0, 3.0), + 10.0, + ); + + let body = kind_to_body(id); + server + .create_npc(pos, get_npc_name(id), body) + .with(comp::Vel(vel)) + .with(agent) + .build(); + } + server.clients.notify( + entity, + ServerMsg::private(format!("Spawned {} entities", amount).to_owned()), ); - - let body = kind_to_body(id); - server - .create_npc(pos, get_npc_name(id), body) - .with(comp::Vel(vel)) - .with(agent) - .build(); } - server.clients.notify( + None => server.clients.notify( entity, - ServerMsg::private(format!("Spawned {} entities", amount).to_owned()), - ); + ServerMsg::private("You have no position!".to_owned()), + ), } - None => server.clients.notify( - entity, - ServerMsg::private("You have no position!".to_owned()), - ), } } - _ => server - .clients - .notify(entity, ServerMsg::private(String::from(action.help_string))), + Err(_) => { + server + .clients + .notify(entity, ServerMsg::private(String::from(action.help_string))); + } } } @@ -507,52 +516,52 @@ fn handle_object(server: &mut Server, entity: EcsEntity, args: String, _action: .with(ori);*/ if let (Some(pos), Some(ori)) = (pos, ori) { let obj_type = match obj_type.as_ref().map(String::as_str) { - Some("scarecrow") => comp::object::Body::Scarecrow, - Some("cauldron") => comp::object::Body::Cauldron, - Some("chest_vines") => comp::object::Body::ChestVines, - Some("chest") => comp::object::Body::Chest, - Some("chest_dark") => comp::object::Body::ChestDark, - Some("chest_demon") => comp::object::Body::ChestDemon, - Some("chest_gold") => comp::object::Body::ChestGold, - Some("chest_light") => comp::object::Body::ChestLight, - Some("chest_open") => comp::object::Body::ChestOpen, - Some("chest_skull") => comp::object::Body::ChestSkull, - Some("pumpkin") => comp::object::Body::Pumpkin, - Some("pumpkin_2") => comp::object::Body::Pumpkin2, - Some("pumpkin_3") => comp::object::Body::Pumpkin3, - Some("pumpkin_4") => comp::object::Body::Pumpkin4, - Some("pumpkin_5") => comp::object::Body::Pumpkin5, - Some("campfire") => comp::object::Body::Campfire, - Some("lantern_ground") => comp::object::Body::LanternGround, - Some("lantern_ground_open") => comp::object::Body::LanternGroundOpen, - Some("lantern_2") => comp::object::Body::LanternStanding2, - Some("lantern") => comp::object::Body::LanternStanding, - Some("potion_blue") => comp::object::Body::PotionBlue, - Some("potion_green") => comp::object::Body::PotionGreen, - Some("potion_red") => comp::object::Body::PotionRed, - Some("crate") => comp::object::Body::Crate, - Some("tent") => comp::object::Body::Tent, - Some("bomb") => comp::object::Body::Bomb, - Some("window_spooky") => comp::object::Body::WindowSpooky, - Some("door_spooky") => comp::object::Body::DoorSpooky, - Some("carpet") => comp::object::Body::Carpet, - Some("table_human") => comp::object::Body::Table, - Some("table_human_2") => comp::object::Body::Table2, - Some("table_human_3") => comp::object::Body::Table3, - Some("drawer") => comp::object::Body::Drawer, - Some("bed_human_blue") => comp::object::Body::BedBlue, - Some("anvil") => comp::object::Body::Anvil, - Some("gravestone") => comp::object::Body::Gravestone, - Some("gravestone_2") => comp::object::Body::Gravestone2, - Some("chair") => comp::object::Body::Chair, - Some("chair_2") => comp::object::Body::Chair2, - Some("chair_3") => comp::object::Body::Chair3, - Some("bench_human") => comp::object::Body::Bench, - Some("bedroll") => comp::object::Body::Bedroll, - Some("carpet_human_round") => comp::object::Body::CarpetHumanRound, - Some("carpet_human_square") => comp::object::Body::CarpetHumanSquare, - Some("carpet_human_square_2") => comp::object::Body::CarpetHumanSquare2, - Some("carpet_human_squircle") => comp::object::Body::CarpetHumanSquircle, + Ok("scarecrow") => comp::object::Body::Scarecrow, + Ok("cauldron") => comp::object::Body::Cauldron, + Ok("chest_vines") => comp::object::Body::ChestVines, + Ok("chest") => comp::object::Body::Chest, + Ok("chest_dark") => comp::object::Body::ChestDark, + Ok("chest_demon") => comp::object::Body::ChestDemon, + Ok("chest_gold") => comp::object::Body::ChestGold, + Ok("chest_light") => comp::object::Body::ChestLight, + Ok("chest_open") => comp::object::Body::ChestOpen, + Ok("chest_skull") => comp::object::Body::ChestSkull, + Ok("pumpkin") => comp::object::Body::Pumpkin, + Ok("pumpkin_2") => comp::object::Body::Pumpkin2, + Ok("pumpkin_3") => comp::object::Body::Pumpkin3, + Ok("pumpkin_4") => comp::object::Body::Pumpkin4, + Ok("pumpkin_5") => comp::object::Body::Pumpkin5, + Ok("campfire") => comp::object::Body::Campfire, + Ok("lantern_ground") => comp::object::Body::LanternGround, + Ok("lantern_ground_open") => comp::object::Body::LanternGroundOpen, + Ok("lantern_2") => comp::object::Body::LanternStanding2, + Ok("lantern") => comp::object::Body::LanternStanding, + Ok("potion_blue") => comp::object::Body::PotionBlue, + Ok("potion_green") => comp::object::Body::PotionGreen, + Ok("potion_red") => comp::object::Body::PotionRed, + Ok("crate") => comp::object::Body::Crate, + Ok("tent") => comp::object::Body::Tent, + Ok("bomb") => comp::object::Body::Bomb, + Ok("window_spooky") => comp::object::Body::WindowSpooky, + Ok("door_spooky") => comp::object::Body::DoorSpooky, + Ok("carpet") => comp::object::Body::Carpet, + Ok("table_human") => comp::object::Body::Table, + Ok("table_human_2") => comp::object::Body::Table2, + Ok("table_human_3") => comp::object::Body::Table3, + Ok("drawer") => comp::object::Body::Drawer, + Ok("bed_human_blue") => comp::object::Body::BedBlue, + Ok("anvil") => comp::object::Body::Anvil, + Ok("gravestone") => comp::object::Body::Gravestone, + Ok("gravestone_2") => comp::object::Body::Gravestone2, + Ok("chair") => comp::object::Body::Chair, + Ok("chair_2") => comp::object::Body::Chair2, + Ok("chair_3") => comp::object::Body::Chair3, + Ok("bench_human") => comp::object::Body::Bench, + Ok("bedroll") => comp::object::Body::Bedroll, + Ok("carpet_human_round") => comp::object::Body::CarpetHumanRound, + Ok("carpet_human_square") => comp::object::Body::CarpetHumanSquare, + Ok("carpet_human_square_2") => comp::object::Body::CarpetHumanSquare2, + Ok("carpet_human_squircle") => comp::object::Body::CarpetHumanSquircle, _ => { return server .clients @@ -586,7 +595,7 @@ fn handle_object(server: &mut Server, entity: EcsEntity, args: String, _action: fn handle_light(server: &mut Server, entity: EcsEntity, args: String, action: &ChatCommand) { let (opt_r, opt_g, opt_b, opt_x, opt_y, opt_z, opt_s) = - scan_fmt!(&args, action.arg_fmt, f32, f32, f32, f32, f32, f32, f32); + scan_fmt_some!(&args, action.arg_fmt, f32, f32, f32, f32, f32, f32, f32); let mut light_emitter = comp::LightEmitter::default(); @@ -636,7 +645,7 @@ fn handle_lantern(server: &mut Server, entity: EcsEntity, args: String, action: .get(entity) .is_some() { - if let Some(s) = opt_s { + if let Ok(s) = opt_s { if let Some(light) = server .state .ecs() @@ -670,7 +679,7 @@ fn handle_lantern(server: &mut Server, entity: EcsEntity, args: String, action: comp::LightEmitter { offset: Vec3::new(0.5, 0.2, 0.8), col: Rgb::new(1.0, 0.75, 0.3), - strength: if let Some(s) = opt_s { s.max(0.0) } else { 6.0 }, + strength: if let Ok(s) = opt_s { s.max(0.0) } else { 6.0 }, }, ); @@ -684,7 +693,7 @@ fn handle_lantern(server: &mut Server, entity: EcsEntity, args: String, action: fn handle_tell(server: &mut Server, entity: EcsEntity, args: String, action: &ChatCommand) { let opt_alias = scan_fmt!(&args, action.arg_fmt, String); match opt_alias { - Some(alias) => { + Ok(alias) => { let ecs = server.state.ecs(); let opt_player = (&ecs.entities(), &ecs.read_storage::()) .join() @@ -741,7 +750,7 @@ fn handle_tell(server: &mut Server, entity: EcsEntity, args: String, action: &Ch } } } - None => server + Err(_) => server .clients .notify(entity, ServerMsg::private(String::from(action.help_string))), } diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index 6999996702..312bedde87 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -39,11 +39,11 @@ discord-rpc-sdk = { git = "https://github.com/Songtronix/rust-discord-rpc.git", glsl-include = "0.3.1" failure = "0.1.5" lazy_static = "1.3.0" -log = "0.4.7" +log = "0.4.8" dot_vox = "4.0.0" image = "0.22.0" -serde = "1.0.97" -serde_derive = "1.0.97" +serde = "1.0.98" +serde_derive = "1.0.98" ron = "0.5.1" guillotiere = "0.4.2" fnv = "1.0.6" diff --git a/world/Cargo.toml b/world/Cargo.toml index 3c3fca8436..3be35d6247 100644 --- a/world/Cargo.toml +++ b/world/Cargo.toml @@ -10,7 +10,7 @@ vek = "0.9.8" noise = "0.5.1" fxhash = "0.2.1" lazy_static = "1.3.0" -rand = "0.5.0" +rand = "0.7.0" [dev-dependencies] minifb = { git = "https://github.com/emoon/rust_minifb.git" } diff --git a/world/src/sim/location.rs b/world/src/sim/location.rs index 240ddd03bf..93ac61b62c 100644 --- a/world/src/sim/location.rs +++ b/world/src/sim/location.rs @@ -1,5 +1,6 @@ use super::Settlement; use fxhash::FxHashSet; +use rand::seq::SliceRandom; use rand::Rng; use vek::*; @@ -37,7 +38,7 @@ pub struct Kingdom { region_name: String, } -fn generate_name(rng: &mut R) -> String { +fn generate_name(rng: &mut impl Rng) -> String { let firstsyl = [ "Eri", "Val", "Gla", "Wilde", "Cold", "Deep", "Dura", "Ester", "Fay", "Dark", "West", "East", "North", "South", "Ray", "Eri", "Dal", "Som", "Sommer", "Black", "Iron", "Grey", @@ -56,13 +57,13 @@ fn generate_name(rng: &mut R) -> String { let mut name = String::new(); if rng.gen() { - name += rng.choose(&firstsyl).unwrap(); - name += rng.choose(&mid).unwrap(); - name += rng.choose(&tails).unwrap(); + name += firstsyl.choose(rng).unwrap(); + name += mid.choose(rng).unwrap(); + name += tails.choose(rng).unwrap(); name } else { - name += rng.choose(&firstsyl).unwrap(); - name += rng.choose(&tails).unwrap(); + name += firstsyl.choose(rng).unwrap(); + name += tails.choose(rng).unwrap(); name } } diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 7981874852..11baa60b1f 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -15,7 +15,7 @@ use common::{ vol::VolSize, }; use noise::{BasicMulti, HybridMulti, MultiFractal, NoiseFn, RidgedMulti, Seedable, SuperSimplex}; -use rand::{prng::XorShiftRng, Rng, SeedableRng}; +use rand::{rngs::StdRng, Rng, SeedableRng}; use std::ops::{Add, Div, Mul, Neg, Sub}; use vek::*; @@ -49,7 +49,7 @@ pub struct WorldSim { pub(crate) locations: Vec, pub(crate) gen_ctx: GenCtx, - pub rng: XorShiftRng, + pub rng: StdRng, } impl WorldSim { @@ -93,23 +93,39 @@ impl WorldSim { chunks, locations: Vec::new(), gen_ctx, - rng: XorShiftRng::from_seed([ + rng: StdRng::from_seed([ (seed >> 0) as u8, 0, 0, 0, + 0, + 0, + 0, + 0, (seed >> 8) as u8, 0, 0, 0, + 0, + 0, + 0, + 0, (seed >> 16) as u8, 0, 0, 0, + 0, + 0, + 0, + 0, (seed >> 24) as u8, 0, 0, 0, + 0, + 0, + 0, + 0, ]), };