diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000..80479e9a52 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,232 @@ +#cache: +# paths: +# - target/ + +stages: + - build + - test + - deploy + - post-run + +# our own git fetch command like https://gitlab.com/gitlab-org/gitlab-runner/blob/master/shells/abstract.go +# speeds up building because we skip the git clean and dont need any gitlab caches +variables: + GIT_STRATEGY: none +before_script: + - if [ -d .git ]; then + echo "is git dir"; + else + git clone $CI_REPOSITORY_URL . ; + fi; + - rm -f .git/index.lock + - rm -f .git/shallow.lock + - rm -f .git/HEAD.lock + - rm -f .git/hocks/post-checkout + - git remote set-url origin $CI_REPOSITORY_URL + - git fetch origin --prune +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* + - git checkout -f -q $CI_COMMIT_SHA + - if [ ! -z "${SOURCE_PROJECT}" -a "${SOURCE_PROJECT}" != " " ]; then + echo "THIS SEEMS TO BE A MERGE PIPELINE FROM ${SOURCE_PROJECT}/${SOURCE_BRANCH}"; + git pull "https://gitlab.com/${SOURCE_PROJECT}/veloren.git" "${SOURCE_BRANCH}"; + fi; + - git submodule update --init --recursive + - git status + - if [ -d target ]; then + ls -la target; + fi; +# - git submodule update --init --recursive + +clean-code: + stage: build + script: + - rustup component add rustfmt-preview + - cargo fmt --all -- --check + allow_failure: true + +build-voxygen: + stage: build + script: + - (cd voxygen && cargo build) + +build-server-cli: + stage: build + script: + - (cd server-cli && cargo build) + +unittests: + stage: test + script: + - cargo test + +#benchmarktests: +# stage: test +# script: +# - cargo bench + +nightly-linux-debug: + stage: deploy + script: + - (cd voxygen && VELOREN_ASSETS=assets cargo build) + - (cd server-cli && VELOREN_ASSETS=assets cargo build) + - rm -r -f nightly + - mkdir nightly + - cp target/debug/veloren-server-cli nightly + - cp target/debug/veloren-voxygen nightly + - cp -r assets nightly/ + - cp -r voxygen/shaders nightly/ + - rm -f nightly-linux-debug.tar.bz2 + - tar -cvjSf nightly-linux-debug.tar.bz2 nightly + when: always + artifacts: + paths: + - nightly-linux-debug.tar.bz2 + expire_in: 1 week + only: + refs: + - master + +nightly-windows-debug: + stage: deploy + script: + - (cd voxygen && VELOREN_ASSETS=assets cargo build --target=x86_64-pc-windows-gnu) + - (cd server-cli && VELOREN_ASSETS=assets cargo build --target=x86_64-pc-windows-gnu) + - rm -r -f nightly + - mkdir nightly + - cp target/x86_64-pc-windows-gnu/debug/veloren-server-cli.exe nightly + - cp target/x86_64-pc-windows-gnu/debug/veloren-voxygen.exe nightly + - cp -r assets nightly/ + - cp -r voxygen/shaders nightly/ + - rm -f nightly-windows-debug.zip + - zip -r nightly-windows-debug.zip nightly + artifacts: + paths: + - nightly-windows-debug.zip + expire_in: 1 week + only: + refs: + - master + +nightly-linux-optimized: + stage: deploy + script: + - (cd voxygen && VELOREN_ASSETS=assets cargo build --release) + - (cd server-cli && VELOREN_ASSETS=assets cargo build --release) + - rm -r -f nightly + - mkdir nightly + - cp target/release/veloren-server-cli nightly + - cp target/release/veloren-voxygen nightly + - cp -r assets nightly/ + - cp -r voxygen/shaders nightly/ + - rm -f nightly-linux-optimized.tar.bz2 + - tar -cvjSf nightly-linux-optimized.tar.bz2 nightly + when: manual + artifacts: + paths: + - nightly-linux-optimized.tar.bz2 + expire_in: 2 days + only: + refs: + - master + +nightly-windows-optimized: + stage: deploy + script: + - (cd voxygen && VELOREN_ASSETS=assets cargo build --release --target=x86_64-pc-windows-gnu) + - (cd server-cli && VELOREN_ASSETS=assets cargo build --release --target=x86_64-pc-windows-gnu) + - rm -r -f nightly + - mkdir nightly + - cp target/x86_64-pc-windows-gnu/release/veloren-server-cli.exe nightly + - cp target/x86_64-pc-windows-gnu/release/veloren-voxygen.exe nightly + - cp -r assets nightly/ + - cp -r voxygen/shaders nightly/ + - rm -f nightly-windows-optimized.zip + - zip -r nightly-windows-optimized.zip nightly + when: manual + artifacts: + paths: + - nightly-windows-optimized.zip + expire_in: 2 days + only: + refs: + - master + +stable-linux-optimized: + stage: deploy + script: + - (cd voxygen && VELOREN_ASSETS=assets cargo build --release) + - (cd server-cli && VELOREN_ASSETS=assets cargo build --release) + - rm -r -f stable + - mkdir stable + - cp target/release/veloren-server-cli stable + - cp target/release/veloren-voxygen stable + - cp -r assets nightly/ + - cp -r voxygen/shaders nightly/ + - rm -f stable-linux-optimized.tar.bz2 + - tar -cvjSf stable-linux-optimized.tar.bz2 stable + artifacts: + paths: + - stable-linux-optimized.tar.bz2 + expire_in: 30d + only: + refs: + - /^v[0-9]+\.[0-9]+\.[0-9]+/ + +stable-windows-optimized: + stage: deploy + script: + - (cd voxygen && VELOREN_ASSETS=assets cargo build --release --target=x86_64-pc-windows-gnu) + - (cd server-cli && VELOREN_ASSETS=assets cargo build --release --target=x86_64-pc-windows-gnu) + - rm -r -f stable + - mkdir stable + - cp target/x86_64-pc-windows-gnu/release/veloren-server-cli.exe stable + - cp target/x86_64-pc-windows-gnu/release/veloren-voxygen.exe stable + - cp -r assets nightly/ + - cp -r voxygen/shaders nightly/ + - rm -f stable-windows-optimized.zip + - zip -r stable-windows-optimized.zip stable + artifacts: + paths: + - stable-windows-optimized.zip + expire_in: 30d + only: + refs: + - /^v[0-9]+\.[0-9]+\.[0-9]+/ + +# nightly-windows-release: +# stage: deploy +# script: +# - (cd voxygen && VELOREN_ASSETS=assets cargo build --release --target=x86_64-pc-windows-gnu) +# - (cd server-cli && VELOREN_ASSETS=assets cargo build --release --target=x86_64-pc-windows-gnu) +# - rm -r -f nightly +# - mkdir nightly +# - cp target/x86_64-pc-windows-gnu/debug/veloren-server-cli.exe nightly +# - cp target/x86_64-pc-windows-gnu/debug/veloren-voxygen.exe nightly +# - cp -r assets nightly/ +# - cp -r voxygen/shaders nightly/ +# - cp -r voxygen/fonts nightly/ +# - rm -f nightly-windows-release.zip +# - zip -r nightly-windows-release.zip nightly +# artifacts: +# paths: +# - nightly-windows-release.zip +# expire_in: 1 week +# only: +# refs: +# - master + +coverage: + stage: post-run + script: + - if cargo install --list | grep -i "cargo-tarpaulin"; then + echo "tarpaulin already installed"; + else + RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin; + fi + - cargo tarpaulin --skip-clean --all || echo "There is a problem in tarpaulin which sometimes fails" + +clippy: + stage: post-run + script: + - rustup component add clippy-preview --toolchain=nightly + - cargo clippy --all -- -D clippy || echo "This job is disabled, because we are not activly using it now, so we dont want to see yellow failed partly" + allow_failure: true diff --git a/Cargo.lock b/Cargo.lock index 6777d2e7e4..c737488c85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -71,7 +71,7 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", - "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "termion 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -219,7 +219,7 @@ source = "git+https://gitlab.com/veloren/conrod.git#93f02e61838b475ff190b3563a0f dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -401,7 +401,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -414,13 +414,13 @@ dependencies = [ [[package]] name = "dot_vox" -version = "1.0.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -457,10 +457,37 @@ dependencies = [ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "euc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "vek 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "euclid" +version = "0.19.8" +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.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "euclid_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.32 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "failure" version = "0.1.5" @@ -477,7 +504,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.32 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -668,6 +695,14 @@ dependencies = [ "x11-dl 2.18.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "guillotiere" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "euclid 0.19.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hibitset" version = "0.5.4" @@ -862,14 +897,6 @@ dependencies = [ "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "memchr" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "memchr" version = "2.2.0" @@ -970,14 +997,6 @@ dependencies = [ "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "nom" -version = "3.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "nom" version = "4.2.3" @@ -1029,7 +1048,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1089,6 +1108,11 @@ dependencies = [ "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "numtoa" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "objc" version = "0.2.6" @@ -1471,7 +1495,7 @@ dependencies = [ [[package]] name = "regex" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1604,7 +1628,7 @@ dependencies = [ "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1615,7 +1639,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1647,7 +1671,7 @@ dependencies = [ [[package]] name = "shred" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1664,7 +1688,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1716,7 +1740,7 @@ dependencies = [ "nonzero_signed 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)", - "shred 0.7.1 (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)", "shrev 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "tuple_utils 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1725,7 +1749,7 @@ dependencies = [ [[package]] name = "sphynx" version = "0.1.0" -source = "git+https://gitlab.com/veloren/sphynx.git#b11c95047a1ab282cd790a3488a8b4f7923573e3" +source = "git+https://gitlab.com/veloren/sphynx.git#32cfe0602b7876784845a39d5118f5d63dca80ff" dependencies = [ "serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1758,7 +1782,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "0.15.31" +version = "0.15.32" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1773,7 +1797,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.32 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1787,10 +1811,11 @@ dependencies = [ [[package]] name = "termion" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", + "numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1898,14 +1923,14 @@ name = "veloren-common" version = "0.2.0" dependencies = [ "bincode 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "dot_vox 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "dot_vox 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)", - "shred 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "shred 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", "sphynx 0.1.0 (git+https://gitlab.com/veloren/sphynx.git)", "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1942,13 +1967,16 @@ dependencies = [ "config 0.9.2 (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)", - "dot_vox 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "dot_vox 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "gfx 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_device_gl 0.15.5 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_window_glutin 0.28.0 (registry+https://github.com/rust-lang/crates.io-index)", "glsl-include 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "glutin 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", + "guillotiere 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1960,6 +1988,7 @@ dependencies = [ "vek 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", "veloren-client 0.2.0", "veloren-common 0.2.0", + "veloren-server 0.2.0", "winit 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2208,12 +2237,15 @@ dependencies = [ "checksum deflate 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)" = "8a6abb26e16e8d419b5c78662aa9f82857c2386a073da266840e474d5055ec86" "checksum derivative 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6073e9676dbebdddeabaeb63e3b7cefd23c86f5c41d381ee1237cc77b1079898" "checksum dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "77e51249a9d823a4cb79e3eca6dcd756153e8ed0157b6c04775d04bf1b13b76a" -"checksum dot_vox 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa4d1fc391ef151fff024e8427d206af1adbef4281fcd875090f74697000441" +"checksum dot_vox 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "11afd3251e588f2770226659b2a1d55ec2f8aaf2ca42bdcdbd01ff53b4a81e70" "checksum downcast-rs 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b92dfd5c2f75260cbf750572f95d387e7ca0ba5e3fbe9e1a33f23025be020f" "checksum draw_state 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "33cf9537e2d06891448799b96d5a8c8083e0e90522a7fdabe6ebf4f41d79d651" "checksum either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5527cfe0d098f36e3f8839852688e63c8fff1c90b2b405aef730615f9a7bcf7b" "checksum enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be4551092f4d519593039259a9ed8daedf0da12e5109c5280338073eaeb81180" "checksum env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b61fa891024a945da30a9581546e8cfaf5602c7b3f4c137a2805cf388f92075a" +"checksum euc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0151594c4feeeb99ff35ac1b467383a46fcb2705275615bed0a47f25ffe2ccf8" +"checksum euclid 0.19.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7a4719a544a67ed3fc33784c2bd2c6581663dfe83b719a6ae05c6dabc3b51c73" +"checksum euclid_macros 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcb84c18ea5037a1c5a23039b4ff29403abce2e0d6b1daa11cf0bde2b30be15" "checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" "checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" @@ -2237,6 +2269,7 @@ dependencies = [ "checksum gleam 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "39bb69499005e11b7b7cc0af38404a1bc0f53d954bffa8adcdb6e8d5b14f75d5" "checksum glsl-include 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "31c109a006ad24fd612da10d185b51000ef502155578f3634416f102f0d63b6c" "checksum glutin 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "535c6eda58adbb227604b2db10a022ffd6339d7ea3e970f338e7d98aeb24fcc3" +"checksum guillotiere 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "46e965c66630b3a0369feafb06d945f15a4f59aaecc209eb1c4a2b57bb48ee06" "checksum hibitset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6527bc88f32e0d3926c7572874b2bf17a19b36978aacd0aacf75f7d27a5992d0" "checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114" "checksum image 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "545f000e8aa4e569e93f49c446987133452e0091c2494ac3efd3606aa3d309f2" @@ -2262,7 +2295,6 @@ dependencies = [ "checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" "checksum lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" "checksum malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -"checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a" "checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39" "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" @@ -2274,7 +2306,6 @@ dependencies = [ "checksum nix 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46f0f3210768d796e8fa79ec70ee6af172dacbe7147f5e69be5240a47778302b" "checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" "checksum noise 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9a3a34d4f8a31f95919b7ead9f5b60afb9bda0cae98b9219432ffaa6f00b0141" -"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 num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cf4825417e1e1406b3782a8ce92f4d53f26ec055e3622e1881ca8e9f5f9e08db" @@ -2288,6 +2319,7 @@ dependencies = [ "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" "checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" "checksum num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a23f0ed30a54abaa0c7e83b1d2d87ada7c3c23078d1d87815af3e3b6385fbba" +"checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" "checksum objc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "31d20fd2b37e07cf5125be68357b588672e8cefe9a96f8c17a9d46053b3e590d" "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" @@ -2330,7 +2362,7 @@ dependencies = [ "checksum redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)" = "12229c14a0f65c4f1cb046a3b52047cdd9da1f4b30f8a39c5063c8bae515e252" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" -"checksum regex 1.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "559008764a17de49a3146b234641644ed37d118d1ef641a0bb573d146edc6ce0" +"checksum regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "8f0a0bcab2fd7d1d7c54fa9eae6f43eddeb9ce2e7352f8518a814a4f65d60c58" "checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" "checksum regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dcfd8681eebe297b81d98498869d4aae052137651ad7b96822f09ceb690d0a96" "checksum rust-ini 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" @@ -2352,7 +2384,7 @@ dependencies = [ "checksum serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)" = "5a23aa71d4a4d43fdbfaac00eff68ba8a06a51759a89ac3304323e800c4dd40d" "checksum serde_test 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)" = "110b3dbdf8607ec493c22d5d947753282f3bae73c0f56d322af1e8c78e4c23d5" "checksum shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" -"checksum shred 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c75ec29e8d2959ad96a1087fe4cadb926c6fc17cbae9812314fa8efe720aa2a" +"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 shrev 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ec60ed6f60a4b3cdc2ceacf57215db3408fbd8990f66a38686a31558cd9da482" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" @@ -2364,10 +2396,10 @@ dependencies = [ "checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum stb_truetype 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "69b7df505db8e81d54ff8be4693421e5b543e08214bd8d99eb761fcb4d5668ba" "checksum sum_type 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fcaf0ad86cfe6e1a9ccd145baa65fb1856a8a4b7cc1440b3a13f2b1f93a96fa" -"checksum syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)" = "d2b4cfac95805274c6afdb12d8f770fa2d27c045953e7b630a81801953699a9a" +"checksum syn 0.15.32 (registry+https://github.com/rust-lang/crates.io-index)" = "846620ec526c1599c070eff393bfeeeb88a93afa2513fc3b49f1fea84cf7b0ed" "checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" "checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f" -"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" +"checksum termion 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dde0593aeb8d47accea5392b39350015b5eccb12c0d98044d856983d89548dea" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2f0c90a5f3459330ac8bc0d2f879c693bb7a2f59689c1083fc4ef83834da865" "checksum tiff 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1e4834f28a0330cb9f3f2c87d2649dca723cb33802e2bdcf18da32759fbec7ce" diff --git a/assets/voxygen b/assets/voxygen index e3083ec8e8..0a176c4089 160000 --- a/assets/voxygen +++ b/assets/voxygen @@ -1 +1 @@ -Subproject commit e3083ec8e8e634af8c9daed00ea82435da195979 +Subproject commit 0a176c408946f081850132623a6730d9d2b1e7ed diff --git a/client/src/lib.rs b/client/src/lib.rs index bd9a7ae61f..4931912b66 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -26,7 +26,7 @@ use common::{ msg::{ClientMsg, ServerMsg}, }; -const SERVER_TIMEOUT: f64 = 5.0; // Seconds +const SERVER_TIMEOUT: f64 = 20.0; // Seconds pub enum Event { Chat(String), @@ -167,9 +167,11 @@ impl Client { _ => {}, } - // Update the server about the player's currently playing animation - if let Some(animation) = self.state.read_storage().get(self.player).cloned() { - self.postbox.send_message(ClientMsg::PlayerAnimation(animation)); + // Update the server about the player's currently playing animation and the previous one + if let Some(animation_history) = self.state.read_storage::().get(self.player).cloned() { + if Some(animation_history.current) != animation_history.last { + self.postbox.send_message(ClientMsg::PlayerAnimation(animation_history)); + } } // Request chunks from the server @@ -228,9 +230,9 @@ impl Client { }, None => {}, }, - ServerMsg::EntityAnimation { entity, animation } => match self.state.ecs().entity_from_uid(entity) { + ServerMsg::EntityAnimation { entity, animation_history } => match self.state.ecs().entity_from_uid(entity) { Some(entity) => { - self.state.write_component(entity, animation); + self.state.write_component(entity, animation_history); }, None => {}, }, diff --git a/common/Cargo.toml b/common/Cargo.toml index e12e94bbab..da924061fd 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -10,7 +10,7 @@ sphynx = { git = "https://gitlab.com/veloren/sphynx.git", features = ["serde1"] specs = { version = "0.14", features = ["serde"] } shred = { version = "0.7", features = ["nightly"] } vek = { version = "0.9", features = ["serde"] } -dot_vox = "1.0" +dot_vox = "4.0" threadpool = "1.7" mio = "0.6" mio-extras = "2.0" diff --git a/common/src/comp/character.rs b/common/src/comp/character.rs index e34919236e..2ed29831f6 100644 --- a/common/src/comp/character.rs +++ b/common/src/comp/character.rs @@ -19,6 +19,12 @@ pub enum Gender { } #[derive(Copy, Clone, Debug, Serialize, Deserialize)] +pub struct AnimationHistory { + pub last: Option, + pub current: Animation, +} + +#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] pub enum Animation { Idle, Run, @@ -55,6 +61,6 @@ impl Component for Character { type Storage = FlaggedStorage>; } -impl Component for Animation { +impl Component for AnimationHistory { type Storage = FlaggedStorage>; } diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index c67f27cee2..d10012c976 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -7,4 +7,5 @@ pub mod phys; pub use agent::{Agent, Control}; pub use character::Character; pub use player::Player; +pub use character::AnimationHistory; pub use character::Animation; diff --git a/common/src/msg/client.rs b/common/src/msg/client.rs index 01c35a7962..95eaadecbf 100644 --- a/common/src/msg/client.rs +++ b/common/src/msg/client.rs @@ -11,7 +11,7 @@ pub enum ClientMsg { Ping, Pong, Chat(String), - PlayerAnimation(comp::character::Animation), + PlayerAnimation(comp::character::AnimationHistory), PlayerPhysics { pos: comp::phys::Pos, vel: comp::phys::Vel, diff --git a/common/src/msg/server.rs b/common/src/msg/server.rs index 1585c5f32f..3372b524fb 100644 --- a/common/src/msg/server.rs +++ b/common/src/msg/server.rs @@ -25,7 +25,7 @@ pub enum ServerMsg { }, EntityAnimation { entity: u64, - animation: comp::Animation, + animation_history: comp::AnimationHistory, }, TerrainChunkUpdate { key: Vec3, diff --git a/common/src/state.rs b/common/src/state.rs index 84a6736362..e8b4601d94 100644 --- a/common/src/state.rs +++ b/common/src/state.rs @@ -97,41 +97,41 @@ impl State { ecs.register_synced::(); // Register unsynched (or synced by other means) components - ecs.internal_mut().register::(); - ecs.internal_mut().register::(); - ecs.internal_mut().register::(); - ecs.internal_mut().register::(); - ecs.internal_mut().register::(); - ecs.internal_mut().register::(); + ecs.register::(); + ecs.register::(); + ecs.register::(); + ecs.register::(); + ecs.register::(); + ecs.register::(); // Register resources used by the ECS - ecs.internal_mut().add_resource(TimeOfDay(0.0)); - ecs.internal_mut().add_resource(Time(0.0)); - ecs.internal_mut().add_resource(DeltaTime(0.0)); - ecs.internal_mut().add_resource(TerrainMap::new()); + ecs.add_resource(TimeOfDay(0.0)); + ecs.add_resource(Time(0.0)); + ecs.add_resource(DeltaTime(0.0)); + ecs.add_resource(TerrainMap::new()); } /// Register a component with the state's ECS pub fn with_component(mut self) -> Self where ::Storage: Default { - self.ecs.internal_mut().register::(); + self.ecs.register::(); self } /// Write a component attributed to a particular entity pub fn write_component(&mut self, entity: EcsEntity, comp: C) { - let _ = self.ecs.internal_mut().write_storage().insert(entity, comp); + let _ = self.ecs.write_storage().insert(entity, comp); } /// Read a component attributed to a particular entity pub fn read_component_cloned(&self, entity: EcsEntity) -> Option { - self.ecs.internal().read_storage().get(entity).cloned() + self.ecs.read_storage().get(entity).cloned() } /// Get a read-only reference to the storage of a particular component type pub fn read_storage(&self) -> EcsStorage>> { - self.ecs.internal().read_storage::() + self.ecs.read_storage::() } /// Get a reference to the internal ECS world @@ -154,27 +154,25 @@ impl State { /// /// Note that this should not be used for physics, animations or other such localised timings. pub fn get_time_of_day(&self) -> f64 { - self.ecs.internal().read_resource::().0 + self.ecs.read_resource::().0 } /// Get the current in-game time. /// /// Note that this does not correspond to the time of day. pub fn get_time(&self) -> f64 { - self.ecs.internal().read_resource::