diff --git a/Cargo.lock b/Cargo.lock index 0cfd0c3b4f..030eb943a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -79,7 +79,7 @@ name = "approx" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -169,7 +169,7 @@ version = "0.3.40" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (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.65 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -217,7 +217,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "cexpr 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "clang-sys 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -237,7 +237,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -368,8 +368,11 @@ dependencies = [ [[package]] name = "cast" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "cc" @@ -394,7 +397,7 @@ dependencies = [ [[package]] name = "cfg-if" -version = "0.1.10" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -417,12 +420,11 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -600,7 +602,7 @@ dependencies = [ "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "objc_id 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "smithay-clipboard 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "smithay-clipboard 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-client 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", "x11-clipboard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -658,7 +660,7 @@ dependencies = [ "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -668,7 +670,7 @@ name = "crc32fast" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -677,20 +679,20 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "criterion-plot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "csv 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_os 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xoshiro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", "tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -700,19 +702,8 @@ name = "criterion-plot" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-channel 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-deque 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -720,7 +711,7 @@ name = "crossbeam" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -728,18 +719,6 @@ dependencies = [ "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "crossbeam-channel" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-epoch 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "crossbeam-channel" version = "0.3.9" @@ -748,15 +727,6 @@ dependencies = [ "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "crossbeam-deque" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "crossbeam-deque" version = "0.7.2" @@ -766,39 +736,13 @@ dependencies = [ "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "crossbeam-epoch" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "crossbeam-epoch" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -811,7 +755,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -827,16 +771,19 @@ dependencies = [ ] [[package]] -name = "crossbeam-utils" -version = "0.5.0" +name = "crossbeam-queue" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "crossbeam-utils" version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -846,7 +793,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -903,7 +850,7 @@ name = "directories" version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -922,7 +869,7 @@ name = "dirs-sys" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (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.65 (registry+https://github.com/rust-lang/crates.io-index)", "redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1009,7 +956,7 @@ name = "euc" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "vek 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", + "vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1018,7 +965,7 @@ version = "0.19.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "euclid_macros 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1056,7 +1003,7 @@ name = "fern" version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "colored 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1066,7 +1013,7 @@ name = "filetime" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (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.65 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1141,14 +1088,6 @@ name = "fuchsia-zircon-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "gdk" version = "0.8.0" @@ -1215,7 +1154,7 @@ name = "getrandom" version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (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.65 (registry+https://github.com/rust-lang/crates.io-index)", "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1528,11 +1467,11 @@ dependencies = [ [[package]] name = "hibitset" -version = "0.5.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1560,7 +1499,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1573,8 +1512,8 @@ dependencies = [ "jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", "num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", - "png 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "png 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tiff 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1628,7 +1567,7 @@ dependencies = [ [[package]] name = "itertools" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1645,7 +1584,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1716,7 +1655,7 @@ name = "line_drawing" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1724,15 +1663,6 @@ name = "linked-hash-map" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "lock_api" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "lock_api" version = "0.3.1" @@ -1754,7 +1684,7 @@ name = "log" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1822,11 +1752,6 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "memoffset" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "memoffset" version = "0.5.3" @@ -1859,7 +1784,7 @@ name = "minifb" version = "0.13.0" source = "git+https://github.com/emoon/rust_minifb.git#bac71b297920c1f7ab5d6e384673d3ae5cc7d46d" dependencies = [ - "cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", "orbclient 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1886,9 +1811,10 @@ dependencies = [ [[package]] name = "mio" -version = "0.6.19" +version = "0.6.20" 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)", "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1908,7 +1834,7 @@ 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.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.20 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1961,7 +1887,7 @@ name = "net2" version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (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.65 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1973,7 +1899,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (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.65 (registry+https://github.com/rust-lang/crates.io-index)", "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2008,11 +1934,6 @@ dependencies = [ "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "nonzero_signed" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "notify" version = "5.0.0-pre.1" @@ -2028,7 +1949,7 @@ dependencies = [ "inotify 0.7.0 (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.65 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.20 (registry+https://github.com/rust-lang/crates.io-index)", "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2041,7 +1962,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2054,7 +1975,7 @@ dependencies = [ "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", "num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2064,7 +1985,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2073,7 +1994,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2092,7 +2013,7 @@ version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2102,7 +2023,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2113,7 +2034,7 @@ dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2121,12 +2042,12 @@ name = "num-traits" version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2189,7 +2110,7 @@ name = "ordered-float" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2208,14 +2129,6 @@ dependencies = [ "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "owning_ref" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "pango" version = "0.4.0" @@ -2250,15 +2163,6 @@ dependencies = [ "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "parking_lot" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "parking_lot" version = "0.9.0" @@ -2280,24 +2184,12 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "parking_lot_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "parking_lot_core" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2395,7 +2287,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "png" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2422,7 +2314,7 @@ name = "pretty_env_logger" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.10 (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.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2466,7 +2358,7 @@ name = "prometheus" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2723,22 +2615,22 @@ dependencies = [ [[package]] name = "rayon" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon-core 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rayon-core" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2854,7 +2746,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "deflate 0.7.20 (registry+https://github.com/rust-lang/crates.io-index)", "filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "multipart 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2862,7 +2754,7 @@ dependencies = [ "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2912,23 +2804,23 @@ name = "rusttype" version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rusttype 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rusttype 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rusttype" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", "ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "stb_truetype 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "stb_truetype 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2962,11 +2854,6 @@ name = "scoped_threadpool" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "scopeguard" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "scopeguard" version = "1.0.0" @@ -2990,7 +2877,7 @@ name = "sdl2-sys" version = "0.32.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (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.65 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3027,7 +2914,7 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.41" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3056,19 +2943,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "shred" -version = "0.7.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "mopa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "shred-derive 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "shred-derive" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3109,6 +2997,11 @@ dependencies = [ "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "smallvec" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "smithay-client-toolkit" version = "0.4.6" @@ -3142,7 +3035,7 @@ dependencies = [ [[package]] name = "smithay-clipboard" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3151,42 +3044,27 @@ dependencies = [ [[package]] name = "specs" -version = "0.14.3" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "derivative 1.0.3 (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)", + "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "hibitset 0.6.2 (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.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "shred 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "shred-derive 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "shred 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", "shrev 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tuple_utils 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tuple_utils 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "specs-idvs" version = "0.1.0" -source = "git+https://gitlab.com/veloren/specs-idvs.git#4ce792042f951a29874954582234836c0eccaed6" +source = "git+https://gitlab.com/veloren/specs-idvs.git#111548cf44e9bb4c43feb12aa3fc253953ac6e4a" dependencies = [ - "hibitset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "sphynx" -version = "0.1.0" -source = "git+https://gitlab.com/veloren/sphynx.git?rev=ac4adf54d181339a789907acd27f61fe81daa455#ac4adf54d181339a789907acd27f61fe81daa455" -dependencies = [ - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", - "sum_type 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3206,7 +3084,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "stb_truetype" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3383,7 +3261,7 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3402,7 +3280,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ascii 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "chunked_transfer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3414,7 +3292,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3427,7 +3305,7 @@ dependencies = [ [[package]] name = "tuple_utils" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -3461,10 +3339,10 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3519,7 +3397,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "vek" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3549,9 +3427,9 @@ dependencies = [ "image 0.22.3 (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.11.1 (registry+https://github.com/rust-lang/crates.io-index)", - "specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", + "specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "uvth 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "vek 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", + "vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "veloren-common 0.4.0", ] @@ -3565,36 +3443,34 @@ dependencies = [ "dot_vox 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "find_folder 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "hibitset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (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 0.6.20 (registry+https://github.com/rust-lang/crates.io-index)", "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "notify 5.0.0-pre.1 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", - "specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git)", - "sphynx 0.1.0 (git+https://gitlab.com/veloren/sphynx.git?rev=ac4adf54d181339a789907acd27f61fe81daa455)", - "vek 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", + "sum_type 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "veloren-server" version = "0.4.0" dependencies = [ - "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "hibitset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "portpicker 0.1.0 (git+https://github.com/wusyong/portpicker-rs?branch=fix_ipv6)", @@ -3606,10 +3482,10 @@ dependencies = [ "scan_fmt 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", + "specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git)", "uvth 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "vek 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", + "vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "veloren-common 0.4.0", "veloren-world 0.4.0", ] @@ -3629,7 +3505,7 @@ name = "veloren-voxygen" version = "0.4.0" dependencies = [ "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "conrod_core 0.63.0 (git+https://gitlab.com/veloren/conrod.git)", "conrod_winit 0.63.0 (git+https://gitlab.com/veloren/conrod.git)", "cpal 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3659,8 +3535,8 @@ dependencies = [ "rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", - "vek 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", + "specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", + "vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "veloren-client 0.4.0", "veloren-common 0.4.0", "veloren-server 0.4.0", @@ -3683,11 +3559,11 @@ dependencies = [ "ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "roots 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "vek 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", + "vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "veloren-common 0.4.0", ] @@ -3995,14 +3871,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum c_vec 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f8a318911dce53b5f1ca6539c44f5342c632269f0fa7ea3e35f32458c27a7c30" "checksum cairo-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a110f269c2fd382df5fe8bd46dfa5f1b83608aa717fecb6e7a28c08c202f0e13" "checksum cairo-sys-rs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0395175ecba60accac076a02c31d143b9dcd9d5eb5316d7163a3273803b765c7" -"checksum cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "926013f2860c46252efceabb19f4a6b308197505082c609025aa6706c011d427" +"checksum cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" "checksum cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)" = "aa87058dce70a3ff5621797f1506cb837edd02ac4c0ae642b4542dce802908b8" "checksum cexpr 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "42aac45e9567d97474a834efdee3081b3c942b2205be932092f53354ce503d6c" "checksum cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d" -"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" "checksum cgl 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "55e7ec0b74fe5897894cbc207092c577e87c52f8a59e8ca8d97ef37551f60a49" "checksum chashmap 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ff41a3c2c1e39921b9003de14bf0439c7b63a9039637c291e1a64925d8ddfa45" -"checksum chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e8493056968583b0193c1bb04d6f7684586f3726992d6c573261941a895dbd68" +"checksum chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01" "checksum chunked_transfer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "498d20a7aaf62625b9bf26e637cf7736417cde1d0c99f1d04d1170229a85cf87" "checksum clang-sys 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "611ec2e3a7623afd8a8c0d027887b6b55759d894abbf5fe11b9dc11b50d5b49a" "checksum clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)" = "81de550971c976f176130da4b2978d3b524eaa0fd9ac31f3ceb5ae1231fb4853" @@ -4031,18 +3907,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" "checksum criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "938703e165481c8d612ea3479ac8342e5615185db37765162e762ec3523e2fc6" "checksum criterion-plot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eccdc6ce8bbe352ca89025bee672aa6d24f4eb8c53e3a8b5d1bc58011da072a2" -"checksum crossbeam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d7408247b1b87f480890f28b670c5f8d9a8a4274833433fe74dc0dfd46d33650" "checksum crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2d818a4990769aac0c7ff1360e233ef3a41adcb009ebb2036bf6915eb0f6b23c" -"checksum crossbeam-channel 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b85741761b7f160bc5e7e0c14986ef685b7f8bf9b7ad081c60c604bb4649827" "checksum crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa" -"checksum crossbeam-deque 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7792c4a9b5a4222f654e3728a3dd945aacc24d2c3a1a096ed265d80e4929cb9a" "checksum crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3aa945d63861bfe624b55d153a39684da1e8c0bc8fba932f7ee3a3c16cea3ca" -"checksum crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30fecfcac6abfef8771151f8be4abc9e4edc112c2bcb233314cafde2680536e9" -"checksum crossbeam-epoch 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2449aaa4ec7ef96e5fb24db16024b935df718e9ae1cec0a1e68feeca2efca7b8" "checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9" "checksum crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" "checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" -"checksum crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015" +"checksum crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dfd6515864a82d2f877b42813d4553292c6659498c9a2aa31bab5a15243c2700" "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" "checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" "checksum csv 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37519ccdfd73a75821cac9319d4fce15a81b9fcf75f951df5b9988aa3a0af87d" @@ -4080,7 +3951,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" "checksum gdk 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd30051ff3d908ff2fc7e5776ffe1c699821e043809f294c3a61004f11d6c3a9" "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" @@ -4115,7 +3985,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gzip-header 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0131feb3d3bb2a5a238d8a4d09f6353b7ebfdc52e77bccbf4ea6eaa751dde639" "checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" "checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" -"checksum hibitset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6527bc88f32e0d3926c7572874b2bf17a19b36978aacd0aacf75f7d27a5992d0" +"checksum hibitset 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47e7292fd9f7fe89fa35c98048f2d0a69b79ed243604234d18f6f8a1aa6f408d" "checksum hound 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" @@ -4127,7 +3997,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum inotify-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" "checksum instant 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6c346c299e3fe8ef94dc10c2c0253d858a69aac1245157a3bf4125915d528caf" "checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -"checksum itertools 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "87fa75c9dea7b07be3138c49abbb83fd4bea199b5cdc76f9804458edc5da0d6e" +"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" "checksum jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "c1aae18ffeeae409c6622c3b6a7ee49792a7e5a062eea1b135fbb74e301792ba" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" @@ -4141,7 +4011,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" "checksum line_drawing 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" "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 lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" @@ -4154,14 +4023,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a" "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" "checksum memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" -"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" "checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" "checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" "checksum mime_guess 1.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0d977de9ee851a0b16e932979515c0f3da82403183879811bc97d50bd9cc50f7" "checksum minifb 0.13.0 (git+https://github.com/emoon/rust_minifb.git)" = "" "checksum minimp3 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "542e9bed56860c5070a09939eee0e2df6f8f73f60304ddf56d620947e7017239" "checksum minimp3-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c109ae05c00ad6e3a53fab101e2f234545bdd010f0fffd399355efaf70817817" -"checksum mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "83f51996a3ed004ef184e16818edc51fadffe8e7ca68be67f9dee67d84d0ff23" +"checksum mio 0.6.20 (registry+https://github.com/rust-lang/crates.io-index)" = "72f4261ee7ab03cd36dc99eea4db8be6e83e4164da470e0c84f6726d6c605855" "checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" "checksum mopa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a785740271256c230f57462d3b83e52f998433a7062fc18f96d5999474a9f915" @@ -4173,7 +4041,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum noise 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "337525774dd8a197b613a01ea88058ef0ed023e5ed1e4b7e93de478e1f2bf770" "checksum nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" -"checksum nonzero_signed 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "02783a0482333b0d3f5f5411b8fb60454a596696da041da0470ac9ef3e6e37d8" "checksum notify 5.0.0-pre.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d742ae493f34bd2e20ec2f3c1276fc1981343a8efd7ef12bca4368d0303bed50" "checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" "checksum num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cf4825417e1e1406b3782a8ce92f4d53f26ec055e3622e1881ca8e9f5f9e08db" @@ -4184,7 +4051,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "76bd5272412d173d6bf9afdf98db8612bbabc9a7a830b7bfc9c188911716132e" "checksum num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2885278d5fe2adc2f75ced642d52d879bffaceb5a2e0b1d4309ffdfb239b454" "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" -"checksum num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "443c53b3c3531dfcbfa499d8893944db78474ad7a1d87fa2d94d1a2231693ac6" +"checksum num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c81ffc11c212fa327657cb19dd85eb7419e163b5b076bede2bdb5c974c07e4" "checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" "checksum objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" "checksum objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" @@ -4194,14 +4061,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518" "checksum osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" -"checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" "checksum pango 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45374801e224373c3c0393cd48073c81093494c8735721e81d1dbaa4096b2767" "checksum pango-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94039b3921a4af4058a3e4335e5d15099101f298a92f5afc40bab3a3027594a1" "checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" -"checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5" "checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" "checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa" -"checksum parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad7f7e6ebdc79edff6fdcb87a55b620174f7a989e3eb31b65231f4af57f00b8c" "checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" "checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" @@ -4215,7 +4079,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum piston-viewport 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d96dd995f7dabe6d57cda668ec0fda39d6fe6e1e0b23f772582f383f2013611" "checksum pistoncore-input 0.24.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c612ce242c7bac8e96426a0ca34275fd980af440f0cca7c6c0e840ef8a4052f" "checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" -"checksum png 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8422b27bb2c013dd97b9aef69e161ce262236f49aaf46a0489011c8ff0264602" +"checksum png 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f00ec9242f8e01119e83117dbadf34c5228ac2f1c4ddcd92bffa340d52291de" "checksum portpicker 0.1.0 (git+https://github.com/wusyong/portpicker-rs?branch=fix_ipv6)" = "" "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" "checksum pretty_env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "717ee476b1690853d222af4634056d830b5197ffd747726a9a1eee6da9f49074" @@ -4251,8 +4115,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" "checksum rand_xoshiro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0e18c91676f670f6f0312764c759405f13afb98d5d73819840cf72a518487bff" "checksum raw-window-handle 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9db80d08d3ed847ce4fb3def46de0af4bfb6155bd09bd6eaf28b5ac72541c1f1" -"checksum rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "83a27732a533a1be0a0035a111fe76db89ad312f6f0347004c220c57f209a123" -"checksum rayon-core 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "98dcf634205083b17d0861252431eb2acbfb698ab7478a2d20de07954f47ec7b" +"checksum rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "43739f8831493b276363637423d3622d4bd6394ab6f0a9c4a552e208aeb7fddd" +"checksum rayon-core 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8bf17de6f23b05473c437eb958b9c850bfc8af0961fe17b4cc92d5a627b4791" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d" @@ -4272,13 +4136,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rusttype 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" -"checksum rusttype 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6fa38506b5cbf2fb67f915e2725cb5012f1b9a785b0ab55c4733acda5f6554ef" +"checksum rusttype 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "14a911032fb5791ccbeec9f28fdcb9bf0983b81f227bafdfd227c658d0731c8a" "checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" "checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" "checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" "checksum scan_fmt 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "faf737f37ca340201889b5f48ecde47f233e9da3cbf3d04be27883adac39b4da" "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" "checksum sdl2 0.32.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d051a07231e303f5f719da78cb6f7394f6d5b54f733aef5b0b447804a83edd7b" "checksum sdl2-sys 0.32.6 (registry+https://github.com/rust-lang/crates.io-index)" = "34e71125077d297d57e4c1acfe8981b5bdfbf5a20e7b589abfdcb33bf1127f86" @@ -4286,27 +4149,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4b39bd9b0b087684013a792c59e3e07a46a01d2322518d8a1104641a0b1be0" "checksum serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "ca13fc1a832f793322228923fbb3aba9f3f44444898f835d31ad1b74fa0a2bf8" -"checksum serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)" = "2f72eb2a68a7dc3f9a691bfda9305a1c017a6215e5a4545c258500d2099a37c2" +"checksum serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)" = "1a3351dcbc1f067e2c92ab7c3c1f288ad1a4cffc470b5aaddb4c2e0a3ae80043" "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" "checksum shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" "checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" -"checksum shred 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6ea122e6133568144fcfb5888737d4ac776ebc959f989dd65b907136ac22bfed" -"checksum shred-derive 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fcf34e5e5302d3024aba7afc291f6d1ca7573ed035d3c0796976ba3f10691a1" +"checksum shred 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "92472b9bafafbcba21935c6444d924e5332742f6778c49504a49a97eaeff6ccc" +"checksum shred-derive 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c245c03fd923292ae18e01eadf65606fdc995c175433104ef3eee956db7c2d7" "checksum shrev 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b5752e017e03af9d735b4b069f53b7a7fd90fefafa04d8bd0c25581b0bff437f" "checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "checksum slice-deque 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ffddf594f5f597f63533d897427a570dbaa9feabaaa06595b74b71b7014507d7" "checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +"checksum smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86" "checksum smithay-client-toolkit 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2ccb8c57049b2a34d2cc2b203fa785020ba0129d31920ef0d317430adaf748fa" "checksum smithay-client-toolkit 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "93960e8975909fcb14cc755de93af2149d8b8f4eb368315537d40cfd0f324054" -"checksum smithay-clipboard 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "315c3f4417d365483dcbaed9ba6488d9f176e43d83f3e1d581050f1c93869e3d" -"checksum specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)" = "de65613ada4338aa7ba71eca60eca24c60483433eec0077bc4f33cfc31f4bdf0" +"checksum smithay-clipboard 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9667a262ef7a9ff1c55a7e665cd3d36f9bc2809f94167b1fb3fc31423a83f8c0" +"checksum specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4943fde8c5d3d14c3d19d2a4c7abbd7b626c270a19e6cd35252294a48feb698c" "checksum specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git)" = "" -"checksum sphynx 0.1.0 (git+https://gitlab.com/veloren/sphynx.git?rev=ac4adf54d181339a789907acd27f61fe81daa455)" = "" "checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" "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.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "824210d6fb52cbc3ad2545270ead6860c7311aa5450642b078da4515937b6f7a" +"checksum stb_truetype 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" "checksum stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" "checksum sum_type 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "da5b4a0c9f3c7c8e891e445a7c776627e208e8bba23ab680798066dd283e6a15" @@ -4331,12 +4194,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum tiny_http 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1661fa0a44c95d01604bd05c66732a446c657efb62b5164a7a083a3b552b4951" "checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" "checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" -"checksum tuple_utils 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cbfecd7bb8f0a3e96b3b31c46af2677a55a588767c0091f484601424fcb20e7e" +"checksum tuple_utils 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44834418e2c5b16f47bedf35c28e148db099187dd5feee6367fb2525863af4f1" "checksum twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" "checksum ucd-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa9b3b49edd3468c0e6565d85783f51af95212b6fa3986a5500954f00b460874" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -"checksum unicode-normalization 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "09c8070a9942f5e7cfccd93f490fdebd230ee3c3c9f107cb25bad5351ef671cf" +"checksum unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b561e267b2326bb4cebfc0ef9e68355c7abe6c6f522aeac2f5bf95d56c59bdcf" "checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" "checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" @@ -4345,7 +4208,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum utf8-ranges 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b4ae116fef2b7fea257ed6440d3cfcff7f190865f170cdad00bb6465bf18ecba" "checksum uvth 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e59a167890d173eb0fcd7a1b99b84dc05c521ae8d76599130b8e19bef287abbf" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" -"checksum vek 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2bb887880c4eb92359ae9abea055ddf60bfade4603bf9534f3c62c2707cb306b" +"checksum vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "1eb3ca8ea588deba055424cc1a79a830428b2f6c270b8d8f91946f660fa4d8ee" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" diff --git a/client/Cargo.toml b/client/Cargo.toml index 2dcb26563e..4f9509c1ec 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -12,6 +12,6 @@ uvth = "3.1.1" image = "0.22.3" num_cpus = "1.10.1" log = "0.4.8" -specs = "0.14.2" +specs = "0.15.1" vek = { version = "0.9.9", features = ["serde"] } hashbrown = { version = "0.6.2", features = ["serde", "nightly"] } diff --git a/client/src/lib.rs b/client/src/lib.rs index ce8fb7182d..6cb7658c64 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -5,7 +5,7 @@ pub mod error; // Reexports pub use crate::error::Error; -pub use specs::{join::Join, saveload::Marker, Entity as EcsEntity, ReadStorage}; +pub use specs::{join::Join, saveload::Marker, Entity as EcsEntity, ReadStorage, WorldExt}; use common::{ comp::{self, ControlEvent, Controller, ControllerInputs, InventoryManip}, @@ -14,7 +14,8 @@ use common::{ ServerError, ServerInfo, ServerMsg, MAX_BYTES_CHAT_MSG, }, net::PostBox, - state::{State, Uid}, + state::State, + sync::{Uid, WorldSyncExt}, terrain::{block::Block, TerrainChunk, TerrainChunkSize}, vol::RectVolSize, ChatType, @@ -78,9 +79,9 @@ impl Client { // Wait for initial sync let (state, entity, server_info, world_map) = match postbox.next_message() { Some(ServerMsg::InitialSync { - ecs_state, - entity_uid, + entity_package, server_info, + time_of_day, // world_map: /*(map_size, world_map)*/map_size, }) => { // TODO: Voxygen should display this. @@ -94,11 +95,10 @@ impl Client { ); } - let state = State::from_state_package(ecs_state); - let entity = state - .ecs() - .entity_from_uid(entity_uid) - .ok_or(Error::ServerWentMad)?; + // Initialize `State` + let mut state = State::default(); + let entity = state.ecs_mut().apply_entity_package(entity_package); + *state.ecs_mut().write_resource() = time_of_day; // assert_eq!(world_map.len(), map_size.x * map_size.y); let map_size = Vec2::new(1024, 1024); @@ -537,7 +537,7 @@ impl Client { self.last_ping_delta = Instant::now() .duration_since(self.last_server_ping) - .as_secs_f64() + .as_secs_f64(); } ServerMsg::ChatMsg { chat_type, message } => { frontend_events.push(Event::Chat { chat_type, message }) @@ -549,14 +549,25 @@ impl Client { return Err(Error::Other("Failed to find entity from uid.".to_owned())); } } + ServerMsg::TimeOfDay(time_of_day) => { + *self.state.ecs_mut().write_resource() = time_of_day; + } ServerMsg::EcsSync(sync_package) => { - self.state.ecs_mut().sync_with_package(sync_package) + self.state.ecs_mut().apply_sync_package(sync_package); + } + ServerMsg::CreateEntity(entity_package) => { + self.state.ecs_mut().apply_entity_package(entity_package); } ServerMsg::DeleteEntity(entity) => { - if let Some(entity) = self.state.ecs().entity_from_uid(entity) { - if entity != self.entity { - let _ = self.state.ecs_mut().delete_entity(entity); - } + if self + .state + .read_component_cloned::(self.entity) + .map(|u| u.into()) + != Some(entity) + { + self.state + .ecs_mut() + .delete_entity_and_clear_from_uid_allocator(entity); } } ServerMsg::EntityPos { entity, pos } => { diff --git a/common/Cargo.toml b/common/Cargo.toml index 5e4dcbc571..adcdd3f834 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -5,10 +5,9 @@ authors = ["Joshua Barretto ", "Maciej Ćwięka false, } } + // Note: this might need to be refined to something more complex for realistic + // behavior with less cylindrical bodies (e.g. wolfs) + pub fn radius(&self) -> f32 { + // TODO: Improve these values (some might be reliant on more info in inner type) + match self { + Body::Humanoid(_) => 0.5, + Body::QuadrupedSmall(_) => 0.6, + Body::QuadrupedMedium(_) => 0.9, + Body::BirdMedium(_) => 0.5, + Body::FishMedium(_) => 0.5, + Body::Dragon(_) => 2.5, + Body::BirdSmall(_) => 0.2, + Body::FishSmall(_) => 0.2, + Body::BipedLarge(_) => 1.0, + Body::Object(_) => 0.3, + } + } } impl Component for Body { diff --git a/common/src/comp/controller.rs b/common/src/comp/controller.rs index 34ac6859bc..6712d2a85f 100644 --- a/common/src/comp/controller.rs +++ b/common/src/comp/controller.rs @@ -1,6 +1,6 @@ +use crate::sync::Uid; use specs::{Component, FlaggedStorage}; use specs_idvs::IDVStorage; -use sphynx::Uid; use std::time::Duration; use vek::*; diff --git a/common/src/comp/phys.rs b/common/src/comp/phys.rs index 221b178c90..c1c54d80ce 100644 --- a/common/src/comp/phys.rs +++ b/common/src/comp/phys.rs @@ -1,4 +1,4 @@ -use crate::state::Uid; +use crate::sync::Uid; use specs::{Component, FlaggedStorage, NullStorage}; use specs_idvs::IDVStorage; use vek::*; diff --git a/common/src/comp/projectile.rs b/common/src/comp/projectile.rs index a235172488..785c1e318d 100644 --- a/common/src/comp/projectile.rs +++ b/common/src/comp/projectile.rs @@ -1,5 +1,4 @@ -use crate::comp; -use crate::state::Uid; +use crate::{comp, sync::Uid}; use specs::{Component, FlaggedStorage}; use specs_idvs::IDVStorage; use std::time::Duration; @@ -15,6 +14,7 @@ pub enum Effect { #[derive(Clone, Debug, Serialize, Deserialize)] pub struct Projectile { pub owner: Uid, + // TODO: use SmallVec for these effects pub hit_ground: Vec, pub hit_wall: Vec, pub hit_entity: Vec, diff --git a/common/src/comp/stats.rs b/common/src/comp/stats.rs index b8137d0cf1..e4eceeaaa1 100644 --- a/common/src/comp/stats.rs +++ b/common/src/comp/stats.rs @@ -1,4 +1,4 @@ -use crate::{comp, state::Uid}; +use crate::{comp, sync::Uid}; use specs::{Component, FlaggedStorage}; use specs_idvs::IDVStorage; diff --git a/common/src/event.rs b/common/src/event.rs index 5cd5cb1c27..ecdc180fe0 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -1,9 +1,8 @@ -use crate::comp; +use crate::{comp, sync::Uid}; use comp::item::Tool; use parking_lot::Mutex; use serde::Deserialize; use specs::Entity as EcsEntity; -use sphynx::Uid; use std::{collections::VecDeque, ops::DerefMut}; use vek::*; diff --git a/common/src/lib.rs b/common/src/lib.rs index eab693848d..2550d7db7e 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -20,6 +20,7 @@ pub mod pathfinding; pub mod ray; pub mod region; pub mod state; +pub mod sync; pub mod sys; pub mod terrain; pub mod util; diff --git a/common/src/msg/ecs_packet.rs b/common/src/msg/ecs_packet.rs index 70f24e228c..e714416ff9 100644 --- a/common/src/msg/ecs_packet.rs +++ b/common/src/msg/ecs_packet.rs @@ -1,25 +1,13 @@ -use crate::{comp, state}; +use crate::{comp, sync}; use serde_derive::{Deserialize, Serialize}; use std::marker::PhantomData; +use sum_type::sum_type; -// Automatically derive From for EcsResPacket -// for each variant EcsResPacket::T(T). -sphynx::sum_type! { - #[derive(Clone, Debug, Serialize, Deserialize)] - pub enum EcsResPacket { - Time(state::Time), - TimeOfDay(state::TimeOfDay), - } -} -impl sphynx::ResPacket for EcsResPacket {} // Automatically derive From for EcsCompPacket // for each variant EcsCompPacket::T(T.) -sphynx::sum_type! { +sum_type! { #[derive(Clone, Debug, Serialize, Deserialize)] pub enum EcsCompPacket { - Pos(comp::Pos), - Vel(comp::Vel), - Ori(comp::Ori), Body(comp::Body), Player(comp::Player), CanBuild(comp::CanBuild), @@ -30,19 +18,15 @@ sphynx::sum_type! { MountState(comp::MountState), Mounting(comp::Mounting), Mass(comp::Mass), - Projectile(comp::Projectile), Gravity(comp::Gravity), Sticky(comp::Sticky), } } // Automatically derive From for EcsCompPhantom // for each variant EcsCompPhantom::T(PhantomData). -sphynx::sum_type! { +sum_type! { #[derive(Clone, Debug, Serialize, Deserialize)] pub enum EcsCompPhantom { - Pos(PhantomData), - Vel(PhantomData), - Ori(PhantomData), Body(PhantomData), Player(PhantomData), CanBuild(PhantomData), @@ -53,11 +37,60 @@ sphynx::sum_type! { MountState(PhantomData), Mounting(PhantomData), Mass(PhantomData), - Projectile(PhantomData), Gravity(PhantomData), Sticky(PhantomData), } } -impl sphynx::CompPacket for EcsCompPacket { +impl sync::CompPacket for EcsCompPacket { type Phantom = EcsCompPhantom; + fn apply_insert(self, entity: specs::Entity, world: &specs::World) { + match self { + EcsCompPacket::Body(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::Player(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::CanBuild(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::Stats(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::LightEmitter(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::Item(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::Scale(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::MountState(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::Mounting(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::Mass(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::Gravity(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::Sticky(comp) => sync::handle_insert(comp, entity, world), + } + } + fn apply_modify(self, entity: specs::Entity, world: &specs::World) { + match self { + EcsCompPacket::Body(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::Player(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::CanBuild(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::Stats(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::LightEmitter(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::Item(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::Scale(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::MountState(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::Mounting(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::Mass(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::Gravity(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::Sticky(comp) => sync::handle_modify(comp, entity, world), + } + } + fn apply_remove(phantom: Self::Phantom, entity: specs::Entity, world: &specs::World) { + match phantom { + EcsCompPhantom::Body(_) => sync::handle_remove::(entity, world), + EcsCompPhantom::Player(_) => sync::handle_remove::(entity, world), + EcsCompPhantom::CanBuild(_) => sync::handle_remove::(entity, world), + EcsCompPhantom::Stats(_) => sync::handle_remove::(entity, world), + EcsCompPhantom::LightEmitter(_) => { + sync::handle_remove::(entity, world) + } + EcsCompPhantom::Item(_) => sync::handle_remove::(entity, world), + EcsCompPhantom::Scale(_) => sync::handle_remove::(entity, world), + EcsCompPhantom::MountState(_) => sync::handle_remove::(entity, world), + EcsCompPhantom::Mounting(_) => sync::handle_remove::(entity, world), + EcsCompPhantom::Mass(_) => sync::handle_remove::(entity, world), + EcsCompPhantom::Gravity(_) => sync::handle_remove::(entity, world), + EcsCompPhantom::Sticky(_) => sync::handle_remove::(entity, world), + } + } } diff --git a/common/src/msg/mod.rs b/common/src/msg/mod.rs index 09bdae25bb..12f72addf5 100644 --- a/common/src/msg/mod.rs +++ b/common/src/msg/mod.rs @@ -4,7 +4,7 @@ pub mod server; // Reexports pub use self::client::ClientMsg; -pub use self::ecs_packet::{EcsCompPacket, EcsResPacket}; +pub use self::ecs_packet::EcsCompPacket; pub use self::server::{RequestStateError, ServerError, ServerInfo, ServerMsg}; #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)] diff --git a/common/src/msg/server.rs b/common/src/msg/server.rs index cbf1d9ac8a..7b922527d4 100644 --- a/common/src/msg/server.rs +++ b/common/src/msg/server.rs @@ -1,6 +1,6 @@ -use super::{ClientState, EcsCompPacket, EcsResPacket}; +use super::{ClientState, EcsCompPacket}; use crate::{ - comp, + comp, state, sync, terrain::{Block, TerrainChunk}, ChatType, }; @@ -26,9 +26,9 @@ pub struct ServerInfo { #[derive(Debug, Clone, Serialize, Deserialize)] pub enum ServerMsg { InitialSync { - ecs_state: sphynx::StatePackage, - entity_uid: u64, + entity_package: sync::EntityPackage, server_info: ServerInfo, + time_of_day: state::TimeOfDay, // world_map: Vec2, /*, Vec)*/ }, StateAnswer(Result), @@ -40,7 +40,9 @@ pub enum ServerMsg { message: String, }, SetPlayerEntity(u64), - EcsSync(sphynx::SyncPackage), + TimeOfDay(state::TimeOfDay), + EcsSync(sync::SyncPackage), + CreateEntity(sync::EntityPackage), DeleteEntity(u64), EntityPos { entity: u64, diff --git a/common/src/region.rs b/common/src/region.rs index de8e5a526d..2725f6fb47 100644 --- a/common/src/region.rs +++ b/common/src/region.rs @@ -1,8 +1,7 @@ use crate::comp::{Pos, Vel}; use hashbrown::{hash_map::DefaultHashBuilder, HashSet}; -use hibitset::BitSetLike; use indexmap::IndexMap; -use specs::{BitSet, Entities, Join, ReadStorage}; +use specs::{hibitset::BitSetLike, BitSet, Entities, Join, ReadStorage}; use vek::*; pub enum Event { @@ -104,6 +103,16 @@ impl RegionMap { // TODO special case large entities pub fn tick(&mut self, pos: ReadStorage, vel: ReadStorage, entities: Entities) { self.tick += 1; + // Clear events within each region + for i in 0..self.regions.len() { + self.regions + .get_index_mut(i) + .map(|(_, v)| v) + .unwrap() + .events + .clear(); + } + // Add any untracked entites for (pos, id) in (&pos, &entities, !&self.tracked_entities) .join() @@ -118,14 +127,6 @@ impl RegionMap { let mut regions_to_remove = Vec::new(); for i in 0..self.regions.len() { - // Clear events within each region - self.regions - .get_index_mut(i) - .map(|(_, v)| v) - .unwrap() - .events - .clear(); - for (maybe_pos, _maybe_vel, id) in ( pos.maybe(), vel.maybe(), @@ -215,6 +216,47 @@ impl RegionMap { pub fn key_pos(key: Vec2) -> Vec2 { key.map(|e| e << REGION_LOG2) } + /// Finds the region where a given entity is located using a given position to speed up the search + pub fn find_region(&self, entity: specs::Entity, pos: Vec3) -> Option> { + let id = entity.id(); + // Compute key for most likely region + let key = Self::pos_key(pos.map(|e| e as i32)); + // Get region + if let Some(region) = self.regions.get(&key) { + if region.entities().contains(id) { + return Some(key); + } else { + // Check neighbors + for i in 0..8 { + if let Some(idx) = region.neighbors[i] { + let (key, region) = self.regions.get_index(idx).unwrap(); + if region.entities().contains(id) { + return Some(*key); + } + } + } + } + } else { + // Check neighbors + for i in 0..8 { + let key = key + NEIGHBOR_OFFSETS[i]; + if let Some(region) = self.regions.get(&key) { + if region.entities().contains(id) { + return Some(key); + } + } + } + } + + // Scan though all regions + for (key, region) in self.iter() { + if region.entities().contains(id) { + return Some(key); + } + } + + None + } fn key_index(&self, key: Vec2) -> Option { self.regions.get_full(&key).map(|(i, _, _)| i) } diff --git a/common/src/state.rs b/common/src/state.rs index 9a3b5cd9ee..5e19b25c43 100644 --- a/common/src/state.rs +++ b/common/src/state.rs @@ -1,11 +1,8 @@ -// Reexports -pub use sphynx::Uid; - use crate::{ comp, event::{EventBus, LocalEvent, ServerEvent, SfxEventItem}, - msg::{EcsCompPacket, EcsResPacket}, region::RegionMap, + sync::WorldSyncExt, sys, terrain::{Block, TerrainChunk, TerrainGrid}, vol::WriteVol, @@ -14,12 +11,10 @@ use hashbrown::{HashMap, HashSet}; use rayon::{ThreadPool, ThreadPoolBuilder}; use serde_derive::{Deserialize, Serialize}; use specs::{ - saveload::Marker, shred::{Fetch, FetchMut}, storage::{MaskedStorage as EcsMaskedStorage, Storage as EcsStorage}, - Component, DispatcherBuilder, Entity as EcsEntity, Join, + Component, DispatcherBuilder, Entity as EcsEntity, WorldExt, }; -use sphynx; use std::{sync::Arc, time::Duration}; use vek::*; @@ -28,7 +23,7 @@ use vek::*; const DAY_CYCLE_FACTOR: f64 = 24.0 * 2.0; /// A resource that stores the time of day. -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Copy, Clone, Debug, Serialize, Deserialize)] pub struct TimeOfDay(pub f64); /// A resource that stores the tick (i.e: physics) time. @@ -89,7 +84,7 @@ impl TerrainChanges { /// A type used to represent game state stored on both the client and the server. This includes /// things like entity components, terrain data, and global states like weather, time of day, etc. pub struct State { - ecs: sphynx::World, + ecs: specs::World, // Avoid lifetime annotation by storing a thread pool instead of the whole dispatcher thread_pool: Arc, } @@ -98,44 +93,32 @@ impl Default for State { /// Create a new `State`. fn default() -> Self { Self { - ecs: sphynx::World::new(specs::World::new(), Self::setup_sphynx_world), + ecs: Self::setup_ecs_world(), thread_pool: Arc::new(ThreadPoolBuilder::new().build().unwrap()), } } } impl State { - /// Create a new `State` from an ECS state package. - pub fn from_state_package( - state_package: sphynx::StatePackage, - ) -> Self { - Self { - ecs: sphynx::World::from_state_package( - specs::World::new(), - Self::setup_sphynx_world, - state_package, - ), - thread_pool: Arc::new(ThreadPoolBuilder::new().build().unwrap()), - } - } - - // Create a new Sphynx ECS world. + /// Creates ecs world and registers all the common components and resources // TODO: Split up registering into server and client (e.g. move EventBus to the server) - fn setup_sphynx_world(ecs: &mut sphynx::World) { + fn setup_ecs_world() -> specs::World { + let mut ecs = specs::World::new(); + // Uids for sync + ecs.register_sync_marker(); // Register server -> all clients synced components. - ecs.register_synced::(); - ecs.register_synced::(); - ecs.register_synced::(); - ecs.register_synced::(); - ecs.register_synced::(); - ecs.register_synced::(); - ecs.register_synced::(); - ecs.register_synced::(); - ecs.register_synced::(); - ecs.register_synced::(); - ecs.register_synced::(); - ecs.register_synced::(); - ecs.register_synced::(); + ecs.register::(); + ecs.register::(); + ecs.register::(); + ecs.register::(); + ecs.register::(); + ecs.register::(); + ecs.register::(); + ecs.register::(); + ecs.register::(); + ecs.register::(); + ecs.register::(); + ecs.register::(); // Register components send from clients -> server ecs.register::(); @@ -151,6 +134,7 @@ impl State { ecs.register::(); // Register server-local components + // TODO: only register on the server ecs.register::>(); ecs.register::>(); ecs.register::>(); @@ -158,23 +142,26 @@ impl State { ecs.register::(); ecs.register::(); ecs.register::(); - ecs.register::(); ecs.register::(); ecs.register::(); + ecs.register::(); // Register synced resources used by the ECS. - ecs.insert_synced(TimeOfDay(0.0)); + ecs.insert(TimeOfDay(0.0)); // Register unsynced resources used by the ECS. - ecs.add_resource(Time(0.0)); - ecs.add_resource(DeltaTime(0.0)); - ecs.add_resource(TerrainGrid::new().unwrap()); - ecs.add_resource(BlockChange::default()); - ecs.add_resource(TerrainChanges::default()); - ecs.add_resource(EventBus::::default()); - ecs.add_resource(EventBus::::default()); - ecs.add_resource(EventBus::::default()); - ecs.add_resource(RegionMap::new()); + ecs.insert(Time(0.0)); + ecs.insert(DeltaTime(0.0)); + ecs.insert(TerrainGrid::new().unwrap()); + ecs.insert(BlockChange::default()); + ecs.insert(TerrainChanges::default()); + // TODO: only register on the server + ecs.insert(EventBus::::default()); + ecs.insert(EventBus::::default()); + ecs.insert(EventBus::::default()); + ecs.insert(RegionMap::new()); + + ecs } /// Register a component with the state's ECS. @@ -207,12 +194,12 @@ impl State { } /// Get a reference to the internal ECS world. - pub fn ecs(&self) -> &sphynx::World { + pub fn ecs(&self) -> &specs::World { &self.ecs } /// Get a mutable reference to the internal ECS world. - pub fn ecs_mut(&mut self) -> &mut sphynx::World { + pub fn ecs_mut(&mut self) -> &mut specs::World { &mut self.ecs } @@ -319,68 +306,6 @@ impl State { // Beyond a delta time of MAX_DELTA_TIME, start lagging to avoid skipping important physics events. self.ecs.write_resource::().0 = dt.as_secs_f32().min(MAX_DELTA_TIME); - // Mounted entities. We handle this here because we need access to the Uid registry and I - // forgot how to access that within a system. Anyhow, here goes. - for (entity, mount_state) in ( - &self.ecs.entities(), - &mut self.ecs.write_storage::(), - ) - .join() - { - match mount_state { - comp::MountState::Unmounted => {} - comp::MountState::MountedBy(mounter) => { - if let Some((controller, mounter)) = - self.ecs.entity_from_uid(mounter.id()).and_then(|mounter| { - self.ecs - .read_storage::() - .get(mounter) - .cloned() - .map(|x| (x, mounter)) - }) - { - let pos = self.ecs.read_storage::().get(entity).copied(); - let ori = self.ecs.read_storage::().get(entity).copied(); - let vel = self.ecs.read_storage::().get(entity).copied(); - if let (Some(pos), Some(ori), Some(vel)) = (pos, ori, vel) { - let _ = self - .ecs - .write_storage() - .insert(mounter, comp::Pos(pos.0 + Vec3::unit_z() * 1.0)); - let _ = self.ecs.write_storage().insert(mounter, ori); - let _ = self.ecs.write_storage().insert(mounter, vel); - } - let _ = self - .ecs - .write_storage::() - .insert(entity, controller); - } else { - *mount_state = comp::MountState::Unmounted; - } - } - } - } - - let mut to_unmount = Vec::new(); - for (entity, comp::Mounting(mountee)) in ( - &self.ecs.entities(), - &self.ecs.read_storage::(), - ) - .join() - { - if self - .ecs - .entity_from_uid(mountee.id()) - .filter(|mountee| self.ecs.is_alive(*mountee)) - .is_none() - { - to_unmount.push(entity); - } - } - for entity in to_unmount { - self.ecs.write_storage::().remove(entity); - } - // Run RegionMap tick to update entity region occupancy self.ecs.write_resource::().tick( self.ecs.read_storage::(), @@ -395,7 +320,7 @@ impl State { // TODO: Consider alternative ways to do this add_foreign_systems(&mut dispatch_builder); // This dispatches all the systems in parallel. - dispatch_builder.build().dispatch(&self.ecs.res); + dispatch_builder.build().dispatch(&self.ecs); self.ecs.maintain(); diff --git a/common/src/sync/mod.rs b/common/src/sync/mod.rs new file mode 100644 index 0000000000..7a5cae6d18 --- /dev/null +++ b/common/src/sync/mod.rs @@ -0,0 +1,14 @@ +// Note: Currently only one-way sync is supported until a usecase for two-way sync arises +mod packet; +mod sync_ext; +mod track; +mod uid; + +// Reexports +pub use packet::{ + handle_insert, handle_modify, handle_remove, CompPacket, EntityPackage, StatePackage, + SyncPackage, +}; +pub use sync_ext::WorldSyncExt; +pub use track::UpdateTracker; +pub use uid::{Uid, UidAllocator}; diff --git a/common/src/sync/packet.rs b/common/src/sync/packet.rs new file mode 100644 index 0000000000..a9d3363eeb --- /dev/null +++ b/common/src/sync/packet.rs @@ -0,0 +1,125 @@ +use super::{track::UpdateTracker, uid::Uid}; +use log::error; +use serde::{de::DeserializeOwned, Deserialize, Serialize}; +use specs::{Component, Entity, Join, ReadStorage, World, WorldExt}; +use std::{ + convert::{TryFrom, TryInto}, + fmt::Debug, + marker::PhantomData, +}; + +/// Implemented by type that carries component data for insertion and modification +/// The assocatied `Phantom` type only carries information about which component type is of +/// interest and is used to transmit deletion events +pub trait CompPacket: Clone + Debug + Send + 'static { + type Phantom: Clone + Debug + Serialize + DeserializeOwned; + + fn apply_insert(self, entity: Entity, world: &World); + fn apply_modify(self, entity: Entity, world: &World); + fn apply_remove(phantom: Self::Phantom, entity: Entity, world: &World); +} + +/// Useful for implementing CompPacket trait +pub fn handle_insert(comp: C, entity: Entity, world: &World) { + if let Err(err) = world.write_storage::().insert(entity, comp) { + error!("Error inserting component: {:?}", err); + }; +} +/// Useful for implementing CompPacket trait +pub fn handle_modify(comp: C, entity: Entity, world: &World) { + let _ = world + .write_storage::() + .get_mut(entity) + .map(|c| *c = comp); +} +/// Useful for implementing CompPacket trait +pub fn handle_remove(entity: Entity, world: &World) { + let _ = world.write_storage::().remove(entity); +} + +#[derive(Copy, Clone, Debug, Serialize, Deserialize)] +pub enum CompUpdateKind { + Inserted(P), + Modified(P), + Removed(P::Phantom), +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct EntityPackage { + pub uid: u64, + pub comps: Vec

, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct StatePackage { + pub entities: Vec>, +} + +impl Default for StatePackage

{ + fn default() -> Self { + Self { + entities: Vec::new(), + } + } +} + +impl StatePackage

{ + pub fn new() -> Self { + Self::default() + } + pub fn with_entities( + mut self, + mut entities: Vec>, + ) -> Self { + self.entities.append(&mut entities); + self + } + pub fn with_entity(mut self, entry: EntityPackage

) -> Self { + self.entities.push(entry); + self + } +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct SyncPackage { + pub comp_updates: Vec<(u64, CompUpdateKind

)>, + pub created_entities: Vec, + pub deleted_entities: Vec, +} +impl SyncPackage

{ + pub fn new<'a>( + uids: &ReadStorage<'a, Uid>, + uid_tracker: &UpdateTracker, + filter: impl Join + Copy, + deleted_entities: Vec, + ) -> Self { + // Add created and deleted entities + let created_entities = (uids, filter, uid_tracker.inserted()) + .join() + .map(|(uid, _, _)| (*uid).into()) + .collect(); + + Self { + comp_updates: Vec::new(), + created_entities, + deleted_entities, + } + } + pub fn with_component<'a, C: Component + Clone + Send + Sync>( + mut self, + uids: &ReadStorage<'a, Uid>, + tracker: &UpdateTracker, + storage: &ReadStorage<'a, C>, + filter: impl Join + Copy, + ) -> Self + where + P: From, + C: TryFrom

, + P::Phantom: From>, + P::Phantom: TryInto>, + C::Storage: specs::storage::Tracked, + { + tracker.get_updates_for(uids, storage, filter, &mut self.comp_updates); + self + } +} diff --git a/common/src/sync/sync_ext.rs b/common/src/sync/sync_ext.rs new file mode 100644 index 0000000000..b567b6f8d2 --- /dev/null +++ b/common/src/sync/sync_ext.rs @@ -0,0 +1,164 @@ +use super::{ + packet::{CompPacket, CompUpdateKind, EntityPackage, StatePackage, SyncPackage}, + track::UpdateTracker, + uid::{Uid, UidAllocator}, +}; +use log::error; +use specs::{ + saveload::{MarkedBuilder, MarkerAllocator}, + world::Builder, + WorldExt, +}; + +pub trait WorldSyncExt { + fn register_sync_marker(&mut self); + fn register_synced(&mut self) + where + C::Storage: Default + specs::storage::Tracked; + fn register_tracker(&mut self) + where + C::Storage: Default + specs::storage::Tracked; + fn create_entity_synced(&mut self) -> specs::EntityBuilder; + fn delete_entity_and_clear_from_uid_allocator(&mut self, uid: u64); + fn uid_from_entity(&self, entity: specs::Entity) -> Option; + fn entity_from_uid(&self, uid: u64) -> Option; + fn apply_entity_package( + &mut self, + entity_package: EntityPackage

, + ) -> specs::Entity; + fn apply_state_package(&mut self, state_package: StatePackage

); + fn apply_sync_package(&mut self, package: SyncPackage

); +} + +impl WorldSyncExt for specs::World { + fn register_sync_marker(&mut self) { + self.register_synced::(); + + // TODO: Consider only having allocator server side for now + self.insert(UidAllocator::new()); + } + fn register_synced(&mut self) + where + C::Storage: Default + specs::storage::Tracked, + { + self.register::(); + self.register_tracker::(); + } + fn register_tracker(&mut self) + where + C::Storage: Default + specs::storage::Tracked, + { + let tracker = UpdateTracker::::new(self); + self.insert(tracker); + } + + fn create_entity_synced(&mut self) -> specs::EntityBuilder { + self.create_entity().marked::() + } + + /// Get the UID of an entity + fn uid_from_entity(&self, entity: specs::Entity) -> Option { + self.read_storage::().get(entity).copied() + } + + /// Get the UID of an entity + fn entity_from_uid(&self, uid: u64) -> Option { + self.read_resource::() + .retrieve_entity_internal(uid) + } + + fn apply_entity_package( + &mut self, + entity_package: EntityPackage

, + ) -> specs::Entity { + let EntityPackage { uid, comps } = entity_package; + + let entity = create_entity_with_uid(self, uid); + for packet in comps { + packet.apply_insert(entity, self) + } + + entity + } + + fn delete_entity_and_clear_from_uid_allocator(&mut self, uid: u64) { + // Clear from uid allocator + let maybe_entity = self.write_resource::().remove_entity(uid); + if let Some(entity) = maybe_entity { + if let Err(err) = self.delete_entity(entity) { + error!("Failed to delete entity: {:?}", err); + } + } + } + + fn apply_state_package(&mut self, state_package: StatePackage

) { + let StatePackage { entities } = state_package; + + // Apply state package entities + for entity_package in entities { + self.apply_entity_package(entity_package); + } + + // TODO: determine if this is needed + // Initialize entities + //self.maintain(); + } + + fn apply_sync_package(&mut self, package: SyncPackage

) { + // Take ownership of the fields + let SyncPackage { + comp_updates, + created_entities, + deleted_entities, + } = package; + + // Attempt to create entities + for entity_uid in created_entities { + create_entity_with_uid(self, entity_uid); + } + + // Update components + for (entity_uid, update) in comp_updates { + if let Some(entity) = self + .read_resource::() + .retrieve_entity_internal(entity_uid) + { + match update { + CompUpdateKind::Inserted(packet) => { + packet.apply_insert(entity, self); + } + CompUpdateKind::Modified(packet) => { + packet.apply_modify(entity, self); + } + CompUpdateKind::Removed(phantom) => { + P::apply_remove(phantom, entity, self); + } + } + } + } + + // Attempt to delete entities that were marked for deletion + for entity_uid in deleted_entities { + self.delete_entity_and_clear_from_uid_allocator(entity_uid); + } + } +} + +// Private utilities +fn create_entity_with_uid(specs_world: &mut specs::World, entity_uid: u64) -> specs::Entity { + let existing_entity = specs_world + .read_resource::() + .retrieve_entity_internal(entity_uid); + + match existing_entity { + Some(entity) => entity, + None => { + let entity_builder = specs_world.create_entity(); + let uid = entity_builder + .world + .write_resource::() + .allocate(entity_builder.entity, Some(entity_uid)); + entity_builder.with(uid).build() + } + } +} diff --git a/common/src/sync/track.rs b/common/src/sync/track.rs new file mode 100644 index 0000000000..3cccda6794 --- /dev/null +++ b/common/src/sync/track.rs @@ -0,0 +1,128 @@ +use super::{ + packet::{CompPacket, CompUpdateKind}, + uid::Uid, +}; +use specs::{BitSet, Component, Entity, Join, ReadStorage, World, WorldExt}; +use std::{ + convert::{TryFrom, TryInto}, + marker::PhantomData, +}; + +pub struct UpdateTracker { + reader_id: specs::ReaderId, + inserted: BitSet, + modified: BitSet, + removed: BitSet, + phantom: PhantomData, +} +impl UpdateTracker +where + C::Storage: specs::storage::Tracked, +{ + pub fn new(specs_world: &mut World) -> Self { + Self { + reader_id: specs_world.write_storage::().register_reader(), + inserted: BitSet::new(), + modified: BitSet::new(), + removed: BitSet::new(), + phantom: PhantomData, + } + } + pub fn inserted(&self) -> &BitSet { + &self.inserted + } + pub fn modified(&self) -> &BitSet { + &self.modified + } + pub fn removed(&self) -> &BitSet { + &self.removed + } + pub fn record_changes<'a>(&mut self, storage: &specs::ReadStorage<'a, C>) { + self.inserted.clear(); + self.modified.clear(); + self.removed.clear(); + + for event in storage.channel().read(&mut self.reader_id) { + match event { + specs::storage::ComponentEvent::Inserted(id) => { + // If previously removed/modified we don't need to know that anymore + self.removed.remove(*id); + self.modified.remove(*id); + self.inserted.add(*id); + } + specs::storage::ComponentEvent::Modified(id) => { + // We don't care about modification if the component was just added + if !self.inserted.contains(*id) { + debug_assert!(!self.removed.contains(*id)); // Theoretically impossible + self.modified.add(*id); + } + } + specs::storage::ComponentEvent::Removed(id) => { + // Don't need to know that it was inserted/modified if it was subsequently removed + self.inserted.remove(*id); + self.modified.remove(*id); + self.removed.add(*id); + } + }; + } + } +} + +impl UpdateTracker { + pub fn add_packet_for<'a, P>( + &self, + storage: &ReadStorage<'a, C>, + entity: Entity, + packets: &mut Vec

, + ) where + P: CompPacket, + P: From, + C: TryFrom

, + P::Phantom: From>, + P::Phantom: TryInto>, + C::Storage: specs::storage::Tracked, + { + if let Some(comp) = storage.get(entity) { + packets.push(P::from(comp.clone())); + } + } + + pub fn get_updates_for<'a, P>( + &self, + uids: &specs::ReadStorage<'a, Uid>, + storage: &specs::ReadStorage<'a, C>, + entity_filter: impl Join + Copy, + buf: &mut Vec<(u64, CompUpdateKind

)>, + ) where + P: CompPacket, + P: From, + C: TryFrom

, + P::Phantom: From>, + P::Phantom: TryInto>, + C::Storage: specs::storage::Tracked, + { + // Generate inserted updates + for (uid, comp, _, _) in (uids, storage, &self.inserted, entity_filter).join() { + buf.push(( + (*uid).into(), + CompUpdateKind::Inserted(P::from(comp.clone())), + )); + } + + // Generate modified updates + for (uid, comp, _, _) in (uids, storage, &self.modified, entity_filter).join() { + buf.push(( + (*uid).into(), + CompUpdateKind::Modified(P::from(comp.clone())), + )); + } + + // Generate removed updates + for (uid, _, _) in (uids, &self.removed, entity_filter).join() { + buf.push(( + (*uid).into(), + CompUpdateKind::Removed(P::Phantom::from(PhantomData::)), + )); + } + } +} diff --git a/common/src/sync/uid.rs b/common/src/sync/uid.rs new file mode 100644 index 0000000000..87f69e87ed --- /dev/null +++ b/common/src/sync/uid.rs @@ -0,0 +1,92 @@ +use serde_derive::{Deserialize, Serialize}; +use specs::{ + saveload::{Marker, MarkerAllocator}, + world::EntitiesRes, + Component, Entity, FlaggedStorage, Join, ReadStorage, VecStorage, +}; +use std::{collections::HashMap, fmt, u64}; + +#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] +pub struct Uid(pub u64); + +impl Into for Uid { + fn into(self) -> u64 { + self.0 + } +} + +impl From for Uid { + fn from(uid: u64) -> Self { + Self(uid) + } +} + +impl fmt::Display for Uid { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", self.0) + } +} + +impl Component for Uid { + type Storage = FlaggedStorage>; +} + +impl Marker for Uid { + type Identifier = u64; + type Allocator = UidAllocator; + + fn id(&self) -> u64 { + self.0 + } + + fn update(&mut self, update: Self) { + assert_eq!(self.0, update.0); + } +} + +pub struct UidAllocator { + index: u64, + mapping: HashMap, +} + +impl UidAllocator { + pub fn new() -> Self { + Self { + index: 0, + mapping: HashMap::new(), + } + } + // Useful for when a single entity is deleted because it doesn't reconstruct the entire hashmap + pub fn remove_entity(&mut self, id: u64) -> Option { + self.mapping.remove(&id) + } +} + +impl Default for UidAllocator { + fn default() -> Self { + Self::new() + } +} + +impl MarkerAllocator for UidAllocator { + fn allocate(&mut self, entity: Entity, id: Option) -> Uid { + let id = id.unwrap_or_else(|| { + let id = self.index; + self.index += 1; + id + }); + self.mapping.insert(id, entity); + Uid(id) + } + + fn retrieve_entity_internal(&self, id: u64) -> Option { + self.mapping.get(&id).copied() + } + + fn maintain(&mut self, entities: &EntitiesRes, storage: &ReadStorage) { + self.mapping = (entities, storage) + .join() + .map(|(e, m)| (m.id(), e)) + .collect(); + } +} diff --git a/common/src/sys/agent.rs b/common/src/sys/agent.rs index c2bcbe1c2a..5ce18dacab 100644 --- a/common/src/sys/agent.rs +++ b/common/src/sys/agent.rs @@ -1,6 +1,5 @@ use crate::comp::{ - Agent, CharacterState, Controller, ControllerInputs, MountState, MovementState::Glide, Pos, - Stats, + Agent, CharacterState, Controller, MountState, MovementState::Glide, Pos, Stats, }; use crate::pathfinding::WorldPath; use crate::terrain::TerrainGrid; @@ -60,7 +59,7 @@ impl<'a> System<'a> for Sys { controller.reset(); - let mut inputs = ControllerInputs::default(); + let mut inputs = &mut controller.inputs; match agent { Agent::Traveler { path } => { @@ -147,10 +146,13 @@ impl<'a> System<'a> for Sys { let dist = Vec2::::from(target_pos.0 - pos.0).magnitude(); if target_stats.is_dead { choose_new = true; - } else if dist < MIN_ATTACK_DIST - && dist > 0.001 - && rand::random::() < 0.3 - { + } else if dist < 0.001 { + // Probably can only happen when entities are at a different z-level + // since at the same level repulsion would keep them apart. + // Distinct from the first if block since we may want to change the + // behavior for this case. + choose_new = true; + } else if dist < MIN_ATTACK_DIST { // Fight (and slowly move closer) inputs.move_dir = Vec2::::from(target_pos.0 - pos.0).normalized() * 0.01; @@ -203,7 +205,8 @@ impl<'a> System<'a> for Sys { } } - controller.inputs = inputs; + debug_assert!(inputs.move_dir.map(|e| !e.is_nan()).reduce_and()); + debug_assert!(inputs.look_dir.map(|e| !e.is_nan()).reduce_and()); } } } diff --git a/common/src/sys/combat.rs b/common/src/sys/combat.rs index 6a23de568f..78cba752c0 100644 --- a/common/src/sys/combat.rs +++ b/common/src/sys/combat.rs @@ -1,10 +1,11 @@ use crate::{ comp::{ - ActionState::*, CharacterState, Controller, HealthChange, HealthSource, Item, ItemKind, - Ori, Pos, Stats, + ActionState::*, Body, CharacterState, Controller, HealthChange, HealthSource, Item, + ItemKind, Ori, Pos, Scale, Stats, }, event::{EventBus, LocalEvent, ServerEvent}, - state::{DeltaTime, Uid}, + state::DeltaTime, + sync::Uid, }; use specs::{Entities, Join, Read, ReadStorage, System, WriteStorage}; use std::time::Duration; @@ -12,7 +13,8 @@ use vek::*; const BLOCK_EFFICIENCY: f32 = 0.9; -const ATTACK_RANGE: f32 = 4.0; +const ATTACK_RANGE: f32 = 3.5; +const ATTACK_ANGLE: f32 = 45.0; const BLOCK_ANGLE: f32 = 180.0; /// This system is responsible for handling accepted inputs like moving or attacking @@ -26,9 +28,11 @@ impl<'a> System<'a> for Sys { ReadStorage<'a, Uid>, ReadStorage<'a, Pos>, ReadStorage<'a, Ori>, + ReadStorage<'a, Scale>, ReadStorage<'a, Controller>, + ReadStorage<'a, Body>, + ReadStorage<'a, Stats>, WriteStorage<'a, CharacterState>, - WriteStorage<'a, Stats>, ); fn run( @@ -41,20 +45,23 @@ impl<'a> System<'a> for Sys { uids, positions, orientations, + scales, controllers, - mut character_states, + bodies, stats, + mut character_states, ): Self::SystemData, ) { let mut server_emitter = server_bus.emitter(); let mut _local_emitter = local_bus.emitter(); // Attacks - for (entity, uid, pos, ori, _, stat) in ( + for (entity, uid, pos, ori, scale_maybe, _, attacker_stats) in ( &entities, &uids, &positions, &orientations, + scales.maybe(), &controllers, &stats, ) @@ -63,7 +70,7 @@ impl<'a> System<'a> for Sys { let recover_duration = if let Some(Item { kind: ItemKind::Tool { kind, .. }, .. - }) = stat.equipment.main + }) = attacker_stats.equipment.main { kind.attack_recover_duration() } else { @@ -91,13 +98,15 @@ impl<'a> System<'a> for Sys { if deal_damage { if let Some(Attack { .. }) = &character_states.get(entity).map(|c| c.action) { // Go through all other entities - for (b, uid_b, pos_b, ori_b, character_b, stat_b) in ( + for (b, uid_b, pos_b, ori_b, scale_b_maybe, character_b, stats_b, body_b) in ( &entities, &uids, &positions, &orientations, + scales.maybe(), &character_states, &stats, + &bodies, ) .join() { @@ -106,16 +115,21 @@ impl<'a> System<'a> for Sys { let pos_b2: Vec2 = Vec2::from(pos_b.0); let ori2 = Vec2::from(ori.0); + // Scales + let scale = scale_maybe.map_or(1.0, |s| s.0); + let scale_b = scale_b_maybe.map_or(1.0, |s| s.0); + let rad_b = body_b.radius() * scale_b; + // Check if it is a hit if entity != b - && !stat_b.is_dead - && pos.0.distance_squared(pos_b.0) < ATTACK_RANGE.powi(2) - // TODO: Use size instead of 1.0 - && ori2.angle_between(pos_b2 - pos2) < (2.0 / pos2.distance(pos_b2)).atan() + && !stats_b.is_dead + // Spherical wedge shaped attack field + && pos.0.distance_squared(pos_b.0) < (rad_b + scale * ATTACK_RANGE).powi(2) + && ori2.angle_between(pos_b2 - pos2) < ATTACK_ANGLE.to_radians() / 2.0 + (rad_b / pos2.distance(pos_b2)).atan() { // Weapon gives base damage let mut dmg = if let Some(ItemKind::Tool { power, .. }) = - stat.equipment.main.as_ref().map(|i| &i.kind) + attacker_stats.equipment.main.as_ref().map(|i| &i.kind) { *power as i32 } else { @@ -124,8 +138,8 @@ impl<'a> System<'a> for Sys { // Block if character_b.action.is_block() - && ori_b.0.angle_between(pos.0 - pos_b.0).to_degrees() - < BLOCK_ANGLE / 2.0 + && ori_b.0.angle_between(pos.0 - pos_b.0) + < BLOCK_ANGLE.to_radians() / 2.0 { dmg = (dmg as f32 * (1.0 - BLOCK_EFFICIENCY)) as i32 } diff --git a/common/src/sys/controller.rs b/common/src/sys/controller.rs index 3894d1b325..999ebbba4a 100644 --- a/common/src/sys/controller.rs +++ b/common/src/sys/controller.rs @@ -7,12 +7,12 @@ use crate::{ }, event::{Emitter, EventBus, LocalEvent, ServerEvent}, state::DeltaTime, + sync::{Uid, UidAllocator}, }; use specs::{ saveload::{Marker, MarkerAllocator}, Entities, Entity, Join, Read, ReadStorage, System, WriteStorage, }; -use sphynx::{Uid, UidAllocator}; use std::time::Duration; use vek::*; diff --git a/common/src/sys/mod.rs b/common/src/sys/mod.rs index f9f154c82d..8006c20abc 100644 --- a/common/src/sys/mod.rs +++ b/common/src/sys/mod.rs @@ -2,6 +2,7 @@ pub mod agent; mod cleanup; pub mod combat; pub mod controller; +mod mount; pub mod movement; pub mod phys; mod projectile; @@ -13,6 +14,7 @@ use specs::DispatcherBuilder; // System names const AGENT_SYS: &str = "agent_sys"; const CONTROLLER_SYS: &str = "controller_sys"; +const MOUNT_SYS: &str = "mount_sys"; const PHYS_SYS: &str = "phys_sys"; const MOVEMENT_SYS: &str = "movement_sys"; const PROJECTILE_SYS: &str = "projectile_sys"; @@ -23,13 +25,20 @@ const CLEANUP_SYS: &str = "cleanup_sys"; pub fn add_local_systems(dispatch_builder: &mut DispatcherBuilder) { dispatch_builder.add(agent::Sys, AGENT_SYS, &[]); dispatch_builder.add(controller::Sys, CONTROLLER_SYS, &[AGENT_SYS]); + dispatch_builder.add(mount::Sys, MOUNT_SYS, &[CONTROLLER_SYS]); dispatch_builder.add(movement::Sys, MOVEMENT_SYS, &[]); dispatch_builder.add(combat::Sys, COMBAT_SYS, &[CONTROLLER_SYS]); dispatch_builder.add(stats::Sys, STATS_SYS, &[COMBAT_SYS]); dispatch_builder.add( phys::Sys, PHYS_SYS, - &[CONTROLLER_SYS, MOVEMENT_SYS, COMBAT_SYS, STATS_SYS], + &[ + CONTROLLER_SYS, + MOUNT_SYS, + MOVEMENT_SYS, + COMBAT_SYS, + STATS_SYS, + ], ); dispatch_builder.add(projectile::Sys, PROJECTILE_SYS, &[PHYS_SYS]); dispatch_builder.add(cleanup::Sys, CLEANUP_SYS, &[PHYS_SYS]); diff --git a/common/src/sys/mount.rs b/common/src/sys/mount.rs new file mode 100644 index 0000000000..741ee9212d --- /dev/null +++ b/common/src/sys/mount.rs @@ -0,0 +1,78 @@ +use crate::{ + comp::{Controller, MountState, Mounting, Ori, Pos, Vel}, + sync::UidAllocator, +}; +use specs::{ + saveload::{Marker, MarkerAllocator}, + Entities, Join, Read, System, WriteStorage, +}; +use vek::*; + +/// This system is responsible for controlling mounts +pub struct Sys; +impl<'a> System<'a> for Sys { + type SystemData = ( + Read<'a, UidAllocator>, + Entities<'a>, + WriteStorage<'a, Controller>, + WriteStorage<'a, MountState>, + WriteStorage<'a, Mounting>, + WriteStorage<'a, Pos>, + WriteStorage<'a, Vel>, + WriteStorage<'a, Ori>, + ); + + fn run( + &mut self, + ( + uid_allocator, + entities, + mut controllers, + mut mount_state, + mut mountings, + mut positions, + mut velocities, + mut orientations, + ): Self::SystemData, + ) { + // Mounted entities. + for (entity, mut mount_states) in (&entities, &mut mount_state.restrict_mut()).join() { + match mount_states.get_unchecked() { + MountState::Unmounted => {} + MountState::MountedBy(mounter_uid) => { + if let Some((controller, mounter)) = uid_allocator + .retrieve_entity_internal(mounter_uid.id()) + .and_then(|mounter| controllers.get(mounter).cloned().map(|x| (x, mounter))) + { + // TODO: consider joining on these? (remember we can use .maybe()) + let pos = positions.get(entity).copied(); + let ori = orientations.get(entity).copied(); + let vel = velocities.get(entity).copied(); + if let (Some(pos), Some(ori), Some(vel)) = (pos, ori, vel) { + let _ = positions.insert(mounter, Pos(pos.0 + Vec3::unit_z() * 1.0)); + let _ = orientations.insert(mounter, ori); + let _ = velocities.insert(mounter, vel); + } + let _ = controllers.insert(entity, controller); + } else { + *(mount_states.get_mut_unchecked()) = MountState::Unmounted; + } + } + } + } + + let mut to_unmount = Vec::new(); + for (entity, Mounting(mountee_uid)) in (&entities, &mountings).join() { + if uid_allocator + .retrieve_entity_internal(mountee_uid.id()) + .filter(|mountee| entities.is_alive(*mountee)) + .is_none() + { + to_unmount.push(entity); + } + } + for entity in to_unmount { + mountings.remove(entity); + } + } +} diff --git a/common/src/sys/movement.rs b/common/src/sys/movement.rs index 6bd3b797ee..4c85dfc8cc 100644 --- a/common/src/sys/movement.rs +++ b/common/src/sys/movement.rs @@ -5,10 +5,10 @@ use crate::{ }, event::{EventBus, ServerEvent}, state::DeltaTime, + sync::Uid, terrain::TerrainGrid, }; -use specs::prelude::*; -use sphynx::Uid; +use specs::{Entities, Join, Read, ReadExpect, ReadStorage, System, WriteStorage}; use std::time::Duration; use vek::*; @@ -173,10 +173,14 @@ impl<'a> System<'a> for Sys { if Vec2::::from(wall_dir).magnitude_squared() > 0.001 { Vec2::from(wall_dir).normalized() } else { - Vec2::from(vel.0) + Vec2::from(inputs.move_dir) } - } else { + } else if let Glide = character.movement { + // Note: non-gliding forces will also affect velocity and thus orientation + // producing potentially unexpected changes in direction Vec2::from(vel.0) + } else { + Vec2::from(inputs.move_dir) }; if ori_dir.magnitude_squared() > 0.0001 diff --git a/common/src/sys/phys.rs b/common/src/sys/phys.rs index 401d1631f1..67689495b4 100644 --- a/common/src/sys/phys.rs +++ b/common/src/sys/phys.rs @@ -3,11 +3,11 @@ use { comp::{Body, Gravity, Mass, Mounting, Ori, PhysicsState, Pos, Scale, Sticky, Vel}, event::{EventBus, ServerEvent}, state::DeltaTime, + sync::Uid, terrain::{Block, TerrainGrid}, vol::ReadVol, }, specs::{Entities, Join, Read, ReadExpect, ReadStorage, System, WriteStorage}, - sphynx::Uid, vek::*, }; @@ -102,6 +102,7 @@ impl<'a> System<'a> for Sys { let scale = scale.map(|s| s.0).unwrap_or(1.0); // Basic collision with terrain + // TODO: rename this, not just the player entity let player_rad = 0.3 * scale; // half-width of the player's AABB let player_height = 1.5 * scale; @@ -342,16 +343,20 @@ impl<'a> System<'a> for Sys { } // Apply pushback - for (pos, scale, mass, vel, _, _, physics) in ( + for (pos, scale, mass, vel, _, _, _, physics) in ( &positions, scales.maybe(), masses.maybe(), &mut velocities, &bodies, !&mountings, + stickies.maybe(), &mut physics_states, ) .join() + .filter(|(_, _, _, _, _, _, sticky, physics)| { + sticky.is_none() || (physics.on_wall.is_none() && !physics.on_ground) + }) { physics.touch_entity = None; diff --git a/common/src/sys/stats.rs b/common/src/sys/stats.rs index 448bb375a0..f8aa9e281b 100644 --- a/common/src/sys/stats.rs +++ b/common/src/sys/stats.rs @@ -23,8 +23,25 @@ impl<'a> System<'a> for Sys { ) { let mut server_event_emitter = server_event_bus.emitter(); - for (entity, mut stat) in (&entities, &mut stats).join() { - if stat.should_die() && !stat.is_dead { + // Increment last change timer + stats.set_event_emission(false); // avoid unnecessary syncing + for stat in (&mut stats).join() { + stat.health.last_change.0 += f64::from(dt.0); + } + stats.set_event_emission(true); + + // Mutates all stats every tick causing the server to resend this component for every entity every tick + for (entity, mut stats) in (&entities, &mut stats.restrict_mut()).join() { + let (set_dead, level_up) = { + let stat = stats.get_unchecked(); + ( + stat.should_die() && !stat.is_dead, + stat.exp.current() >= stat.exp.maximum(), + ) + }; + + if set_dead { + let stat = stats.get_mut_unchecked(); server_event_emitter.emit(ServerEvent::Destroy { entity, cause: stat.health.last_change.1.cause, @@ -33,9 +50,8 @@ impl<'a> System<'a> for Sys { stat.is_dead = true; } - stat.health.last_change.0 += f64::from(dt.0); - - if stat.exp.current() >= stat.exp.maximum() { + if level_up { + let stat = stats.get_mut_unchecked(); while stat.exp.current() >= stat.exp.maximum() { stat.exp.change_by(-(stat.exp.maximum() as i64)); stat.exp.change_maximum_by(25); diff --git a/server/Cargo.toml b/server/Cargo.toml index c379db4c90..009ff93252 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -11,7 +11,7 @@ world = { package = "veloren-world", path = "../world" } specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git" } log = "0.4.8" -specs = "0.14.2" +specs = { version = "0.15.1", features = ["shred-derive"] } vek = "0.9.9" uvth = "3.1.1" lazy_static = "1.4.0" @@ -27,5 +27,3 @@ prometheus = "0.7" prometheus-static-metric = "0.2" rouille = "3.0.0" portpicker = { git = "https://github.com/wusyong/portpicker-rs", branch = "fix_ipv6" } -# TODO: remove when upgrading to specs 0.15 -hibitset = "0.5.3" diff --git a/server/src/cmd.rs b/server/src/cmd.rs index a38a1126fe..cca446f1a9 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -11,15 +11,17 @@ use common::{ npc::{get_npc_name, NpcKind}, pathfinding::WorldPath, state::TimeOfDay, + sync::WorldSyncExt, terrain::{Block, BlockKind, TerrainChunkSize}, vol::RectVolSize, }; use rand::Rng; -use specs::{Builder, Entity as EcsEntity, Join}; +use specs::{Builder, Entity as EcsEntity, Join, WorldExt}; use vek::*; use world::util::Sampler; use lazy_static::lazy_static; +use log::error; use scan_fmt::{scan_fmt, scan_fmt_some}; /// Struct representing a command that a user can run from server chat. @@ -1117,7 +1119,9 @@ fn handle_remove_lights( let size = to_delete.len(); for entity in to_delete { - let _ = server.state.ecs_mut().delete_entity_synced(entity); + if let Err(err) = server.state.delete_entity_recorded(entity) { + error!("Failed to delete light: {:?}", err); + } } server.notify_client( diff --git a/server/src/lib.rs b/server/src/lib.rs index 41eaeb78d6..8804efe33f 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -19,6 +19,7 @@ use crate::{ chunk_generator::ChunkGenerator, client::{Client, RegionSubscription}, cmd::CHAT_COMMANDS, + sys::sentinel::{DeletedEntities, TrackedComps}, }; use common::{ assets, comp, @@ -26,14 +27,18 @@ use common::{ event::{EventBus, ServerEvent}, msg::{ClientMsg, ClientState, ServerError, ServerInfo, ServerMsg}, net::PostOffice, - state::{BlockChange, State, TimeOfDay, Uid}, + state::{BlockChange, State, TimeOfDay}, + sync::{Uid, WorldSyncExt}, terrain::{block::Block, TerrainChunkSize, TerrainGrid}, vol::{ReadVol, RectVolSize, Vox}, }; -use log::debug; +use log::{debug, error}; use metrics::ServerMetrics; use rand::Rng; -use specs::{join::Join, world::EntityBuilder as EcsEntityBuilder, Builder, Entity as EcsEntity}; +use specs::{ + join::Join, world::EntityBuilder as EcsEntityBuilder, Builder, Entity as EcsEntity, RunNow, + SystemData, WorldExt, +}; use std::{ i32, sync::Arc, @@ -83,25 +88,18 @@ impl Server { /// Create a new `Server` pub fn new(settings: ServerSettings) -> Result { let mut state = State::default(); - state - .ecs_mut() - .add_resource(EventBus::::default()); + state.ecs_mut().insert(EventBus::::default()); // TODO: anything but this - state.ecs_mut().add_resource(AuthProvider::new()); - state.ecs_mut().add_resource(Tick(0)); - state.ecs_mut().add_resource(ChunkGenerator::new()); - // System timers - state - .ecs_mut() - .add_resource(sys::EntitySyncTimer::default()); - state.ecs_mut().add_resource(sys::MessageTimer::default()); - state - .ecs_mut() - .add_resource(sys::SubscriptionTimer::default()); - state - .ecs_mut() - .add_resource(sys::TerrainSyncTimer::default()); - state.ecs_mut().add_resource(sys::TerrainTimer::default()); + state.ecs_mut().insert(AuthProvider::new()); + state.ecs_mut().insert(Tick(0)); + state.ecs_mut().insert(ChunkGenerator::new()); + // System timers for performance monitoring + state.ecs_mut().insert(sys::EntitySyncTimer::default()); + state.ecs_mut().insert(sys::MessageTimer::default()); + state.ecs_mut().insert(sys::SentinelTimer::default()); + state.ecs_mut().insert(sys::SubscriptionTimer::default()); + state.ecs_mut().insert(sys::TerrainSyncTimer::default()); + state.ecs_mut().insert(sys::TerrainTimer::default()); // Server-only components state.ecs_mut().register::(); state.ecs_mut().register::(); @@ -153,11 +151,16 @@ impl Server { }; // set the spawn point we calculated above - state.ecs_mut().add_resource(SpawnPoint(spawn_point)); + state.ecs_mut().insert(SpawnPoint(spawn_point)); // Set starting time for the server. state.ecs_mut().write_resource::().0 = settings.start_time; + // Register trackers + sys::sentinel::register_trackers(&mut state.ecs_mut()); + + state.ecs_mut().insert(DeletedEntities::default()); + let this = Self { state, world: Arc::new(world), @@ -301,8 +304,6 @@ impl Server { let server_settings = &self.server_settings; - let mut todo_remove = None; - match event { ServerEvent::Explosion { pos, radius } => { const RAYS: usize = 500; @@ -372,19 +373,20 @@ impl Server { } ServerEvent::Destroy { entity, cause } => { - let ecs = state.ecs(); // Chat message - if let Some(player) = ecs.read_storage::().get(entity) { + if let Some(player) = state.ecs().read_storage::().get(entity) { let msg = if let comp::HealthSource::Attack { by } = cause { - ecs.entity_from_uid(by.into()).and_then(|attacker| { - ecs.read_storage::().get(attacker).map( - |attacker_alias| { + state.ecs().entity_from_uid(by.into()).and_then(|attacker| { + state + .ecs() + .read_storage::() + .get(attacker) + .map(|attacker_alias| { format!( "{} was killed by {}", &player.alias, &attacker_alias.alias ) - }, - ) + }) }) } else { None @@ -394,28 +396,48 @@ impl Server { state.notify_registered_clients(ServerMsg::kill(msg)); } - // Give EXP to the killer if entity had stats - let mut stats = ecs.write_storage::(); - - if let Some(entity_stats) = stats.get(entity).cloned() { - if let comp::HealthSource::Attack { by } = cause { - ecs.entity_from_uid(by.into()).map(|attacker| { - if let Some(attacker_stats) = stats.get_mut(attacker) { - // TODO: Discuss whether we should give EXP by Player Killing or not. - attacker_stats - .exp - .change_by((entity_stats.level.level() * 10) as i64); - } - }); + { + // Give EXP to the killer if entity had stats + let mut stats = state.ecs().write_storage::(); + if let Some(entity_stats) = stats.get(entity).cloned() { + if let comp::HealthSource::Attack { by } = cause { + state.ecs().entity_from_uid(by.into()).map(|attacker| { + if let Some(attacker_stats) = stats.get_mut(attacker) { + // TODO: Discuss whether we should give EXP by Player Killing or not. + attacker_stats + .exp + .change_by((entity_stats.level.level() * 10) as i64); + } + }); + } } } - if let Some(client) = ecs.write_storage::().get_mut(entity) { - let _ = ecs.write_storage().insert(entity, comp::Vel(Vec3::zero())); - let _ = ecs.write_storage().insert(entity, comp::ForceUpdate); + let mut remove = true; + + if let Some(client) = state.ecs().write_storage::().get_mut(entity) { + remove = false; + state + .ecs() + .write_storage() + .insert(entity, comp::Vel(Vec3::zero())) + .err() + .map(|err| error!("Failed to set zero vel on dead client: {:?}", err)); + state + .ecs() + .write_storage() + .insert(entity, comp::ForceUpdate) + .err() + .map(|err| { + error!("Failed to insert ForceUpdate on dead client: {:?}", err) + }); client.force_state(ClientState::Dead); - } else { - todo_remove = Some(entity.clone()); + } + + if remove { + if let Err(err) = state.delete_entity_recorded(entity) { + error!("Failed to delete destroyed entity: {:?}", err); + } } } @@ -449,7 +471,9 @@ impl Server { }; if let Some(item_entity) = item_entity { - let _ = state.ecs_mut().delete_entity_synced(item_entity); + if let Err(err) = state.delete_entity_recorded(item_entity) { + error!("Failed to delete picked up item entity: {:?}", err); + } } state.write_component(entity, comp::InventoryUpdate); @@ -605,8 +629,8 @@ impl Server { { let not_mounting_yet = if let Some(comp::MountState::Unmounted) = state .ecs() - .write_storage::() - .get_mut(mountee) + .read_storage::() + .get(mountee) .cloned() { true @@ -720,7 +744,7 @@ impl Server { main, &server_settings, ); - Self::initialize_region_subscription(state, entity); + sys::subscription::initialize_region_subscription(state.ecs(), entity); } ServerEvent::CreateNpc { @@ -738,8 +762,8 @@ impl Server { } ServerEvent::ClientDisconnect(entity) => { - if let Err(err) = state.ecs_mut().delete_entity_synced(entity) { - debug!("Failed to delete disconnected client: {:?}", err); + if let Err(err) = state.delete_entity_recorded(entity) { + error!("Failed to delete disconnected client: {:?}", err); } frontend_events.push(Event::ClientDisconnected { entity }); @@ -753,11 +777,6 @@ impl Server { chat_commands.push((entity, cmd)); } } - - // TODO: is this needed? - if let Some(entity) = todo_remove { - let _ = state.ecs_mut().delete_entity_synced(entity); - } } // Generate requested chunks. @@ -816,8 +835,12 @@ impl Server { // 3) Handle inputs from clients frontend_events.append(&mut self.handle_new_connections()?); + // Run message recieving sys before the systems in common for decreased latency (e.g. run before controller system) + sys::message::Sys.run_now(&self.state.ecs()); + let before_tick_4 = Instant::now(); - // 4) Tick the client's LocalState. + + // 4) Tick the server's LocalState. self.state.tick(dt, sys::add_server_systems); let before_handle_events = Instant::now(); @@ -832,11 +855,6 @@ impl Server { let before_tick_6 = Instant::now(); // 6) Synchronise clients with the new state of the world. - // TODO: Remove sphynx - // Sync 'logical' state using Sphynx. - let sync_package = self.state.ecs_mut().next_sync_package(); - self.state - .notify_registered_clients(ServerMsg::EcsSync(sync_package)); // Remove NPCs that are outside the view distances of all players // This is done by removing NPCs in unloaded chunks @@ -853,7 +871,9 @@ impl Server { .collect::>() }; for entity in to_delete { - let _ = self.state.ecs_mut().delete_entity_synced(entity); + if let Err(err) = self.state.delete_entity_recorded(entity) { + error!("Failed to delete agent outside the terrain: {:?}", err); + } } let before_tick_7 = Instant::now(); @@ -864,6 +884,7 @@ impl Server { .read_resource::() .nanos as i64; let message_nanos = self.state.ecs().read_resource::().nanos as i64; + let sentinel_nanos = self.state.ecs().read_resource::().nanos as i64; let subscription_nanos = self .state .ecs() @@ -877,24 +898,28 @@ impl Server { let terrain_nanos = self.state.ecs().read_resource::().nanos as i64; let total_sys_nanos = entity_sync_nanos + message_nanos + + sentinel_nanos + subscription_nanos + terrain_sync_nanos + terrain_nanos; self.metrics .tick_time .with_label_values(&["input"]) - .set((before_tick_4 - before_tick_1).as_nanos() as i64); + .set((before_tick_4 - before_tick_1).as_nanos() as i64 - message_nanos); self.metrics .tick_time .with_label_values(&["state tick"]) - .set((before_handle_events - before_tick_4).as_nanos() as i64 - total_sys_nanos); + .set( + (before_handle_events - before_tick_4).as_nanos() as i64 + - (total_sys_nanos - message_nanos), + ); self.metrics .tick_time .with_label_values(&["handle server events"]) .set((before_tick_6 - before_handle_events).as_nanos() as i64); self.metrics .tick_time - .with_label_values(&["sphynx sync"]) + .with_label_values(&["entity deletion"]) .set((before_tick_7 - before_tick_6).as_nanos() as i64); self.metrics .tick_time @@ -971,7 +996,8 @@ impl Server { .create_entity_synced() .with(client) .build(); - // Return the state of the current world (all of the components that Sphynx tracks). + // Send client all the tracked components currently attached to its entity as well + // as synced resources (currently only `TimeOfDay`) log::debug!("Starting initial sync with client."); self.state .ecs() @@ -979,9 +1005,11 @@ impl Server { .get_mut(entity) .unwrap() .notify(ServerMsg::InitialSync { - ecs_state: self.state.ecs().gen_state_package(), - entity_uid: self.state.ecs().uid_from_entity(entity).unwrap().into(), // Can't fail. + // Send client their entity + entity_package: TrackedComps::fetch(&self.state.ecs()) + .create_entity_package(entity), server_info: self.server_info.clone(), + time_of_day: *self.state.ecs().read_resource(), // world_map: (WORLD_SIZE/*, self.world.sim().get_map()*/), }); log::debug!("Done initial sync with client."); @@ -993,83 +1021,6 @@ impl Server { Ok(frontend_events) } - /// Initialize region subscription - fn initialize_region_subscription(state: &mut State, entity: specs::Entity) { - let mut subscription = None; - - if let (Some(client_pos), Some(client_vd), Some(client)) = ( - state.ecs().read_storage::().get(entity), - state - .ecs() - .read_storage::() - .get(entity) - .map(|pl| pl.view_distance) - .and_then(|v| v), - state.ecs().write_storage::().get_mut(entity), - ) { - use common::region::RegionMap; - - let fuzzy_chunk = (Vec2::::from(client_pos.0)) - .map2(TerrainChunkSize::RECT_SIZE, |e, sz| e as i32 / sz as i32); - let chunk_size = TerrainChunkSize::RECT_SIZE.reduce_max() as f32; - let regions = common::region::regions_in_vd( - client_pos.0, - (client_vd as f32 * chunk_size) as f32 - + (client::CHUNK_FUZZ as f32 + chunk_size) * 2.0f32.sqrt(), - ); - - for (_, region) in state - .ecs() - .read_resource::() - .iter() - .filter(|(key, _)| regions.contains(key)) - { - // Sync physics of all entities in this region - for (&uid, &pos, vel, ori, character_state, _) in ( - &state.ecs().read_storage::(), - &state.ecs().read_storage::(), // We assume all these entities have a position - state.ecs().read_storage::().maybe(), - state.ecs().read_storage::().maybe(), - state.ecs().read_storage::().maybe(), - region.entities(), - ) - .join() - { - client.notify(ServerMsg::EntityPos { - entity: uid.into(), - pos, - }); - if let Some(vel) = vel.copied() { - client.notify(ServerMsg::EntityVel { - entity: uid.into(), - vel, - }); - } - if let Some(ori) = ori.copied() { - client.notify(ServerMsg::EntityOri { - entity: uid.into(), - ori, - }); - } - if let Some(character_state) = character_state.copied() { - client.notify(ServerMsg::EntityCharacterState { - entity: uid.into(), - character_state, - }); - } - } - } - - subscription = Some(RegionSubscription { - fuzzy_chunk, - regions, - }); - } - if let Some(subscription) = subscription { - state.write_component(entity, subscription); - } - } - pub fn notify_client(&self, entity: EcsEntity, msg: ServerMsg) { if let Some(client) = self.state.ecs().write_storage::().get_mut(entity) { client.notify(msg) @@ -1131,6 +1082,10 @@ trait StateExt { stats: comp::Stats, body: comp::Body, ) -> EcsEntityBuilder; + fn delete_entity_recorded( + &mut self, + entity: EcsEntity, + ) -> Result<(), specs::error::WrongGeneration>; } impl StateExt for State { @@ -1191,4 +1146,28 @@ impl StateExt for State { client.notify(msg.clone()) } } + + fn delete_entity_recorded( + &mut self, + entity: EcsEntity, + ) -> Result<(), specs::error::WrongGeneration> { + let (maybe_uid, maybe_pos) = ( + self.ecs().read_storage::().get(entity).copied(), + self.ecs().read_storage::().get(entity).copied(), + ); + let res = self.ecs_mut().delete_entity(entity); + if res.is_ok() { + if let (Some(uid), Some(pos)) = (maybe_uid, maybe_pos) { + let region_key = self + .ecs() + .read_resource::() + .find_region(entity, pos.0) + .expect("Failed to find region containing entity during entity deletion"); + self.ecs() + .write_resource::() + .record_deleted_entity(uid, region_key); + } + } + res + } } diff --git a/server/src/sys/entity_sync.rs b/server/src/sys/entity_sync.rs index a0d79fcb91..cb571b7c7c 100644 --- a/server/src/sys/entity_sync.rs +++ b/server/src/sys/entity_sync.rs @@ -1,4 +1,7 @@ -use super::SysTimer; +use super::{ + sentinel::{DeletedEntities, ReadTrackers, TrackedComps}, + SysTimer, +}; use crate::{ client::{Client, RegionSubscription}, Tick, @@ -7,7 +10,8 @@ use common::{ comp::{CharacterState, ForceUpdate, Inventory, InventoryUpdate, Last, Ori, Pos, Vel}, msg::ServerMsg, region::{Event as RegionEvent, RegionMap}, - state::Uid, + state::TimeOfDay, + sync::Uid, }; use specs::{ Entities, Entity as EcsEntity, Join, Read, ReadExpect, ReadStorage, System, Write, WriteStorage, @@ -19,6 +23,7 @@ impl<'a> System<'a> for Sys { type SystemData = ( Entities<'a>, Read<'a, Tick>, + ReadExpect<'a, TimeOfDay>, ReadExpect<'a, RegionMap>, Write<'a, SysTimer>, ReadStorage<'a, Uid>, @@ -35,6 +40,9 @@ impl<'a> System<'a> for Sys { WriteStorage<'a, Client>, WriteStorage<'a, ForceUpdate>, WriteStorage<'a, InventoryUpdate>, + Write<'a, DeletedEntities>, + TrackedComps<'a>, + ReadTrackers<'a>, ); fn run( @@ -42,6 +50,7 @@ impl<'a> System<'a> for Sys { ( entities, tick, + time_of_day, region_map, mut timer, uids, @@ -58,6 +67,9 @@ impl<'a> System<'a> for Sys { mut clients, mut force_updates, mut inventory_updates, + mut deleted_entities, + tracked_comps, + trackers, ): Self::SystemData, ) { timer.start(); @@ -68,8 +80,8 @@ impl<'a> System<'a> for Sys { // 2. Iterate through region subscribers (ie clients) // - Collect a list of entity ids for clients who are subscribed to this region (hash calc to check each) // 3. Iterate through events from that region - // - For each entity left event, iterate through the client list and check if they are subscribed to the destination (hash calc per subscribed client per entity left event) - // - Do something with entity entered events when sphynx is removed?? + // - For each entity entered event, iterate through the client list and check if they are subscribed to the source (hash calc per subscribed client per entity event), if not subscribed to the source send a entity creation message to that client + // - For each entity left event, iterate through the client list and check if they are subscribed to the destination (hash calc per subscribed client per entity event) // 4. Iterate through entities in that region // 5. Inform clients of the component changes for that entity // - Throttle update rate base on distance to each client @@ -77,6 +89,8 @@ impl<'a> System<'a> for Sys { // Sync physics // via iterating through regions for (key, region) in region_map.iter() { + // Assemble subscriber list for this region by iterating through clients and checking + // if they are subscribed to this region let mut subscribers = (&mut clients, &entities, &subscriptions, &positions) .join() .filter_map(|(client, entity, subscription, pos)| { @@ -91,6 +105,10 @@ impl<'a> System<'a> for Sys { for event in region.events() { match event { RegionEvent::Entered(id, maybe_key) => { + // Don't process newly created entities here (redundant network messages) + if trackers.uid.inserted().contains(*id) { + continue; + } let entity = entities.entity(*id); if let Some((uid, pos, vel, ori, character_state)) = uids.get(entity).and_then(|uid| { @@ -105,14 +123,18 @@ impl<'a> System<'a> for Sys { }) }) { + let create_msg = ServerMsg::CreateEntity( + tracked_comps.create_entity_package(entity), + ); for (client, regions, client_entity, _) in &mut subscribers { if maybe_key .as_ref() .map(|key| !regions.contains(key)) .unwrap_or(true) + // Client doesn't need to know about itself && *client_entity != entity - // Client doesn't need to know about itself { + client.notify(create_msg.clone()); send_initial_unsynced_components( client, uid, @@ -142,39 +164,59 @@ impl<'a> System<'a> for Sys { } } - let mut send_msg = - |msg: ServerMsg, entity: EcsEntity, pos: Pos, force_update, throttle: bool| { - for (client, _, client_entity, client_pos) in &mut subscribers { - match force_update { - None if client_entity == &entity => {} - _ => { - let distance_sq = client_pos.0.distance_squared(pos.0); + // Sync tracked components + // Get deleted entities in this region from DeletedEntities + let sync_msg = ServerMsg::EcsSync( + trackers.create_sync_package( + &tracked_comps, + region.entities(), + deleted_entities + .take_deleted_in_region(key) + .unwrap_or_else(|| Vec::new()), + ), + ); + for (client, _, _, _) in &mut subscribers { + client.notify(sync_msg.clone()); + } - // Throttle update rate based on distance to player - // TODO: more entities will be farther away so it could be more - // efficient to reverse the order of these checks - let update = if !throttle || distance_sq < 100.0f32.powi(2) { - true // Closer than 100.0 blocks - } else if distance_sq < 150.0f32.powi(2) { - (tick + entity.id() as u64) % 2 == 0 - } else if distance_sq < 200.0f32.powi(2) { - (tick + entity.id() as u64) % 4 == 0 - } else if distance_sq < 250.0f32.powi(2) { - (tick + entity.id() as u64) % 8 == 0 - } else if distance_sq < 300.0f32.powi(2) { - (tick + entity.id() as u64) % 16 == 0 - } else { - (tick + entity.id() as u64) % 32 == 0 - }; - - if update { - client.notify(msg.clone()); - } - } + let mut send_msg = |msg: ServerMsg, + entity: EcsEntity, + pos: Pos, + force_update: Option<&ForceUpdate>, + throttle: bool| { + for (client, _, client_entity, client_pos) in &mut subscribers { + let update = if client_entity == &entity { + // Don't send client physics updates about itself unless force update is set + force_update.is_some() + } else if !throttle { + // Update rate not thottled by distance + true + } else { + // Throttle update rate based on distance to client + let distance_sq = client_pos.0.distance_squared(pos.0); + // More entities farther away so checks start there + if distance_sq > 300.0f32.powi(2) { + (tick + entity.id() as u64) % 32 == 0 + } else if distance_sq > 250.0f32.powi(2) { + (tick + entity.id() as u64) % 16 == 0 + } else if distance_sq > 200.0f32.powi(2) { + (tick + entity.id() as u64) % 8 == 0 + } else if distance_sq > 150.0f32.powi(2) { + (tick + entity.id() as u64) % 4 == 0 + } else if distance_sq > 100.0f32.powi(2) { + (tick + entity.id() as u64) % 2 == 0 + } else { + true // Closer than 100 blocks } - } - }; + }; + if update { + client.notify(msg.clone()); + } + } + }; + + // Sync physics components for (_, entity, &uid, &pos, maybe_vel, maybe_ori, character_state, force_update) in ( region.entities(), &entities, @@ -257,6 +299,27 @@ impl<'a> System<'a> for Sys { } } + // Handle entity deletion in regions that don't exist in RegionMap (theoretically none) + for (region_key, deleted) in deleted_entities.take_remaining_deleted() { + for client in + (&mut clients, &subscriptions) + .join() + .filter_map(|(client, subscription)| { + if client.is_ingame() && subscription.regions.contains(®ion_key) { + Some(client) + } else { + None + } + }) + { + for uid in &deleted { + client.notify(ServerMsg::DeleteEntity(*uid)); + } + } + } + + // TODO: Sync clients that don't have a position? + // Sync inventories for (client, inventory, _) in (&mut clients, &inventories, &inventory_updates).join() { client.notify(ServerMsg::InventoryUpdate(inventory.clone())); @@ -266,6 +329,13 @@ impl<'a> System<'a> for Sys { force_updates.clear(); inventory_updates.clear(); + // Sync resources + // TODO: doesn't really belong in this system (rename system or create another system?) + let tof_msg = ServerMsg::TimeOfDay(*time_of_day); + for client in (&mut clients).join() { + client.notify(tof_msg.clone()); + } + timer.end(); } } diff --git a/server/src/sys/message.rs b/server/src/sys/message.rs index e4cdde00b2..6537e4e01a 100644 --- a/server/src/sys/message.rs +++ b/server/src/sys/message.rs @@ -1,7 +1,7 @@ use super::SysTimer; use crate::{auth_provider::AuthProvider, client::Client, CLIENT_TIMEOUT}; use common::{ - comp::{Admin, Body, CanBuild, Controller, Ori, Player, Pos, Vel}, + comp::{Admin, Body, CanBuild, Controller, ForceUpdate, Ori, Player, Pos, Vel}, event::{EventBus, ServerEvent}, msg::{validate_chat_msg, ChatMsgValidationError, MAX_BYTES_CHAT_MSG}, msg::{ClientMsg, ClientState, RequestStateError, ServerMsg}, @@ -25,6 +25,7 @@ impl<'a> System<'a> for Sys { ReadStorage<'a, Body>, ReadStorage<'a, CanBuild>, ReadStorage<'a, Admin>, + ReadStorage<'a, ForceUpdate>, WriteExpect<'a, AuthProvider>, Write<'a, BlockChange>, WriteStorage<'a, Pos>, @@ -46,6 +47,7 @@ impl<'a> System<'a> for Sys { bodies, can_build, admins, + force_updates, mut accounts, mut block_changes, mut positions, @@ -218,9 +220,11 @@ impl<'a> System<'a> for Sys { }, ClientMsg::PlayerPhysics { pos, vel, ori } => match client.client_state { ClientState::Character => { - let _ = positions.insert(entity, pos); - let _ = velocities.insert(entity, vel); - let _ = orientations.insert(entity, ori); + if force_updates.get(entity).is_none() { + let _ = positions.insert(entity, pos); + let _ = velocities.insert(entity, vel); + let _ = orientations.insert(entity, ori); + } } // Only characters can send positions. _ => client.error_state(RequestStateError::Impossible), diff --git a/server/src/sys/mod.rs b/server/src/sys/mod.rs index bbdadac329..72860c92c8 100644 --- a/server/src/sys/mod.rs +++ b/server/src/sys/mod.rs @@ -1,5 +1,6 @@ pub mod entity_sync; pub mod message; +pub mod sentinel; pub mod subscription; pub mod terrain; pub mod terrain_sync; @@ -9,23 +10,29 @@ use std::{marker::PhantomData, time::Instant}; pub type EntitySyncTimer = SysTimer; pub type MessageTimer = SysTimer; +pub type SentinelTimer = SysTimer; pub type SubscriptionTimer = SysTimer; pub type TerrainTimer = SysTimer; pub type TerrainSyncTimer = SysTimer; // System names const ENTITY_SYNC_SYS: &str = "server_entity_sync_sys"; +const SENTINEL_SYS: &str = "sentinel_sys"; const SUBSCRIPTION_SYS: &str = "server_subscription_sys"; const TERRAIN_SYNC_SYS: &str = "server_terrain_sync_sys"; const TERRAIN_SYS: &str = "server_terrain_sys"; -const MESSAGE_SYS: &str = "server_message_sys"; pub fn add_server_systems(dispatch_builder: &mut DispatcherBuilder) { + // TODO: makes some of these dependent on systems in common like the phys system + dispatch_builder.add(sentinel::Sys, SENTINEL_SYS, &[]); dispatch_builder.add(subscription::Sys, SUBSCRIPTION_SYS, &[]); - dispatch_builder.add(entity_sync::Sys, ENTITY_SYNC_SYS, &[SUBSCRIPTION_SYS]); + dispatch_builder.add( + entity_sync::Sys, + ENTITY_SYNC_SYS, + &[SUBSCRIPTION_SYS, SENTINEL_SYS], + ); dispatch_builder.add(terrain_sync::Sys, TERRAIN_SYS, &[]); dispatch_builder.add(terrain::Sys, TERRAIN_SYNC_SYS, &[TERRAIN_SYS]); - dispatch_builder.add(message::Sys, MESSAGE_SYS, &[]); } /// Used to keep track of how much time each system takes diff --git a/server/src/sys/sentinel.rs b/server/src/sys/sentinel.rs new file mode 100644 index 0000000000..8fc04ea445 --- /dev/null +++ b/server/src/sys/sentinel.rs @@ -0,0 +1,229 @@ +use super::SysTimer; +use common::{ + comp::{ + Body, CanBuild, Gravity, Item, LightEmitter, Mass, MountState, Mounting, Player, Scale, + Stats, Sticky, + }, + msg::EcsCompPacket, + sync::{EntityPackage, SyncPackage, Uid, UpdateTracker, WorldSyncExt}, +}; +use hashbrown::HashMap; +use specs::{ + shred::ResourceId, Entity as EcsEntity, Join, ReadExpect, ReadStorage, System, SystemData, + World, Write, WriteExpect, +}; +use vek::*; + +/// Always watching +/// This system will monitor specific components for insertion, removal, and modification +pub struct Sys; +impl<'a> System<'a> for Sys { + type SystemData = ( + Write<'a, SysTimer>, + TrackedComps<'a>, + WriteTrackers<'a>, + ); + + fn run(&mut self, (mut timer, comps, mut trackers): Self::SystemData) { + timer.start(); + + record_changes(&comps, &mut trackers); + + timer.end(); + } +} + +// Probably more difficult than it needs to be :p +#[derive(SystemData)] +pub struct TrackedComps<'a> { + pub uid: ReadStorage<'a, Uid>, + pub body: ReadStorage<'a, Body>, + pub player: ReadStorage<'a, Player>, + pub stats: ReadStorage<'a, Stats>, + pub can_build: ReadStorage<'a, CanBuild>, + pub light_emitter: ReadStorage<'a, LightEmitter>, + pub item: ReadStorage<'a, Item>, + pub scale: ReadStorage<'a, Scale>, + pub mounting: ReadStorage<'a, Mounting>, + pub mount_state: ReadStorage<'a, MountState>, + pub mass: ReadStorage<'a, Mass>, + pub sticky: ReadStorage<'a, Sticky>, + pub gravity: ReadStorage<'a, Gravity>, +} +impl<'a> TrackedComps<'a> { + pub fn create_entity_package(&self, entity: EcsEntity) -> EntityPackage { + let uid = self + .uid + .get(entity) + .copied() + .expect("No uid to create an entity package") + .0; + let mut comps = Vec::new(); + self.body.get(entity).copied().map(|c| comps.push(c.into())); + self.player + .get(entity) + .cloned() + .map(|c| comps.push(c.into())); + self.stats + .get(entity) + .cloned() + .map(|c| comps.push(c.into())); + self.can_build + .get(entity) + .cloned() + .map(|c| comps.push(c.into())); + self.light_emitter + .get(entity) + .copied() + .map(|c| comps.push(c.into())); + self.item.get(entity).cloned().map(|c| comps.push(c.into())); + self.scale + .get(entity) + .copied() + .map(|c| comps.push(c.into())); + self.mounting + .get(entity) + .cloned() + .map(|c| comps.push(c.into())); + self.mount_state + .get(entity) + .cloned() + .map(|c| comps.push(c.into())); + self.mass.get(entity).copied().map(|c| comps.push(c.into())); + self.sticky + .get(entity) + .copied() + .map(|c| comps.push(c.into())); + self.gravity + .get(entity) + .copied() + .map(|c| comps.push(c.into())); + + EntityPackage { uid, comps } + } +} +#[derive(SystemData)] +pub struct ReadTrackers<'a> { + pub uid: ReadExpect<'a, UpdateTracker>, + pub body: ReadExpect<'a, UpdateTracker>, + pub player: ReadExpect<'a, UpdateTracker>, + pub stats: ReadExpect<'a, UpdateTracker>, + pub can_build: ReadExpect<'a, UpdateTracker>, + pub light_emitter: ReadExpect<'a, UpdateTracker>, + pub item: ReadExpect<'a, UpdateTracker>, + pub scale: ReadExpect<'a, UpdateTracker>, + pub mounting: ReadExpect<'a, UpdateTracker>, + pub mount_state: ReadExpect<'a, UpdateTracker>, + pub mass: ReadExpect<'a, UpdateTracker>, + pub sticky: ReadExpect<'a, UpdateTracker>, + pub gravity: ReadExpect<'a, UpdateTracker>, +} +impl<'a> ReadTrackers<'a> { + pub fn create_sync_package( + &self, + comps: &TrackedComps, + filter: impl Join + Copy, + deleted_entities: Vec, + ) -> SyncPackage { + SyncPackage::new(&comps.uid, &self.uid, filter, deleted_entities) + .with_component(&comps.uid, &*self.body, &comps.body, filter) + .with_component(&comps.uid, &*self.player, &comps.player, filter) + .with_component(&comps.uid, &*self.stats, &comps.stats, filter) + .with_component(&comps.uid, &*self.can_build, &comps.can_build, filter) + .with_component( + &comps.uid, + &*self.light_emitter, + &comps.light_emitter, + filter, + ) + .with_component(&comps.uid, &*self.item, &comps.item, filter) + .with_component(&comps.uid, &*self.scale, &comps.scale, filter) + .with_component(&comps.uid, &*self.mounting, &comps.mounting, filter) + .with_component(&comps.uid, &*self.mount_state, &comps.mount_state, filter) + .with_component(&comps.uid, &*self.mass, &comps.mass, filter) + .with_component(&comps.uid, &*self.sticky, &comps.sticky, filter) + .with_component(&comps.uid, &*self.gravity, &comps.gravity, filter) + } +} + +#[derive(SystemData)] +pub struct WriteTrackers<'a> { + uid: WriteExpect<'a, UpdateTracker>, + body: WriteExpect<'a, UpdateTracker>, + player: WriteExpect<'a, UpdateTracker>, + stats: WriteExpect<'a, UpdateTracker>, + can_build: WriteExpect<'a, UpdateTracker>, + light_emitter: WriteExpect<'a, UpdateTracker>, + item: WriteExpect<'a, UpdateTracker>, + scale: WriteExpect<'a, UpdateTracker>, + mounting: WriteExpect<'a, UpdateTracker>, + mount_state: WriteExpect<'a, UpdateTracker>, + mass: WriteExpect<'a, UpdateTracker>, + sticky: WriteExpect<'a, UpdateTracker>, + gravity: WriteExpect<'a, UpdateTracker>, +} + +fn record_changes(comps: &TrackedComps, trackers: &mut WriteTrackers) { + // Update trackers + trackers.uid.record_changes(&comps.uid); + trackers.body.record_changes(&comps.body); + trackers.player.record_changes(&comps.player); + trackers.stats.record_changes(&comps.stats); + trackers.can_build.record_changes(&comps.can_build); + trackers.light_emitter.record_changes(&comps.light_emitter); + trackers.item.record_changes(&comps.item); + trackers.scale.record_changes(&comps.scale); + trackers.mounting.record_changes(&comps.mounting); + trackers.mount_state.record_changes(&comps.mount_state); + trackers.mass.record_changes(&comps.mass); + trackers.sticky.record_changes(&comps.sticky); + trackers.gravity.record_changes(&comps.gravity); +} + +pub fn register_trackers(world: &mut World) { + world.register_tracker::(); + world.register_tracker::(); + world.register_tracker::(); + world.register_tracker::(); + world.register_tracker::(); + world.register_tracker::(); + world.register_tracker::(); + world.register_tracker::(); + world.register_tracker::(); + world.register_tracker::(); + world.register_tracker::(); + world.register_tracker::(); + world.register_tracker::(); +} + +/// Deleted entities grouped by region +pub struct DeletedEntities { + map: HashMap, Vec>, +} + +impl Default for DeletedEntities { + fn default() -> Self { + Self { + map: HashMap::new(), + } + } +} + +impl DeletedEntities { + pub fn record_deleted_entity(&mut self, uid: Uid, region_key: Vec2) { + self.map + .entry(region_key) + .or_insert(Vec::new()) + .push(uid.into()); + } + pub fn take_deleted_in_region(&mut self, key: Vec2) -> Option> { + self.map.remove(&key) + } + pub fn get_deleted_in_region(&mut self, key: Vec2) -> Option<&Vec> { + self.map.get(&key) + } + pub fn take_remaining_deleted(&mut self) -> Vec<(Vec2, Vec)> { + // TODO: don't allocate + self.map.drain().collect() + } +} diff --git a/server/src/sys/subscription.rs b/server/src/sys/subscription.rs index 88e574959e..f11eaeeafb 100644 --- a/server/src/sys/subscription.rs +++ b/server/src/sys/subscription.rs @@ -1,14 +1,21 @@ -use super::SysTimer; +use super::{ + sentinel::{DeletedEntities, TrackedComps}, + SysTimer, +}; use crate::client::{self, Client, RegionSubscription}; use common::{ comp::{CharacterState, Ori, Player, Pos, Vel}, msg::ServerMsg, region::{region_in_vd, regions_in_vd, Event as RegionEvent, RegionMap}, - state::Uid, + sync::Uid, terrain::TerrainChunkSize, vol::RectVolSize, }; -use specs::{Entities, Join, ReadExpect, ReadStorage, System, Write, WriteStorage}; +use log::{debug, error}; +use specs::{ + Entities, Join, ReadExpect, ReadStorage, System, SystemData, World, WorldExt, Write, + WriteStorage, +}; use vek::*; /// This system will update region subscriptions based on client positions @@ -26,6 +33,8 @@ impl<'a> System<'a> for Sys { ReadStorage<'a, Player>, WriteStorage<'a, Client>, WriteStorage<'a, RegionSubscription>, + Write<'a, DeletedEntities>, + TrackedComps<'a>, ); fn run( @@ -42,6 +51,8 @@ impl<'a> System<'a> for Sys { players, mut clients, mut subscriptions, + mut deleted_entities, + tracked_comps, ): Self::SystemData, ) { timer.start(); @@ -66,8 +77,15 @@ impl<'a> System<'a> for Sys { &entities, ) .join() - .filter_map(|(c, s, pos, player, e)| player.view_distance.map(|v| (c, s, pos, v, e))) + .filter_map(|(client, s, pos, player, e)| { + if client.is_ingame() { + player.view_distance.map(|v| (client, s, pos, v, e)) + } else { + None + } + }) { + // Calculate current chunk let chunk = (Vec2::::from(pos.0)) .map2(TerrainChunkSize::RECT_SIZE, |e, sz| e as i32 / sz as i32); // Only update regions when moving to a new chunk @@ -85,7 +103,7 @@ impl<'a> System<'a> for Sys { .reduce_or() { // Update current chunk - subscription.fuzzy_chunk = (Vec2::::from(pos.0)) + subscription.fuzzy_chunk = Vec2::::from(pos.0) .map2(TerrainChunkSize::RECT_SIZE, |e, sz| e as i32 / sz as i32); // Use the largest side length as our chunk size let chunk_size = TerrainChunkSize::RECT_SIZE.reduce_max() as f32; @@ -106,19 +124,24 @@ impl<'a> System<'a> for Sys { // Iterate through regions to remove for key in regions_to_remove.drain(..) { - // Remove region from this clients set of subscribed regions + // Remove region from this client's set of subscribed regions subscription.regions.remove(&key); // Tell the client to delete the entities in that region if it exists in the RegionMap if let Some(region) = region_map.get(key) { - // Process entity left events since they won't be processed during phsyics sync because this region is no longer subscribed to + // Process entity left events since they won't be processed during entity sync because this region is no longer subscribed to + // TODO: consider changing system ordering?? for event in region.events() { match event { RegionEvent::Entered(_, _) => {} // These don't need to be processed because this region is being thrown out anyway RegionEvent::Left(id, maybe_key) => { // Lookup UID for entity + // Doesn't overlap with entity deletion in sync packages + // because the uid would not be available if the entity was + // deleted if let Some(&uid) = uids.get(entities.entity(*id)) { if !maybe_key .as_ref() + // Don't need to check that this isn't also in the regions to remove since the entity will be removed when we get to that one .map(|key| subscription.regions.contains(key)) .unwrap_or(false) { @@ -128,10 +151,19 @@ impl<'a> System<'a> for Sys { } } } + // Tell client to delete entities in the region for (&uid, _) in (&uids, region.entities()).join() { - client.notify(ServerMsg::DeleteEntity(uid.into())) + client.notify(ServerMsg::DeleteEntity(uid.into())); } } + // Send deleted entities since they won't be processed for this client in entity sync + for uid in deleted_entities + .get_deleted_in_region(key) + .iter() + .flat_map(|v| v.iter()) + { + client.notify(ServerMsg::DeleteEntity(*uid)); + } } for key in regions_in_vd( @@ -139,10 +171,11 @@ impl<'a> System<'a> for Sys { (vd as f32 * chunk_size) + (client::CHUNK_FUZZ as f32 + chunk_size) * 2.0f32.sqrt(), ) { - // Send client intial info about the entities in this region - if subscription.regions.insert(key) { + // Send client intial info about the entities in this region if it was not + // already within the set of subscribed regions + if subscription.regions.insert(key.clone()) { if let Some(region) = region_map.get(key) { - for (uid, pos, vel, ori, character_state, _, _) in ( + for (uid, pos, vel, ori, character_state, _, entity) in ( &uids, &positions, velocities.maybe(), @@ -154,6 +187,11 @@ impl<'a> System<'a> for Sys { .join() .filter(|(_, _, _, _, _, _, e)| *e != client_entity) { + // Send message to create entity and tracked components + client.notify(ServerMsg::CreateEntity( + tracked_comps.create_entity_package(entity), + )); + // Send message to create physics components super::entity_sync::send_initial_unsynced_components( client, uid, @@ -172,3 +210,69 @@ impl<'a> System<'a> for Sys { timer.end(); } } + +/// Initialize region subscription +pub fn initialize_region_subscription(world: &World, entity: specs::Entity) { + if let (Some(client_pos), Some(client_vd), Some(client)) = ( + world.read_storage::().get(entity), + world + .read_storage::() + .get(entity) + .map(|pl| pl.view_distance) + .and_then(|v| v), + world.write_storage::().get_mut(entity), + ) { + let fuzzy_chunk = (Vec2::::from(client_pos.0)) + .map2(TerrainChunkSize::RECT_SIZE, |e, sz| e as i32 / sz as i32); + let chunk_size = TerrainChunkSize::RECT_SIZE.reduce_max() as f32; + let regions = common::region::regions_in_vd( + client_pos.0, + (client_vd as f32 * chunk_size) as f32 + + (client::CHUNK_FUZZ as f32 + chunk_size) * 2.0f32.sqrt(), + ); + + let region_map = world.read_resource::(); + let tracked_comps = TrackedComps::fetch(world); + for key in ®ions { + if let Some(region) = region_map.get(*key) { + for (uid, pos, vel, ori, character_state, _, entity) in ( + &tracked_comps.uid, + &world.read_storage::(), // We assume all these entities have a position + world.read_storage::().maybe(), + world.read_storage::().maybe(), + world.read_storage::().maybe(), + region.entities(), + &world.entities(), + ) + .join() + { + // Send message to create entity and tracked components + client.notify(ServerMsg::CreateEntity( + tracked_comps.create_entity_package(entity), + )); + // Send message to create physics components + super::entity_sync::send_initial_unsynced_components( + client, + uid, + pos, + vel, + ori, + character_state, + ); + } + } + } + + if let Err(err) = world.write_storage().insert( + entity, + RegionSubscription { + fuzzy_chunk, + regions, + }, + ) { + error!("Failed to insert region subscription component: {:?}", err); + } + } else { + debug!("Failed to initialize region subcription. Couldn't retrieve all the neccesary components on the provided entity"); + } +} diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index 896b6b7283..daa6fbfd66 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -27,7 +27,7 @@ conrod_winit = { git = "https://gitlab.com/veloren/conrod.git" } euc = "0.3.0" # ECS -specs = "0.14.2" +specs = "0.15.1" # Mathematics vek = { version = "0.9.9", features = ["serde"] } diff --git a/voxygen/src/audio/sfx/event_mapper.rs b/voxygen/src/audio/sfx/event_mapper.rs index 69baaa6b93..9a6f7c3d92 100644 --- a/voxygen/src/audio/sfx/event_mapper.rs +++ b/voxygen/src/audio/sfx/event_mapper.rs @@ -8,7 +8,7 @@ use common::{ event::{EventBus, SfxEvent, SfxEventItem}, }; use hashbrown::HashMap; -use specs::{Entity as EcsEntity, Join}; +use specs::{Entity as EcsEntity, Join, WorldExt}; use std::time::{Duration, Instant}; use vek::*; diff --git a/voxygen/src/audio/sfx/mod.rs b/voxygen/src/audio/sfx/mod.rs index a4007ccfa0..52ab02614c 100644 --- a/voxygen/src/audio/sfx/mod.rs +++ b/voxygen/src/audio/sfx/mod.rs @@ -9,6 +9,7 @@ use common::{ event::{EventBus, SfxEvent, SfxEventItem}, }; use serde::Deserialize; +use specs::WorldExt; use vek::*; #[derive(Deserialize)] diff --git a/voxygen/src/hud/map.rs b/voxygen/src/hud/map.rs index 0af0330e8b..885a69f319 100644 --- a/voxygen/src/hud/map.rs +++ b/voxygen/src/hud/map.rs @@ -7,6 +7,7 @@ use conrod_core::{ widget::{self, Button, Image, Rectangle, Text}, widget_ids, Colorable, Positionable, Sizeable, Widget, WidgetCommon, }; +use specs::WorldExt; use vek::*; widget_ids! { diff --git a/voxygen/src/hud/minimap.rs b/voxygen/src/hud/minimap.rs index 09893c2eba..be1e34ad2c 100644 --- a/voxygen/src/hud/minimap.rs +++ b/voxygen/src/hud/minimap.rs @@ -7,6 +7,7 @@ use conrod_core::{ widget::{self, Button, Image, Rectangle, Text}, widget_ids, Color, Colorable, Positionable, Sizeable, Widget, WidgetCommon, }; +use specs::WorldExt; use std::time::{Duration, Instant}; use vek::*; diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 3c4308356e..7da5038331 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -49,7 +49,7 @@ use conrod_core::{ widget::{self, Button, Image, Rectangle, Text}, widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, }; -use specs::Join; +use specs::{Join, WorldExt}; use std::collections::VecDeque; use vek::*; @@ -112,6 +112,7 @@ widget_ids! { velocity, loaded_distance, time, + entity_count, // Game Version version, @@ -872,11 +873,19 @@ impl Hud { .font_id(self.fonts.cyri) .font_size(14) .set(self.ids.time, ui_widgets); + // Number of entities + let entity_count = client.state().ecs().entities().join().count(); + Text::new(&format!("Entity count: {}", entity_count)) + .color(TEXT_COLOR) + .down_from(self.ids.time, 5.0) + .font_id(self.fonts.cyri) + .font_size(14) + .set(self.ids.entity_count, ui_widgets); // Help Window Text::new("Press 'F1' to show Keybindings") .color(TEXT_COLOR) - .down_from(self.ids.time, 5.0) + .down_from(self.ids.entity_count, 5.0) .font_id(self.fonts.cyri) .font_size(14) .set(self.ids.help_info, ui_widgets); diff --git a/voxygen/src/hud/social.rs b/voxygen/src/hud/social.rs index 14be88343c..b57ab9226c 100644 --- a/voxygen/src/hud/social.rs +++ b/voxygen/src/hud/social.rs @@ -7,7 +7,7 @@ use conrod_core::{ widget_ids, /*, Color*/ Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; -use specs::Join; +use specs::{Join, WorldExt}; use client::{self, Client}; diff --git a/voxygen/src/menu/char_selection/scene.rs b/voxygen/src/menu/char_selection/scene.rs index 4b2c99bfcc..906e60c0a4 100644 --- a/voxygen/src/menu/char_selection/scene.rs +++ b/voxygen/src/menu/char_selection/scene.rs @@ -21,6 +21,7 @@ use common::{ terrain::BlockKind, }; use log::error; +use specs::WorldExt; use vek::*; struct Skybox { diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index ddecd67043..b5e33ee35d 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -26,7 +26,7 @@ use common::{ }; use hashbrown::HashMap; use log::trace; -use specs::{Entity as EcsEntity, Join}; +use specs::{Entity as EcsEntity, Join, WorldExt}; use vek::*; const DAMAGE_FADE_COEFFICIENT: f64 = 5.0; diff --git a/voxygen/src/scene/mod.rs b/voxygen/src/scene/mod.rs index a98e30c436..d43450806d 100644 --- a/voxygen/src/scene/mod.rs +++ b/voxygen/src/scene/mod.rs @@ -22,7 +22,7 @@ use common::{ terrain::{BlockKind, TerrainChunk}, vol::ReadVol, }; -use specs::Join; +use specs::{Join, WorldExt}; use vek::*; // TODO: Don't hard-code this. diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 6d7151d65f..2ff3286fd0 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -17,7 +17,7 @@ use common::{ ChatType, }; use log::error; -use specs::Join; +use specs::{Join, WorldExt}; use std::{cell::RefCell, rc::Rc, time::Duration}; use vek::*; diff --git a/voxygen/src/ui/mod.rs b/voxygen/src/ui/mod.rs index e5e581adf8..6a20dbfbf0 100644 --- a/voxygen/src/ui/mod.rs +++ b/voxygen/src/ui/mod.rs @@ -342,7 +342,7 @@ impl Ui { // moving origin to top-left corner (from middle). let min_x = self.ui.win_w / 2.0 + l; let min_y = self.ui.win_h / 2.0 - b - h; - Aabr { + let intersection = Aabr { min: Vec2 { x: (min_x * scale_factor) as u16, y: (min_y * scale_factor) as u16, @@ -352,7 +352,13 @@ impl Ui { y: ((min_y + h) * scale_factor) as u16, }, } - .intersection(window_scissor) + .intersection(window_scissor); + + if intersection.is_valid() { + intersection + } else { + Aabr::new_empty(Vec2::zero()) + } }; if new_scissor != current_scissor { // Finish the current command. @@ -750,7 +756,7 @@ impl Ui { } fn default_scissor(renderer: &Renderer) -> Aabr { - let (screen_w, screen_h) = renderer.get_resolution().map(|e| e as u16).into_tuple(); + let (screen_w, screen_h) = renderer.get_resolution().into_tuple(); Aabr { min: Vec2 { x: 0, y: 0 }, max: Vec2 {