M .drone.yml => .drone.yml +59 -8
@@ 75,7 75,7 @@ steps:
image: coresdev/stk_build_env
commands:
- cd server
- - cargo clippy --color always
+ - cargo clippy --profile release-ci --color always
environment:
SCCACHE_REGION: us-east-1
SCCACHE_BUCKET:
@@ 93,7 93,7 @@ steps:
image: coresdev/stk_build_env
commands:
- cd server
- - cargo build --release --color always
+ - cargo build --profile release-ci --color always
environment:
SCCACHE_REGION: us-east-1
SCCACHE_BUCKET:
@@ 122,7 122,7 @@ steps:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
- source: target/release/starkingdoms-server
+ source: target/release-ci/starkingdoms-server
target: builds/${DRONE_COMMIT_SHA}/starkingdoms-server
path_style: true
@@ 159,7 159,7 @@ steps:
image: coresdev/stk_build_env
commands:
- cd starkingdoms-backplane
- - cargo clippy --color always
+ - cargo clippy --profile release-ci --color always
environment:
SCCACHE_REGION: us-east-1
SCCACHE_BUCKET:
@@ 177,7 177,7 @@ steps:
image: coresdev/stk_build_env
commands:
- cd starkingdoms-backplane
- - cargo build --release --color always
+ - cargo build --profile release-ci --color always
environment:
SCCACHE_REGION: us-east-1
SCCACHE_BUCKET:
@@ 206,7 206,7 @@ steps:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
- source: target/release/starkingdoms-backplane
+ source: target/release-ci/starkingdoms-backplane
target: builds/${DRONE_COMMIT_SHA}/starkingdoms-backplane
path_style: true
@@ 263,7 263,7 @@ steps:
commands:
- echo "$VAULT_PWD" > vault_password.txt
- cat vault_password.txt
- - ansible-playbook ansible/deploy.yml -i ansible/environments/unstable.yml --vault-password-file vault_password.txt -e "server_binary_url=$MINIO_BASE/$MINIO_BUCKET/builds/${DRONE_COMMIT_SHA}/starkingdoms-server/target/release/starkingdoms-server client_package_url=$MINIO_BASE/$MINIO_BUCKET/builds/${DRONE_COMMIT_SHA}/client.tar.xz/starkingdoms-client/dist/client.tar.xz"
+ - ansible-playbook ansible/deploy.yml -i ansible/environments/unstable.yml --vault-password-file vault_password.txt -e "server_binary_url=$MINIO_BASE/$MINIO_BUCKET/builds/${DRONE_COMMIT_SHA}/starkingdoms-server/target/release-ci/starkingdoms-server client_package_url=$MINIO_BASE/$MINIO_BUCKET/builds/${DRONE_COMMIT_SHA}/client.tar.xz/starkingdoms-client/dist/client.tar.xz"
---
kind: pipeline
@@ 289,4 289,55 @@ steps:
commands:
- echo "$VAULT_PWD" > vault_password.txt
- cat vault_password.txt
- - ansible-playbook ansible/deploy_backplane.yml -i ansible/global/backplane.yml --vault-password-file vault_password.txt -e "backplane_binary_url=$MINIO_BASE/$MINIO_BUCKET/builds/${DRONE_COMMIT_SHA}/starkingdoms-backplane/target/release/starkingdoms-backplane"
+ - ansible-playbook ansible/deploy_backplane.yml -i ansible/global/backplane.yml --vault-password-file vault_password.txt -e "backplane_binary_url=$MINIO_BASE/$MINIO_BUCKET/builds/${DRONE_COMMIT_SHA}/starkingdoms-backplane/target/release-ci/starkingdoms-backplane"
+---
+kind: pipeline
+type: docker
+name: deploy-beta
+trigger:
+ event:
+ - promote
+ target:
+ - beta
+steps:
+ - name: deploy
+ image: pad92/ansible-alpine
+ environment:
+ VAULT_PWD:
+ from_secret: vault_password
+ MINIO_BASE:
+ from_secret: s3_host
+ MINIO_BUCKET:
+ from_secret: s3_bucket
+ ANSIBLE_FORCE_COLOR: 1
+ ANSIBLE_HOST_KEY_CHECKING: False
+ commands:
+ - echo "$VAULT_PWD" > vault_password.txt
+ - cat vault_password.txt
+ - ansible-playbook ansible/deploy.yml -i ansible/environments/beta.yml --vault-password-file vault_password.txt -e "server_binary_url=$MINIO_BASE/$MINIO_BUCKET/builds/${DRONE_COMMIT_SHA}/starkingdoms-server/target/release-ci/starkingdoms-server client_package_url=$MINIO_BASE/$MINIO_BUCKET/builds/${DRONE_COMMIT_SHA}/client.tar.xz/starkingdoms-client/dist/client.tar.xz"
+---
+kind: pipeline
+type: docker
+name: deploy-stable
+trigger:
+ event:
+ - promote
+ target:
+ - stable
+steps:
+ - name: deploy
+ image: pad92/ansible-alpine
+ environment:
+ VAULT_PWD:
+ from_secret: vault_password
+ MINIO_BASE:
+ from_secret: s3_host
+ MINIO_BUCKET:
+ from_secret: s3_bucket
+ ANSIBLE_FORCE_COLOR: 1
+ ANSIBLE_HOST_KEY_CHECKING: False
+ commands:
+ - echo "$VAULT_PWD" > vault_password.txt
+ - cat vault_password.txt
+ - ansible-playbook ansible/deploy.yml -i ansible/environments/stable.yml --vault-password-file vault_password.txt -e "server_binary_url=$MINIO_BASE/$MINIO_BUCKET/builds/${DRONE_COMMIT_SHA}/starkingdoms-server/target/release-ci/starkingdoms-server client_package_url=$MINIO_BASE/$MINIO_BUCKET/builds/${DRONE_COMMIT_SHA}/client.tar.xz/starkingdoms-client/dist/client.tar.xz"
+
M .git-hooks/pre-commit => .git-hooks/pre-commit +2 -13
@@ 1,14 1,3 @@
#!/bin/bash
-echo "Checking your formatting..."
-rustfmt server/src/*.rs --edition 2021 --check
-if [ $? -ne 0 ]; then
- echo "Uh oh, looks like your formatting is off! Run 'rustfmt server/src/*.rs --edition 2021' to fix it."
- exit 1
-fi
-cd starkingdoms-client && yarn prettier . --check
-if [ $? -ne 0 ]; then
- echo "Uh oh, looks like your formatting is off! Run 'cd starkingdoms-client && yarn prettier . --write' to fix it."
- exit 1
-fi
-echo "Everything looks good! Proceeding with commit..."
-exit 0
+cargo fmt
+cd starkingdoms-client && yarn prettier . --write
M Cargo.lock => Cargo.lock +174 -173
@@ 4,9 4,9 @@ version = 3
[[package]]
name = "accesskit"
-version = "0.12.1"
+version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca8410747ed85a17c4a1e9ed3f5a74d3e7bdcc876cf9a18ff40ae21d645997b2"
+checksum = "6cb10ed32c63247e4e39a8f42e8e30fb9442fbf7878c8e4a9849e7e381619bea"
[[package]]
name = "accesskit_consumer"
@@ 89,16 89,16 @@ dependencies = [
[[package]]
name = "actix-http"
-version = "3.4.0"
+version = "3.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a92ef85799cba03f76e4f7c10f533e66d87c9a7e7055f3391f09000ad8351bc9"
+checksum = "129d4c88e98860e1758c5de288d1632b07970a16d59bdf7b8d66053d582bb71f"
dependencies = [
"actix-codec",
"actix-rt",
"actix-service",
"actix-utils",
"ahash",
- "base64 0.21.5",
+ "base64 0.21.6",
"bitflags 2.4.1",
"brotli",
"bytes",
@@ 133,14 133,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb"
dependencies = [
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
name = "actix-router"
-version = "0.5.1"
+version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799"
+checksum = "d22475596539443685426b6bdadb926ad0ecaefdfc5fb05e5e3441f15463c511"
dependencies = [
"bytestring",
"http 0.2.11",
@@ 199,9 199,9 @@ dependencies = [
[[package]]
name = "actix-web"
-version = "4.4.0"
+version = "4.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0e4a5b5e29603ca8c94a77c65cf874718ceb60292c5a5c3e5f4ace041af462b9"
+checksum = "e43428f3bf11dee6d166b00ec2df4e3aa8cc1606aaa0b7433c146852e2f4e03b"
dependencies = [
"actix-codec",
"actix-http",
@@ 246,7 246,7 @@ dependencies = [
"actix-router",
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
@@ 266,9 266,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "ahash"
-version = "0.8.6"
+version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a"
+checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01"
dependencies = [
"cfg-if",
"getrandom",
@@ 416,7 416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c"
dependencies = [
"concurrent-queue",
- "event-listener 4.0.0",
+ "event-listener 4.0.3",
"event-listener-strategy",
"futures-core",
"pin-project-lite",
@@ 428,11 428,11 @@ version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c"
dependencies = [
- "async-lock 3.2.0",
+ "async-lock 3.3.0",
"async-task",
"concurrent-queue",
"fastrand 2.0.1",
- "futures-lite 2.1.0",
+ "futures-lite 2.2.0",
"slab",
]
@@ 459,30 459,30 @@ dependencies = [
[[package]]
name = "async-lock"
-version = "3.2.0"
+version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c"
+checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b"
dependencies = [
- "event-listener 4.0.0",
+ "event-listener 4.0.3",
"event-listener-strategy",
"pin-project-lite",
]
[[package]]
name = "async-task"
-version = "4.5.0"
+version = "4.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1"
+checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799"
[[package]]
name = "async-trait"
-version = "0.1.74"
+version = "0.1.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9"
+checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
@@ 520,9 520,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
[[package]]
name = "base64"
-version = "0.21.5"
+version = "0.21.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9"
+checksum = "c79fed4cdb43e993fcdadc7e58a09fd0e3e649c4436fa11da71c9f1f3ee7feb9"
[[package]]
name = "base64ct"
@@ 621,7 621,7 @@ dependencies = [
"bevy_macro_utils",
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
@@ 669,7 669,7 @@ checksum = "f484318350462c58ba3942a45a656c1fd6b6e484a6b6b7abc3a787ad1a51e500"
dependencies = [
"bevy_macro_utils",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
@@ 717,7 717,7 @@ dependencies = [
"bevy_macro_utils",
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
@@ 837,7 837,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustc-hash",
- "syn 2.0.41",
+ "syn 2.0.48",
"toml_edit 0.20.7",
]
@@ 907,7 907,7 @@ dependencies = [
"bevy_macro_utils",
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
"uuid",
]
@@ 965,7 965,7 @@ dependencies = [
"bevy_macro_utils",
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
@@ 1092,7 1092,7 @@ checksum = "7aafecc952b6b8eb1a93c12590bd867d25df2f4ae1033a01dfdfc3c35ebccfff"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
@@ 1229,11 1229,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118"
dependencies = [
"async-channel 2.1.1",
- "async-lock 3.2.0",
+ "async-lock 3.3.0",
"async-task",
"fastrand 2.0.1",
"futures-io",
- "futures-lite 2.1.0",
+ "futures-lite 2.2.0",
"piper",
"tracing",
]
@@ 1282,7 1282,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
@@ 1455,9 1455,9 @@ dependencies = [
[[package]]
name = "cpufeatures"
-version = "0.2.11"
+version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0"
+checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
dependencies = [
"libc",
]
@@ 1473,11 1473,10 @@ dependencies = [
[[package]]
name = "crossbeam"
-version = "0.8.2"
+version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c"
+checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8"
dependencies = [
- "cfg-if",
"crossbeam-channel",
"crossbeam-deque",
"crossbeam-epoch",
@@ 1487,55 1486,46 @@ dependencies = [
[[package]]
name = "crossbeam-channel"
-version = "0.5.9"
+version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14c3242926edf34aec4ac3a77108ad4854bffaa2e4ddc1824124ce59231302d5"
+checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b"
dependencies = [
- "cfg-if",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-deque"
-version = "0.8.4"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751"
+checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d"
dependencies = [
- "cfg-if",
"crossbeam-epoch",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-epoch"
-version = "0.9.16"
+version = "0.9.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa"
+checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
dependencies = [
- "autocfg",
- "cfg-if",
"crossbeam-utils",
- "memoffset",
]
[[package]]
name = "crossbeam-queue"
-version = "0.3.9"
+version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9bcf5bdbfdd6030fb4a1c497b5d5fc5921aa2f60d359a17e249c0e6df3de153"
+checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35"
dependencies = [
- "cfg-if",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-utils"
-version = "0.8.17"
+version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f"
-dependencies = [
- "cfg-if",
-]
+checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
[[package]]
name = "crypto-common"
@@ 1566,9 1556,9 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5"
[[package]]
name = "deranged"
-version = "0.3.10"
+version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc"
+checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
dependencies = [
"powerfmt",
]
@@ 1623,7 1613,7 @@ dependencies = [
"diesel_table_macro_syntax",
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
@@ 1643,7 1633,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5"
dependencies = [
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
@@ 1704,7 1694,7 @@ checksum = "3fe2568f851fd6144a45fa91cfed8fe5ca8fc0b56ba6797bfc1ed2771b90e37c"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
@@ 1771,9 1761,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
[[package]]
name = "event-listener"
-version = "4.0.0"
+version = "4.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae"
+checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e"
dependencies = [
"concurrent-queue",
"parking",
@@ 1786,7 1776,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3"
dependencies = [
- "event-listener 4.0.0",
+ "event-listener 4.0.3",
"pin-project-lite",
]
@@ 1866,7 1856,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
@@ 1892,9 1882,9 @@ dependencies = [
[[package]]
name = "futures-channel"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb"
+checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"
dependencies = [
"futures-core",
"futures-sink",
@@ 1902,15 1892,15 @@ dependencies = [
[[package]]
name = "futures-core"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c"
+checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
[[package]]
name = "futures-io"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa"
+checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
[[package]]
name = "futures-lite"
@@ 1929,9 1919,9 @@ dependencies = [
[[package]]
name = "futures-lite"
-version = "2.1.0"
+version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aeee267a1883f7ebef3700f262d2d54de95dfaf38189015a74fdc4e0c7ad8143"
+checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba"
dependencies = [
"fastrand 2.0.1",
"futures-core",
@@ 1942,32 1932,32 @@ dependencies = [
[[package]]
name = "futures-macro"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb"
+checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
name = "futures-sink"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817"
+checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"
[[package]]
name = "futures-task"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2"
+checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
[[package]]
name = "futures-util"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104"
+checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
dependencies = [
"futures-channel",
"futures-core",
@@ 2004,9 1994,9 @@ dependencies = [
[[package]]
name = "getrandom"
-version = "0.2.11"
+version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f"
+checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
dependencies = [
"cfg-if",
"js-sys",
@@ 2290,13 2280,13 @@ dependencies = [
[[package]]
name = "is-terminal"
-version = "0.4.9"
+version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
+checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455"
dependencies = [
"hermit-abi",
"rustix",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
@@ 2369,9 2359,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
-version = "0.2.151"
+version = "0.2.152"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4"
+checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
[[package]]
name = "libloading"
@@ 2451,9 2441,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
[[package]]
name = "loom"
-version = "0.5.6"
+version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5"
+checksum = "7e045d70ddfbc984eacfa964ded019534e8f6cbf36f6410aee0ed5cefa5a9175"
dependencies = [
"cfg-if",
"generator",
@@ 2502,18 2492,9 @@ dependencies = [
[[package]]
name = "memchr"
-version = "2.6.4"
+version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
-
-[[package]]
-name = "memoffset"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
-dependencies = [
- "autocfg",
-]
+checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
[[package]]
name = "metal"
@@ 2791,7 2772,7 @@ dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
@@ 2841,9 2822,9 @@ dependencies = [
[[package]]
name = "object"
-version = "0.32.1"
+version = "0.32.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0"
+checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
dependencies = [
"memchr",
]
@@ 2995,9 2976,9 @@ dependencies = [
[[package]]
name = "pkg-config"
-version = "0.3.27"
+version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
+checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a"
[[package]]
name = "postgres-protocol"
@@ 3005,7 2986,7 @@ version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520"
dependencies = [
- "base64 0.21.5",
+ "base64 0.21.6",
"byteorder",
"bytes",
"fallible-iterator",
@@ 3061,18 3042,18 @@ dependencies = [
[[package]]
name = "proc-macro2"
-version = "1.0.70"
+version = "1.0.76"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"
+checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c"
dependencies = [
"unicode-ident",
]
[[package]]
name = "profiling"
-version = "1.0.12"
+version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1de09527cd2ea2c2d59fb6c2f8c1ab8c71709ed9d1b6d60b0e1c9fbb6fdcb33c"
+checksum = "d135ede8821cf6376eb7a64148901e1690b788c11ae94dc297ae917dbc91dc0e"
dependencies = [
"profiling-procmacros",
"tracing",
@@ 3080,19 3061,19 @@ dependencies = [
[[package]]
name = "profiling-procmacros"
-version = "1.0.12"
+version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d8f36e3c621a72254893ed5cc57d1a069162adb3f98bfef610788661db6ad8d"
+checksum = "4b322d7d65c1ab449be3c890fcbd0db6e1092d0dd05d79dba2dd28032cebeb05"
dependencies = [
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
name = "quote"
-version = "1.0.33"
+version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
+checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
dependencies = [
"proc-macro2",
]
@@ 3285,7 3266,7 @@ version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94"
dependencies = [
- "base64 0.21.5",
+ "base64 0.21.6",
"bitflags 2.4.1",
"serde",
"serde_derive",
@@ 3383,35 3364,35 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "semver"
-version = "1.0.20"
+version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
+checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0"
[[package]]
name = "serde"
-version = "1.0.193"
+version = "1.0.195"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"
+checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.193"
+version = "1.0.195"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
+checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
name = "serde_json"
-version = "1.0.108"
+version = "1.0.111"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b"
+checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4"
dependencies = [
"itoa",
"ryu",
@@ 3420,9 3401,9 @@ dependencies = [
[[package]]
name = "serde_spanned"
-version = "0.6.4"
+version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80"
+checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1"
dependencies = [
"serde",
]
@@ 3546,9 3527,9 @@ dependencies = [
[[package]]
name = "spade"
-version = "2.4.1"
+version = "2.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87a3ef2efbc408c9051c1a27ce7edff430d74531d31a480b7ca4f618072c2670"
+checksum = "bd774eb23cff002036706e6ea83c3f4ab4c80dad89da76fe16d49f77ab71682f"
dependencies = [
"hashbrown 0.14.3",
"num-traits",
@@ 3595,7 3576,7 @@ dependencies = [
name = "starkingdoms-common"
version = "0.1.0"
dependencies = [
- "base64 0.21.5",
+ "base64 0.21.6",
"hmac",
"rmp-serde",
"serde",
@@ 3604,7 3585,7 @@ dependencies = [
[[package]]
name = "starkingdoms-server"
-version = "0.0.1"
+version = "0.1.0-alpha1"
dependencies = [
"bevy",
"bevy_rapier2d",
@@ 3617,6 3598,7 @@ dependencies = [
"serde_json",
"sha2",
"starkingdoms-common",
+ "tikv-jemallocator",
"tracing-subscriber",
]
@@ 3662,9 3644,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.41"
+version = "2.0.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44c8b28c477cc3bf0e7966561e3460130e1255f7a1cf71931075f1c5e7a7e269"
+checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
dependencies = [
"proc-macro2",
"quote",
@@ 3687,31 3669,31 @@ dependencies = [
[[package]]
name = "termcolor"
-version = "1.4.0"
+version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449"
+checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
dependencies = [
"winapi-util",
]
[[package]]
name = "thiserror"
-version = "1.0.50"
+version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2"
+checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.50"
+version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
+checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
@@ 3725,10 3707,30 @@ dependencies = [
]
[[package]]
+name = "tikv-jemalloc-sys"
+version = "0.5.4+5.3.0-patched"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1"
+dependencies = [
+ "cc",
+ "libc",
+]
+
+[[package]]
+name = "tikv-jemallocator"
+version = "0.5.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "965fe0c26be5c56c94e38ba547249074803efd52adfb66de62107d95aab3eaca"
+dependencies = [
+ "libc",
+ "tikv-jemalloc-sys",
+]
+
+[[package]]
name = "time"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5"
+checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e"
dependencies = [
"deranged",
"itoa",
@@ 3746,9 3748,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
[[package]]
name = "time-macros"
-version = "0.2.15"
+version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20"
+checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f"
dependencies = [
"time-core",
]
@@ 3770,9 3772,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.35.0"
+version = "1.35.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c"
+checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104"
dependencies = [
"backtrace",
"bytes",
@@ 3915,7 3917,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
@@ 3980,9 3982,9 @@ dependencies = [
[[package]]
name = "tracing-tracy"
-version = "0.10.4"
+version = "0.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc6c7bf057d67aa107e076129a4f331aaac47ec379952d9f0775c6b1d838ee97"
+checksum = "fca0df0602d3ac1cfd7413bd4f463800fe076bf6b88698722aa763fe1561248b"
dependencies = [
"tracing-core",
"tracing-subscriber",
@@ 4002,9 4004,9 @@ dependencies = [
[[package]]
name = "tracy-client"
-version = "0.16.4"
+version = "0.16.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "82da0d50d9df1106619b1e5b118f39de779f7d8b9c3504485b291cb16fabd20f"
+checksum = "307e6b7030112fe9640fdd87988a40795549ba75c355f59485d14e6b444d2987"
dependencies = [
"loom",
"once_cell",
@@ 4013,9 4015,9 @@ dependencies = [
[[package]]
name = "tracy-client-sys"
-version = "0.22.0"
+version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3db0b1cc1bb12a70457300d9affc07acb587390d971a796dac2f4d9bca8df776"
+checksum = "078c7ed72141b0e4369671a7f7af0eecffe18d753bf0296adca9c7add7276c9d"
dependencies = [
"cc",
]
@@ 4150,7 4152,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
"wasm-bindgen-shared",
]
@@ 4184,7 4186,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ 4641,9 4643,9 @@ dependencies = [
[[package]]
name = "winnow"
-version = "0.5.28"
+version = "0.5.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c830786f7720c2fd27a1a0e27a709dbd3c4d009b56d098fc742d4f4eab91fe2"
+checksum = "b7520bbdec7211caa7c4e682eb1fbe07abe20cee6756b6e00f537c82c11816aa"
dependencies = [
"memchr",
]
@@ 4656,40 4658,39 @@ checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a"
[[package]]
name = "zerocopy"
-version = "0.7.30"
+version = "0.7.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "306dca4455518f1f31635ec308b6b3e4eb1b11758cefafc782827d0aa7acb5c7"
+checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
-version = "0.7.30"
+version = "0.7.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be912bf68235a88fbefd1b73415cb218405958d1655b2ece9035a19920bdf6ba"
+checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.41",
+ "syn 2.0.48",
]
[[package]]
name = "zstd"
-version = "0.12.4"
+version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c"
+checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110"
dependencies = [
"zstd-safe",
]
[[package]]
name = "zstd-safe"
-version = "6.0.6"
+version = "7.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581"
+checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e"
dependencies = [
- "libc",
"zstd-sys",
]
M Cargo.toml => Cargo.toml +6 -1
@@ 9,4 9,9 @@ members = [
resolver = "2"
[profile.dev.package."*"]
-opt-level = 3>
\ No newline at end of file
+opt-level = 3
+
+[profile.release-ci]
+inherits = "release"
+codegen-units = 1
+lto = "fat"<
\ No newline at end of file
M ansible/environments/beta.yml => ansible/environments/beta.yml +16 -1
@@ 2,7 2,22 @@ gameservers:
hosts:
srv01.beta.envs.starkingdoms.io:
ansible_port: 20451
- ansible_password: TODO_PUT_THIS_HERE
+ ansible_password: !vault |
+ $ANSIBLE_VAULT;1.1;AES256
+ 33386562363537373139313435386332323434366136346166393864336538306634373233323666
+ 6632646535373462313665663433663533393038353132370a366634323765633031313265313264
+ 37616232666538383737306461336131623634623534646161623738333861633662613464396232
+ 3665373430376137640a663435616461323732316632343061353336366538383937363830663132
+ 61303033353330653065353465663437303030663733646662636539353164396237626435383534
+ 3765366461396264393563616638393138633233303537303466
+ ansible_become_password: !vault |
+ $ANSIBLE_VAULT;1.1;AES256
+ 33386562363537373139313435386332323434366136346166393864336538306634373233323666
+ 6632646535373462313665663433663533393038353132370a366634323765633031313265313264
+ 37616232666538383737306461336131623634623534646161623738333861633662613464396232
+ 3665373430376137640a663435616461323732316632343061353336366538383937363830663132
+ 61303033353330653065353465663437303030663733646662636539353164396237626435383534
+ 3765366461396264393563616638393138633233303537303466
vars:
ansible_user: stk
apiservers:
M ansible/environments/stable.yml => ansible/environments/stable.yml +16 -1
@@ 2,7 2,22 @@ gameservers:
hosts:
srv01.stable.envs.starkingdoms.io:
ansible_port: 20450
- ansible_password: TODO_PUT_THIS_HERE
+ ansible_password: !vault |
+ $ANSIBLE_VAULT;1.1;AES256
+ 35333334373234333231336333623532656638326438323230656133326362653465613739346636
+ 6139383536323339343963663763656439396564323633660a666237666537653639636431303664
+ 39663839623466646233313930306234653039393866336165363763363430393539383138643939
+ 6438653437373565300a343763373037383265626434316362393866336234633730386664326435
+ 32666335356338633339353839623539343234393465343061323730623366653563656135366237
+ 6633653335383836636333393064623139646366383831393430
+ ansible_become_password: !vault |
+ $ANSIBLE_VAULT;1.1;AES256
+ 35333334373234333231336333623532656638326438323230656133326362653465613739346636
+ 6139383536323339343963663763656439396564323633660a666237666537653639636431303664
+ 39663839623466646233313930306234653039393866336165363763363430393539383138643939
+ 6438653437373565300a343763373037383265626434316362393866336234633730386664326435
+ 32666335356338633339353839623539343234393465343061323730623366653563656135366237
+ 6633653335383836636333393064623139646366383831393430
vars:
ansible_user: stk
apiservers:
M bevy_tungstenite_stk/src/lib.rs => bevy_tungstenite_stk/src/lib.rs +13 -6
@@ 1,6 1,6 @@
use bevy::app::{App, Plugin, PostUpdate, Startup};
use bevy::ecs::event::ManualEventReader;
-use bevy::log::warn;
+use bevy::log::{warn, error};
use bevy::prelude::{Commands, Event, Events, Local, Res, ResMut, Resource};
use crossbeam_channel::{unbounded, Receiver, Sender};
use std::collections::HashMap;
@@ 64,9 64,7 @@ impl StkTungsteniteServerPlugin {
thread::spawn(move || {
loop {
- let (stream, this_addr) = listener
- .accept()
- .expect("failed to accept incoming connection");
+ let (stream, this_addr) = listener.accept().unwrap();
let upgraded = match tungstenite::accept(stream) {
Ok(up) => up,
@@ 108,7 106,10 @@ impl StkTungsteniteServerPlugin {
.send(WsEvent::Close { addr: this_addr })
.expect("failed to send on stream");
}
- e => panic!("{:?}", e),
+ e => {
+ error!("error sending to {}: {}", this_addr, e);
+ break;
+ }
},
}
}
@@ 133,7 134,13 @@ impl StkTungsteniteServerPlugin {
let mut l_stream = WebSocket::from_raw_socket(fd_ref, Role::Server, None);
let l_gtx = tx.clone();
move || loop {
- let msg = l_stream.read().expect("failed to read message from stream");
+ let msg = match l_stream.read() {
+ Ok(m) => m,
+ Err(e) => {
+ error!("error reading from stream: {}", e);
+ break;
+ }
+ };
if let Message::Close(_) = msg {
let _ = l_stream.close(None);
l_gtx.send(WsEvent::Close { addr: this_addr }).unwrap();
M server/Cargo.toml => server/Cargo.toml +2 -1
@@ 1,6 1,6 @@
[package]
name = "starkingdoms-server"
-version = "0.0.1"
+version = "0.1.0-alpha1"
edition = "2021"
license = "AGPL-3"
@@ 17,6 17,7 @@ sha2 = "0.10"
hmac = "0.12"
hex = "0.4"
bevy_tungstenite_stk = { version = "0.1", path = "../bevy_tungstenite_stk" }
+tikv-jemallocator = "0.5.0"
[features]
default = []
M server/src/main.rs => server/src/main.rs +122 -18
@@ 16,22 16,29 @@
#![allow(clippy::type_complexity)] // bevy :(
#![allow(clippy::too_many_arguments)] // bevy :(
#![allow(clippy::only_used_in_recursion)] // todo: remove this
+#[global_allocator]
+static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
use std::net::IpAddr;
use crate::mathutil::rot2d;
-use bevy::log::Level;
-use bevy::log::LogPlugin;
use bevy::math::{vec2, vec3};
use bevy::{
- app::ScheduleRunnerPlugin, ecs::event::ManualEventReader, prelude::*, time::TimePlugin,
+ app::{PluginGroupBuilder, ScheduleRunnerPlugin},
+ ecs::event::ManualEventReader,
+ prelude::*,
+ time::TimePlugin,
};
use bevy_rapier2d::prelude::*;
use bevy_tungstenite_stk::{StkTungsteniteServerConfig, StkTungsteniteServerPlugin, WsEvent};
use component::Input;
use component::*;
+use hmac::{Hmac, Mac};
+use jwt::VerifyWithKey;
use packet::*;
use rand::Rng;
+use serde::{Deserialize, Serialize};
+use sha2::Sha256;
use starkingdoms_common::SaveModule;
use starkingdoms_common::{pack_savefile, unpack_savefile, SaveData};
use std::f32::consts::PI;
@@ 43,7 50,7 @@ pub mod macros;
pub mod mathutil;
pub mod packet;
-const CLIENT_SCALE: f32 = 50.;
+const CLIENT_SCALE: f32 = 50.0;
const EARTH_SIZE: f32 = 20.0;
const MOON_SIZE: f32 = EARTH_SIZE / 4.;
@@ 59,35 66,73 @@ const PART_HALF_SIZE: f32 = 25.0;
const HEARTY_THRUSTER_FORCE: f32 = 0.3;
const LANDING_THRUSTER_FORCE: f32 = 5.;
-const HEARTY_MASS: f32 = 1.;
+const HEARTY_MASS: f32 = 1.0;
const CARGO_MASS: f32 = 0.5;
-const HUB_MASS: f32 = 1.;
+const HUB_MASS: f32 = 1.0;
const LANDING_THRUSTER_MASS: f32 = 0.9;
// maybe make this only cargo modules later
const FREE_MODULE_CAP: usize = 30;
+struct StkPluginGroup;
+
+#[cfg(debug_assertions)]
+impl PluginGroup for StkPluginGroup {
+ fn build(self) -> PluginGroupBuilder {
+ PluginGroupBuilder::start::<Self>()
+ .add(TaskPoolPlugin::default())
+ .add(TypeRegistrationPlugin)
+ .add(FrameCountPlugin)
+ .add(TimePlugin)
+ .add(ScheduleRunnerPlugin::run_loop(Duration::from_millis(1)))
+ .add(bevy::log::LogPlugin {
+ level: bevy::log::Level::DEBUG,
+ filter: "wgpu=error,bevy_render=info,bevy_ecs=trace".to_string(),
+ })
+ }
+}
+
+#[cfg(not(debug_assertions))]
+impl PluginGroup for StkPluginGroup {
+ fn build(self) -> PluginGroupBuilder {
+ PluginGroupBuilder::start::<Self>()
+ .add(TaskPoolPlugin::default())
+ .add(TypeRegistrationPlugin)
+ .add(FrameCountPlugin)
+ .add(TimePlugin)
+ .add(ScheduleRunnerPlugin::run_loop(Duration::from_millis(1)))
+ }
+}
+
+#[derive(Serialize, Deserialize, Debug, Clone)]
+pub struct UserToken {
+ pub id: i64,
+ pub username: String,
+ pub permission_level: i32,
+ pub expires: std::time::SystemTime,
+}
+
+pub const REQUIRED_PERM_LEVEL: i32 = 10;
+
+#[derive(Deserialize)]
+struct KeyJson {
+ app_key: String,
+}
+
fn main() {
// read the key in
- let key = std::fs::read_to_string("/etc/starkingdoms/app_key").unwrap();
+ let key = std::fs::read_to_string("/etc/starkingdoms/keys.json").unwrap();
+ let keyjson: KeyJson = serde_json::from_str(&key).unwrap();
App::new()
.insert_resource(AppKeys {
- app_key: key.into_bytes(),
+ app_key: keyjson.app_key.as_bytes().to_vec(),
})
.insert_resource(StkTungsteniteServerConfig {
addr: IpAddr::from_str("0.0.0.0").unwrap(),
port: 3000,
})
- .add_plugins(TaskPoolPlugin::default())
- .add_plugins(TypeRegistrationPlugin)
- .add_plugins(FrameCountPlugin)
- .add_plugins(TimePlugin)
- .add_plugins(ScheduleRunnerPlugin::run_loop(Duration::from_millis(1)))
- .add_plugins(LogPlugin {
- level: Level::DEBUG,
- filter: "wgpu=error,bevy_render=info,bevy_ecs=trace".to_string(),
- })
+ .add_plugins(StkPluginGroup)
.insert_resource(RapierConfiguration {
gravity: Vect { x: 0.0, y: 0.0 },
..Default::default()
@@ 268,8 313,46 @@ fn on_message(
Packet::ClientLogin {
username,
save,
- jwt: _,
+ jwt,
} => {
+ // auth
+ // plz no remove
+ if let Some(token) = jwt {
+ let key: Hmac<Sha256> = Hmac::new_from_slice(&app_keys.app_key).unwrap();
+ let claims: UserToken = match token.verify_with_key(&key) {
+ Ok(c) => c,
+ Err(e) => {
+ event_queue.push(WsEvent::Send {
+ to: *from,
+ message: Packet::Message { message_type: MessageType::Error, actor: "SERVER".to_string(), content: format!("Token is invalid or verification failed: {e}. Please log in again, or contact StarKingdoms staff if the problem persists.") }.into(),
+ });
+ event_queue.push(WsEvent::Close { addr: *from });
+ continue;
+ }
+ };
+
+ if claims.permission_level < REQUIRED_PERM_LEVEL {
+ event_queue.push(WsEvent::Send {
+ to: *from,
+ message: Packet::Message { message_type: MessageType::Error, actor: "SERVER".to_string(), content: format!("Permission level {} is too low, {REQUIRED_PERM_LEVEL} is required. If your permissions were just changed, you need to log out and log back in for the change to take effect. If you believe this is a mistake, contact StarKingdoms staff.", claims.permission_level) }.into(),
+ });
+ event_queue.push(WsEvent::Close { addr: *from });
+ continue;
+ }
+
+ event_queue.push(WsEvent::Send {
+ to: *from,
+ message: Packet::Message { message_type: MessageType::Server, actor: "StarKingdoms Team".to_string(), content: "Thank you for participating in the StarKingdoms private alpha! Your feedback is essential to improving the game, so please give us any feedback you have in the Discord! <3".to_string() }.into(),
+ });
+ } else if REQUIRED_PERM_LEVEL != 0 {
+ event_queue.push(WsEvent::Send {
+ to: *from,
+ message: Packet::Message { message_type: MessageType::Error, actor: "SERVER".to_string(), content: "Authentication is required to join this server at the moment. Log in and try again, or try again later.".to_string() }.into(),
+ });
+ event_queue.push(WsEvent::Close { addr: *from });
+ continue;
+ }
+
let angle: f32 = {
let mut rng = rand::thread_rng();
rng.gen::<f32>() * std::f32::consts::PI * 2.
@@ 447,12 530,33 @@ fn on_message(
let packet = Packet::Message {
message_type: packet::MessageType::Server,
actor: "SERVER".to_string(),
+ content: format!(
+ "starkingdoms-server v{} says hello",
+ env!("CARGO_PKG_VERSION")
+ ),
+ };
+ event_queue.push(WsEvent::Send {
+ to: *from,
+ message: packet.into(),
+ });
+ let packet = Packet::Message {
+ message_type: packet::MessageType::Server,
+ actor: "SERVER".to_string(),
content: "Welcome to StarKingdoms.IO! Have fun!".to_string(),
};
event_queue.push(WsEvent::Send {
to: *from,
message: packet.into(),
});
+ let packet = Packet::Message {
+ message_type: packet::MessageType::Server,
+ actor: "SERVER".to_string(),
+ content: "Found a bug? Have a feature request? Please bring this and all other feedback to the game's official Discord server! Join here: https://discord.gg/3u7Yw8DWtQ".to_string(),
+ };
+ event_queue.push(WsEvent::Send {
+ to: *from,
+ message: packet.into(),
+ });
}
Packet::SendMessage { target, content } => {
// find our player
M starkingdoms-client/src/assets/starfield.svg => starkingdoms-client/src/assets/starfield.svg +0 -75
@@ 7,43 7,12 @@
viewBox="0 0 203.19999 203.20001"
version="1.1"
id="svg3372"
- inkscape:export-filename="/home/tm85/prj/stk_sprites/starfield.png"
- inkscape:export-xdpi="64"
- inkscape:export-ydpi="64"
- inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
- sodipodi:docname="starfield.ink.svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
- <sodipodi:namedview
- id="namedview3374"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageshadow="2"
- inkscape:pageopacity="0.0"
- inkscape:pagecheckerboard="true"
- inkscape:document-units="px"
- showgrid="false"
- units="px"
- width="512px"
- inkscape:snap-object-midpoints="true"
- inkscape:zoom="1"
- inkscape:cx="512.5"
- inkscape:cy="351.5"
- inkscape:window-width="1270"
- inkscape:window-height="1412"
- inkscape:window-x="4"
- inkscape:window-y="20"
- inkscape:window-maximized="1"
- inkscape:current-layer="layer1" />
<defs
id="defs3369" />
<g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
id="layer1">
<rect
style="fill:#000000;fill-opacity:1;stroke-width:0.264582"
@@ 72,7 41,6 @@
r="2.1166666" />
<use
id="use9119"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 81,7 49,6 @@
transform="matrix(0.5,0,0,0.5,-117.70647,90.433444)" />
<use
id="use9121"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 90,7 57,6 @@
transform="matrix(0.5,0,0,0.5,-74.466367,39.830974)" />
<use
id="use9123"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 99,7 65,6 @@
transform="matrix(0.5,0,0,0.5,-87.026677,57.668596)" />
<use
id="use9123-2"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 108,7 73,6 @@
transform="matrix(0.5,0,0,0.5,116.17339,57.668596)" />
<use
id="use9125"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 117,7 81,6 @@
transform="matrix(0.5,0,0,0.5,-27.602197,41.067791)" />
<use
id="use9127"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 126,7 89,6 @@
transform="matrix(0.5,0,0,0.5,2.5243312,57.170401)" />
<use
id="use9129"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 135,7 97,6 @@
transform="matrix(0.5,0,0,0.5,12.167156,-3.2600651)" />
<use
id="use9131"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 144,7 105,6 @@
transform="matrix(0.5,0,0,0.5,89.028973,36.353197)" />
<use
id="use9133"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 153,7 113,6 @@
transform="matrix(0.5,0,0,0.5,95.86754,10.585474)" />
<use
id="use9135"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 162,7 121,6 @@
transform="matrix(0.5,0,0,0.5,27.276996,29.994654)" />
<use
id="use9137"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 171,7 129,6 @@
transform="matrix(0.5,0,0,0.5,61.996373,-80.498595)" />
<use
id="use9139"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 180,7 137,6 @@
transform="matrix(0.5,0,0,0.5,-2.2781878,-62.090325)" />
<use
id="use9141"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 189,7 145,6 @@
transform="matrix(0.5,0,0,0.5,64.896114,-9.2519051)" />
<use
id="use9141-6"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 198,7 153,6 @@
transform="matrix(0.5,0,0,0.5,-64.869047,-18.896665)" />
<use
id="use9141-6-2"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 207,7 161,6 @@
transform="matrix(0.5,0,0,0.5,-40.718957,-107.77145)" />
<use
id="use9141-6-2-9"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 216,7 169,6 @@
transform="matrix(0.5,0,0,0.5,-40.718967,95.428541)" />
<use
id="use9143"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 225,7 177,6 @@
transform="matrix(0.5,0,0,0.5,-23.695727,-12.656745)" />
<use
id="use9145"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 234,7 185,6 @@
transform="matrix(0.5,0,0,0.5,-102.76199,-58.706835)" />
<use
id="use9147"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 243,7 193,6 @@
transform="matrix(0.5,0,0,0.5,-73.678867,-45.603105)" />
<use
id="use9149"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 252,7 201,6 @@
transform="matrix(0.5,0,0,0.5,-113.96472,-90.033295)" />
<use
id="use9151"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 261,7 209,6 @@
transform="matrix(0.5,0,0,0.5,-95.963797,-117.61499)" />
<use
id="use9153"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 270,7 217,6 @@
transform="matrix(0.5,0,0,0.5,-54.019037,-96.873615)" />
<use
id="use9155"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 279,7 225,6 @@
transform="matrix(0.5,0,0,0.5,-44.816717,-59.764305)" />
<use
id="use9157"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 288,7 233,6 @@
transform="matrix(0.5,0,0,0.5,64.030044,-162.1849)" />
<use
id="use9159"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 297,7 241,6 @@
transform="matrix(0.5,0,0,0.5,109.16826,-85.269965)" />
<use
id="use9161"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 306,7 249,6 @@
transform="matrix(0.5,0,0,0.5,159.2623,-75.335595)" />
<use
id="use9163"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 315,7 257,6 @@
transform="matrix(0.5,0,0,0.5,101.24301,-40.605745)" />
<use
id="use9165"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 324,7 265,6 @@
transform="matrix(0.5,0,0,0.5,165.31357,-101.14033)" />
<use
id="use10351"
- inkscape:spray-origin="#path3546"
xlink:href="#path3546"
x="0"
y="0"
@@ 333,7 273,6 @@
transform="matrix(0.5,0,0,0.5,26.622351,-40.804639)" />
<use
id="use10353"
- inkscape:spray-origin="#path3546"
xlink:href="#path3546"
x="0"
y="0"
@@ 342,7 281,6 @@
transform="matrix(0.5,0,0,0.5,12.252463,-0.22730887)" />
<use
id="use9129-0"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 351,7 289,6 @@
transform="matrix(0.5,0,0,0.5,31.615387,-103.19598)" />
<use
id="use9129-9"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
@@ 360,7 297,6 @@
transform="matrix(0.5,0,0,0.5,82.02536,74.996004)" />
<use
id="use10355"
- inkscape:spray-origin="#path3546"
xlink:href="#path3546"
x="0"
y="0"
@@ 369,7 305,6 @@
transform="matrix(0.5,0,0,0.5,-31.446262,-52.611369)" />
<use
id="use10357"
- inkscape:spray-origin="#path3546"
xlink:href="#path3546"
x="0"
y="0"
@@ 378,7 313,6 @@
transform="matrix(0.5,0,0,0.5,-40.750042,22.854617)" />
<use
id="use10359"
- inkscape:spray-origin="#path3546"
xlink:href="#path3546"
x="0"
y="0"
@@ 387,7 321,6 @@
transform="matrix(0.5,0,0,0.5,72.769863,-73.105809)" />
<use
id="use10361"
- inkscape:spray-origin="#path3546"
xlink:href="#path3546"
x="0"
y="0"
@@ 396,7 329,6 @@
transform="matrix(0.5,0,0,0.5,-67.880292,57.91203)" />
<use
id="use10363"
- inkscape:spray-origin="#path3546"
xlink:href="#path3546"
x="0"
y="0"
@@ 405,7 337,6 @@
transform="matrix(0.5,0,0,0.5,93.57234,-33.857509)" />
<use
id="use10365"
- inkscape:spray-origin="#path3546"
xlink:href="#path3546"
x="0"
y="0"
@@ 414,7 345,6 @@
transform="matrix(0.5,0,0,0.5,-1.0893901,-97.090089)" />
<use
id="use10367"
- inkscape:spray-origin="#path3546"
xlink:href="#path3546"
x="0"
y="0"
@@ 423,7 353,6 @@
transform="matrix(0.5,0,0,0.5,45.021777,22.343368)" />
<use
id="use10369"
- inkscape:spray-origin="#path3546"
xlink:href="#path3546"
x="0"
y="0"
@@ 432,7 361,6 @@
transform="matrix(0.5,0,0,0.5,95.44009,96.823387)" />
<use
id="use10369-1"
- inkscape:spray-origin="#path3546"
xlink:href="#path3546"
x="0"
y="0"
@@ 441,7 369,6 @@
transform="matrix(0.5,0,0,0.5,95.44009,-106.37654)" />
<use
id="use10371"
- inkscape:spray-origin="#path3546"
xlink:href="#path3546"
x="0"
y="0"
@@ 450,7 377,6 @@
transform="matrix(0.5,0,0,0.5,38.374784,60.568013)" />
<use
id="use10373"
- inkscape:spray-origin="#path3546"
xlink:href="#path3546"
x="0"
y="0"
@@ 459,7 385,6 @@
transform="matrix(0.5,0,0,0.5,20.710442,83.652262)" />
<use
id="use9129-6"
- inkscape:spray-origin="#path3544"
xlink:href="#path3544"
x="0"
y="0"
M starkingdoms-client/src/assets/starfield_dim.svg => starkingdoms-client/src/assets/starfield_dim.svg +52 -52
@@ 2,8 2,8 @@
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
- width="768"
- height="768"
+ width="384"
+ height="384"
viewBox="0 0 203.19999 203.20001"
version="1.1"
id="svg3372"
@@ 11,7 11,7 @@
inkscape:export-xdpi="64"
inkscape:export-ydpi="64"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)"
- sodipodi:docname="starfield.svg"
+ sodipodi:docname="starfield_dim.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
@@ 31,8 31,8 @@
width="512px"
inkscape:snap-object-midpoints="true"
inkscape:zoom="0.5"
- inkscape:cx="499"
- inkscape:cy="314"
+ inkscape:cx="533"
+ inkscape:cy="448"
inkscape:window-width="1270"
inkscape:window-height="704"
inkscape:window-x="1282"
@@ 55,19 55,19 @@
x="7.1054274e-15"
y="7.1054274e-15" />
<circle
- style="fill:#7f7f7f;fill-opacity:1;stroke-width:0.132291"
+ style="fill:#5f5f5f;fill-opacity:1;stroke-width:0.132291"
id="path3542"
cx="195.87514"
cy="245.92468"
r="1.5875" />
<circle
- style="fill:#7f7f7f;fill-opacity:1;stroke-width:0.132291"
+ style="fill:#5f5f5f;fill-opacity:1;stroke-width:0.132291"
id="path3544"
cx="171.50687"
cy="217.02829"
r="1.0583333" />
<circle
- style="fill:#7f7f7f;fill-opacity:1;stroke-width:0.132291"
+ style="fill:#5f5f5f;fill-opacity:1;stroke-width:0.132291"
id="path3546"
cx="196.42812"
cy="219.08032"
@@ 81,7 81,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-117.70647,90.433444)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9121"
inkscape:spray-origin="#path3544"
@@ 91,7 91,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-74.466367,39.830974)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9123"
inkscape:spray-origin="#path3544"
@@ 101,7 101,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-87.026677,57.668596)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9123-2"
inkscape:spray-origin="#path3544"
@@ 111,7 111,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,116.17339,57.668596)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9125"
inkscape:spray-origin="#path3544"
@@ 121,7 121,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-27.602197,41.067791)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9127"
inkscape:spray-origin="#path3544"
@@ 131,7 131,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,2.5243312,57.170401)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9129"
inkscape:spray-origin="#path3544"
@@ 141,7 141,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,12.167156,-3.2600651)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9131"
inkscape:spray-origin="#path3544"
@@ 151,7 151,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,89.028973,36.353197)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9133"
inkscape:spray-origin="#path3544"
@@ 161,7 161,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,95.86754,10.585474)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9135"
inkscape:spray-origin="#path3544"
@@ 171,7 171,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,27.276996,29.994654)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9137"
inkscape:spray-origin="#path3544"
@@ 181,7 181,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,61.996373,-80.498595)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9139"
inkscape:spray-origin="#path3544"
@@ 191,7 191,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-2.2781878,-62.090325)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9141"
inkscape:spray-origin="#path3544"
@@ 201,7 201,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,64.896114,-9.2519051)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9141-6"
inkscape:spray-origin="#path3544"
@@ 211,7 211,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-64.869047,-18.896665)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9141-6-2"
inkscape:spray-origin="#path3544"
@@ 221,7 221,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-40.718957,-107.77145)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9141-6-2-9"
inkscape:spray-origin="#path3544"
@@ 231,7 231,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-40.718967,95.428541)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9143"
inkscape:spray-origin="#path3544"
@@ 241,7 241,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-23.695727,-12.656745)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9145"
inkscape:spray-origin="#path3544"
@@ 251,7 251,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-102.76199,-58.706835)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9147"
inkscape:spray-origin="#path3544"
@@ 261,7 261,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-73.678867,-45.603105)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9149"
inkscape:spray-origin="#path3544"
@@ 271,7 271,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-113.96472,-90.033295)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9151"
inkscape:spray-origin="#path3544"
@@ 281,7 281,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-95.963797,-117.61499)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9153"
inkscape:spray-origin="#path3544"
@@ 291,7 291,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-54.019037,-96.873615)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9155"
inkscape:spray-origin="#path3544"
@@ 301,7 301,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-44.816717,-59.764305)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9157"
inkscape:spray-origin="#path3544"
@@ 311,7 311,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,64.030044,-162.1849)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9159"
inkscape:spray-origin="#path3544"
@@ 321,7 321,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,109.16826,-85.269965)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9161"
inkscape:spray-origin="#path3544"
@@ 331,7 331,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,159.2623,-75.335595)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9163"
inkscape:spray-origin="#path3544"
@@ 341,7 341,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,101.24301,-40.605745)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9165"
inkscape:spray-origin="#path3544"
@@ 351,7 351,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,165.31357,-101.14033)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use10351"
inkscape:spray-origin="#path3546"
@@ 361,7 361,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,26.622351,-40.804639)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use10353"
inkscape:spray-origin="#path3546"
@@ 371,7 371,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,12.252463,-0.22730887)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9129-0"
inkscape:spray-origin="#path3544"
@@ 381,7 381,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,31.615387,-103.19598)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9129-9"
inkscape:spray-origin="#path3544"
@@ 391,7 391,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,82.02536,74.996004)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use10355"
inkscape:spray-origin="#path3546"
@@ 401,7 401,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-31.446262,-52.611369)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use10357"
inkscape:spray-origin="#path3546"
@@ 411,7 411,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-40.750042,22.854617)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use10359"
inkscape:spray-origin="#path3546"
@@ 421,7 421,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,72.769863,-73.105809)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use10361"
inkscape:spray-origin="#path3546"
@@ 431,7 431,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-67.880292,57.91203)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use10363"
inkscape:spray-origin="#path3546"
@@ 441,7 441,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,93.57234,-33.857509)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use10365"
inkscape:spray-origin="#path3546"
@@ 451,7 451,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-1.0893901,-97.090089)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use10367"
inkscape:spray-origin="#path3546"
@@ 461,7 461,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,45.021777,22.343368)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use10369"
inkscape:spray-origin="#path3546"
@@ 471,7 471,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,95.44009,96.823387)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use10369-1"
inkscape:spray-origin="#path3546"
@@ 481,7 481,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,95.44009,-106.37654)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use10371"
inkscape:spray-origin="#path3546"
@@ 491,7 491,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,38.374784,60.568013)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use10373"
inkscape:spray-origin="#path3546"
@@ 501,7 501,7 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,20.710442,83.652262)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
<use
id="use9129-6"
inkscape:spray-origin="#path3544"
@@ 511,6 511,6 @@
width="100%"
height="100%"
transform="matrix(0.5,0,0,0.5,-20.962797,-86.013975)"
- style="fill:#7f7f7f;fill-opacity:1" />
+ style="fill:#5f5f5f;fill-opacity:1" />
</g>
</svg>
M starkingdoms-client/src/globals.ts => starkingdoms-client/src/globals.ts +8 -0
@@ 29,6 29,14 @@ export interface GlobalRendering {
planet_sprite_map: Map<number, PIXI.Sprite>;
part_sprite_map: Map<number, PIXI.Sprite>;
part_sprites_need_texture_change: number[];
+ starfield: GlobalRenderingStarfield;
+ starfield_near: GlobalRenderingStarfield;
+}
+
+export interface GlobalRenderingStarfield {
+ sprite: PIXI.TilingSprite;
+ off_x: number;
+ off_y: number;
}
export interface GlobalMe {
M starkingdoms-client/src/pages/Play.svelte => starkingdoms-client/src/pages/Play.svelte +7 -10
@@ 11,6 11,7 @@
import Popup from "../components/ui/Popup.svelte";
import Checkbox from "../components/ui/Checkbox.svelte";
import { global } from "../globals.ts";
+ import * as PIXI from "pixi.js";
let config = DEFAULT_CONFIG;
@@ 18,7 19,7 @@
let x_pos;
let y_pos;
- let antialiasing: boolean = false;
+ //let antialiasing: boolean = false;
let chatbox: Chatbox;
@@ 28,10 29,11 @@
);
logger("Current view: /play");
- function toggleAntialiasing() {
- global.rendering!.app.antialiasing = antialiasing.title;
- //logger("Antialiasing is now", antialiasing.checked ? "on" : "off");
- }
+ /*function toggleAntialiasing() {
+ global.rendering!.app.renderer.reset();
+ PIXI.settings.RENDER_OPTIONS.antialias = antialiasing;
+ logger("Antialiasing is now", antialiasing ? "on" : "off");
+ }*/
onMount(async () => {
config = await loadConfig();
@@ 124,11 126,6 @@
<label for="dev_mode">Developer mode (Advanced)</label>
<Checkbox
title="Enables tools intended only for the developers. Buggy. Use at your own risk." />
- <label for="antialiasing">Antialiasing</label>
- <Checkbox
- title="Smooth out jagged edges. Minor performance hit."
- bind:checked={antialiasing}
- on:click={toggleAntialiasing} />
</Popup>
</div>
M starkingdoms-client/src/rendering.ts => starkingdoms-client/src/rendering.ts +23 -22
@@ 13,6 13,7 @@ export function startRender() {
height: window.innerHeight,
resizeTo: window,
hello: true,
+ antialias: true,
});
(globalThis as any).__PIXI_APP__ = app; // eslint-disable-line
@@ 30,8 31,6 @@ export function startRender() {
starfield: {
sprite: new PIXI.TilingSprite(
PIXI.Texture.from(tex_starfield),
- window.innerHeight,
- window.innerWidth,
//1024,
//1024,
),
@@ 41,8 40,6 @@ export function startRender() {
starfield_near: {
sprite: new PIXI.TilingSprite(
PIXI.Texture.from(tex_starfield_transp),
- window.innerHeight,
- window.innerWidth,
//1024,
//1024,
),
@@ 54,15 51,15 @@ export function startRender() {
// Main starfield
global.rendering!.app.stage.addChild(global.rendering!.starfield.sprite);
- global.rendering!.starfield.sprite.height = window.innerHeight + 384;
- global.rendering!.starfield.sprite.width = window.innerWidth + 384;
// Near starfield
global.rendering!.app.stage.addChild(global.rendering!.starfield_near.sprite);
- global.rendering!.starfield_near.sprite.height = window.innerHeight + 768;
- global.rendering!.starfield_near.sprite.width = window.innerWidth + 768;
app.ticker.add(() => {
+ if (player() === undefined) {
+ return;
+ }
+
global.rendering!.app.stage.x =
-player()?.transform.x! + window.innerWidth / 2;
global.rendering!.app.stage.y =
@@ 71,40 68,44 @@ export function startRender() {
// TODO: refactor, make parallax configurable
// Main starfield
+ global.rendering!.starfield.sprite.height = window.innerHeight + 384;
+ global.rendering!.starfield.sprite.width = window.innerWidth + 384;
+
global.rendering!.starfield.off_x =
- ((global.parts_map.get(global.me?.part_id).transform.x * 3) / 4) % 384;
+ ((player()?.transform.x! * 3) / 4) % 384;
global.rendering!.starfield.off_y =
- ((global.parts_map.get(global.me?.part_id).transform.y * 3) / 4) % 384;
+ ((player()?.transform.y! * 3) / 4) % 384;
+
global.rendering!.starfield.sprite.x =
- Math.floor(global.parts_map.get(global.me?.part_id).transform.x / 384) *
- 384 -
+ Math.floor(player()?.transform.x! / 384) * 384 -
global.rendering!.starfield.sprite.width / 2 +
192;
global.rendering!.starfield.sprite.y =
- Math.floor(global.parts_map.get(global.me?.part_id).transform.y / 384) *
- 384 -
+ Math.floor(player()?.transform.y! / 384) * 384 -
global.rendering!.starfield.sprite.height / 2 +
192;
+
global.rendering!.starfield.sprite.tilePosition.x =
global.rendering!.starfield.off_x;
global.rendering!.starfield.sprite.tilePosition.y =
global.rendering!.starfield.off_y;
// Near starfield
- global.rendering!.starfield_near.off_x =
- (global.parts_map.get(global.me?.part_id).transform.x / 2) % 768;
- global.rendering!.starfield_near.off_y =
- (global.parts_map.get(global.me?.part_id).transform.y / 2) % 768;
+ global.rendering!.starfield_near.sprite.height = window.innerHeight + 768;
+ global.rendering!.starfield_near.sprite.width = window.innerWidth + 768;
+
+ global.rendering!.starfield_near.off_x = (player()?.transform.x! / 2) % 768;
+ global.rendering!.starfield_near.off_y = (player()?.transform.y! / 2) % 768;
+
global.rendering!.starfield_near.sprite.x =
- Math.floor(global.parts_map.get(global.me?.part_id).transform.x / 768) *
- 768 -
+ Math.floor(player()?.transform.x! / 768) * 768 -
global.rendering!.starfield_near.sprite.width / 2 +
384;
global.rendering!.starfield_near.sprite.y =
- Math.floor(global.parts_map.get(global.me?.part_id).transform.y / 768) *
- 768 -
+ Math.floor(player()?.transform.y! / 768) * 768 -
global.rendering!.starfield_near.sprite.height / 2 +
384;
+
global.rendering!.starfield_near.sprite.tilePosition.x =
global.rendering!.starfield_near.off_x;
global.rendering!.starfield_near.sprite.tilePosition.y =