Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency upgrade (wtransport, xwt, mock_instant) #589

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/auth/assets/settings.ron
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ MySettings(
// transport: WebTransport(
// this is only needed for wasm, the self-signed certificates are only valid for 2 weeks
// the server will print the certificate digest on startup
// certificate_digest: "81:f8:e8:9c:44:4e:41:c8:75:4b:09:32:20:06:57:f7:7f:59:51:65:22:c0:c2:32:16:48:42:ca:f6:8c:b8:22",
// certificate_digest: "6e:f2:d6:57:f8:f7:c9:ab:88:ae:59:6b:e8:97:cc:1e:a7:a4:ce:71:17:e1:39:79:4d:c6:2b:79:86:9a:c5:fc",
// ),
server_port: 5001,
transport: Udp,
Expand Down
2 changes: 1 addition & 1 deletion examples/avian_physics/assets/settings.ron
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ MySettings(
transport: WebTransport(
// this is only needed for wasm, the self-signed certificates are only valid for 2 weeks
// the server will print the certificate digest on startup
certificate_digest: "81:f8:e8:9c:44:4e:41:c8:75:4b:09:32:20:06:57:f7:7f:59:51:65:22:c0:c2:32:16:48:42:ca:f6:8c:b8:22",
certificate_digest: "6e:f2:d6:57:f8:f7:c9:ab:88:ae:59:6b:e8:97:cc:1e:a7:a4:ce:71:17:e1:39:79:4d:c6:2b:79:86:9a:c5:fc",
),
// server_port: 5001,
// transport: Udp,
Expand Down
2 changes: 1 addition & 1 deletion examples/bullet_prespawn/assets/settings.ron
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ MySettings(
transport: WebTransport(
// this is only needed for wasm, the self-signed certificates are only valid for 2 weeks
// the server will print the certificate digest on startup
certificate_digest: "81:f8:e8:9c:44:4e:41:c8:75:4b:09:32:20:06:57:f7:7f:59:51:65:22:c0:c2:32:16:48:42:ca:f6:8c:b8:22",
certificate_digest: "6e:f2:d6:57:f8:f7:c9:ab:88:ae:59:6b:e8:97:cc:1e:a7:a4:ce:71:17:e1:39:79:4d:c6:2b:79:86:9a:c5:fc",
),
// server_port: 5001,
// transport: Udp,
Expand Down
18 changes: 9 additions & 9 deletions examples/certificates/cert.pem
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
-----BEGIN CERTIFICATE-----
MIIBfTCCASOgAwIBAgIUPpUAx0wyr+v7qMJ66EdRKu4MxxswCgYIKoZIzj0EAwIw
FDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTI0MDYxNjIxMDYxMVoXDTI0MDYzMDIx
MDYxMVowFDESMBAGA1UEAwwJbG9jYWxob3N0MFkwEwYHKoZIzj0CAQYIKoZIzj0D
AQcDQgAE6t8IW/V37n8luJXNYAu2MwwAjTVJE+b9ew0IhV4FfnpSsKn0H+xNC4zM
QUWtzYc+zNY2OJ7cwKtFTpitVV1+rqNTMFEwHQYDVR0OBBYEFHzlHQLw5t2WzQ4Z
cwzbM1wCS1rcMB8GA1UdIwQYMBaAFHzlHQLw5t2WzQ4ZcwzbM1wCS1rcMA8GA1Ud
EwEB/wQFMAMBAf8wCgYIKoZIzj0EAwIDSAAwRQIhAJzrx4fhoCRdHxxcg7m/OrNT
jWEsbM2PhZgsb4GmjzizAiBvsQ4kmYoEVSEaar1rHsi7May0LPY8oIwq23NAB2ZH
3A==
MIIBfTCCASOgAwIBAgIUDhtPjOSIIhhycN8GnMgcvvmeEq0wCgYIKoZIzj0EAwIw
FDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTI0MDgxMjE0NDcyOVoXDTI0MDgyNjE0
NDcyOVowFDESMBAGA1UEAwwJbG9jYWxob3N0MFkwEwYHKoZIzj0CAQYIKoZIzj0D
AQcDQgAEhrxciv8kq62Dpeblt+sd6e0VYYi0dbIqeoOLSIq8oewoA4sGUM7YjUD0
cKXWZ6ZDgggcT0LQTnu6qEB6RkyMYaNTMFEwHQYDVR0OBBYEFEwm3s3+S3q/8VcP
bIfRrroks9mxMB8GA1UdIwQYMBaAFEwm3s3+S3q/8VcPbIfRrroks9mxMA8GA1Ud
EwEB/wQFMAMBAf8wCgYIKoZIzj0EAwIDSAAwRQIgaP6yCeBgbN9uQSYsLJW/bpIv
qbWcUVxS0TEpuqbwu9ECIQD4KjJ7M/sNGa2kau2uiz+owRLMNchcYgWEUwn71YMi
lA==
-----END CERTIFICATE-----
6 changes: 3 additions & 3 deletions examples/certificates/key.pem
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgWNfKQOaOTxJhigxZ
HucPDgYMYWxCJAjy5pG6NadaxLqhRANCAATq3whb9XfufyW4lc1gC7YzDACNNUkT
5v17DQiFXgV+elKwqfQf7E0LjMxBRa3Nhz7M1jY4ntzAq0VOmK1VXX6u
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgtAgeaY3sKTpz9xEz
vdhPlSEFDyG49Kn45wHxaLfVRBihRANCAASGvFyK/ySrrYOl5uW36x3p7RVhiLR1
sip6g4tIiryh7CgDiwZQztiNQPRwpdZnpkOCCBxPQtBOe7qoQHpGTIxh
-----END PRIVATE KEY-----
2 changes: 1 addition & 1 deletion examples/client_replication/assets/settings.ron
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Settings(
transport: WebTransport(
// this is only needed for wasm, the self-signed certificates are only valid for 2 weeks
// the server will print the certificate digest on startup
certificate_digest: "81:f8:e8:9c:44:4e:41:c8:75:4b:09:32:20:06:57:f7:7f:59:51:65:22:c0:c2:32:16:48:42:ca:f6:8c:b8:22",
certificate_digest: "6e:f2:d6:57:f8:f7:c9:ab:88:ae:59:6b:e8:97:cc:1e:a7:a4:ce:71:17:e1:39:79:4d:c6:2b:79:86:9a:c5:fc",
),
// server_port: 5001,
// transport: Udp,
Expand Down
1 change: 1 addition & 0 deletions examples/common/src/settings.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! This module parses the settings.ron file and builds a lightyear configuration from it
#![allow(unused_imports)]
#![allow(unused_variables)]
use std::net::{Ipv4Addr, SocketAddr};

Expand Down
2 changes: 1 addition & 1 deletion examples/interest_management/assets/settings.ron
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Settings(
transport: WebTransport(
// this is only needed for wasm, the self-signed certificates are only valid for 2 weeks
// the server will print the certificate digest on startup
certificate_digest: "81:f8:e8:9c:44:4e:41:c8:75:4b:09:32:20:06:57:f7:7f:59:51:65:22:c0:c2:32:16:48:42:ca:f6:8c:b8:22",
certificate_digest: "6e:f2:d6:57:f8:f7:c9:ab:88:ae:59:6b:e8:97:cc:1e:a7:a4:ce:71:17:e1:39:79:4d:c6:2b:79:86:9a:c5:fc",
),
// server_port: 5001,
// transport: Udp,
Expand Down
2 changes: 1 addition & 1 deletion examples/lobby/assets/settings.ron
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Settings(
// transport: WebTransport(
// // this is only needed for wasm, the self-signed certificates are only valid for 2 weeks
// // the server will print the certificate digest on startup
// certificate_digest: "81:f8:e8:9c:44:4e:41:c8:75:4b:09:32:20:06:57:f7:7f:59:51:65:22:c0:c2:32:16:48:42:ca:f6:8c:b8:22",
// certificate_digest: "6e:f2:d6:57:f8:f7:c9:ab:88:ae:59:6b:e8:97:cc:1e:a7:a4:ce:71:17:e1:39:79:4d:c6:2b:79:86:9a:c5:fc",
// ),
server_port: 5001,
transport: Udp,
Expand Down
2 changes: 1 addition & 1 deletion examples/priority/assets/settings.ron
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Settings(
transport: WebTransport(
// this is only needed for wasm, the self-signed certificates are only valid for 2 weeks
// the server will print the certificate digest on startup
certificate_digest: "81:f8:e8:9c:44:4e:41:c8:75:4b:09:32:20:06:57:f7:7f:59:51:65:22:c0:c2:32:16:48:42:ca:f6:8c:b8:22",
certificate_digest: "6e:f2:d6:57:f8:f7:c9:ab:88:ae:59:6b:e8:97:cc:1e:a7:a4:ce:71:17:e1:39:79:4d:c6:2b:79:86:9a:c5:fc",
),
// server_port: 5001,
// transport: Udp,
Expand Down
2 changes: 1 addition & 1 deletion examples/replication_groups/assets/settings.ron
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Settings(
transport: WebTransport(
// this is only needed for wasm, the self-signed certificates are only valid for 2 weeks
// the server will print the certificate digest on startup
certificate_digest: "81:f8:e8:9c:44:4e:41:c8:75:4b:09:32:20:06:57:f7:7f:59:51:65:22:c0:c2:32:16:48:42:ca:f6:8c:b8:22",
certificate_digest: "6e:f2:d6:57:f8:f7:c9:ab:88:ae:59:6b:e8:97:cc:1e:a7:a4:ce:71:17:e1:39:79:4d:c6:2b:79:86:9a:c5:fc",
),
// server_port: 5001,
// transport: Udp,
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_box/assets/settings.ron
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Settings(
transport: WebTransport(
// this is only needed for wasm, the self-signed certificates are only valid for 2 weeks
// the server will print the certificate digest on startup
certificate_digest: "ba:cd:94:a4:27:c3:6a:97:1b:de:3d:39:d2:db:e5:9a:63:75:43:29:e9:10:94:18:11:38:79:f0:1a:56:d3:6e",
certificate_digest: "6e:f2:d6:57:f8:f7:c9:ab:88:ae:59:6b:e8:97:cc:1e:a7:a4:ce:71:17:e1:39:79:4d:c6:2b:79:86:9a:c5:fc",
),
// server_port: 5001,
// transport: Udp,
Expand Down
2 changes: 1 addition & 1 deletion examples/spaceships/assets/settings.ron
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ MySettings(
transport: WebTransport(
// this is only needed for wasm, the self-signed certificates are only valid for 2 weeks
// the server will print the certificate digest on startup
certificate_digest: "ba:cd:94:a4:27:c3:6a:97:1b:de:3d:39:d2:db:e5:9a:63:75:43:29:e9:10:94:18:11:38:79:f0:1a:56:d3:6e",
certificate_digest: "6e:f2:d6:57:f8:f7:c9:ab:88:ae:59:6b:e8:97:cc:1e:a7:a4:ce:71:17:e1:39:79:4d:c6:2b:79:86:9a:c5:fc",
),
// server_port: 5001,
// transport: Udp,
Expand Down
98 changes: 49 additions & 49 deletions lightyear/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ exclude = ["/tests"]
big_messages = []
trace = []
metrics = [
"dep:metrics",
"metrics-util",
"metrics-tracing-context",
"metrics-exporter-prometheus",
"dep:metrics",
"metrics-util",
"metrics-tracing-context",
"metrics-exporter-prometheus",
]
mock_time = ["dep:mock_instant"]
webtransport = [
"dep:wtransport",
"dep:xwt-core",
"dep:xwt-web-sys",
"dep:web-sys",
"dep:ring",
"dep:wasm-bindgen-futures",
"dep:wtransport",
"dep:xwt-core",
"dep:xwt-web-sys",
"dep:web-sys",
"dep:ring",
"dep:wasm-bindgen-futures",
]
leafwing = ["dep:leafwing-input-manager"]
avian2d = ["dep:avian2d"]
avian3d = ["dep:avian3d", "avian3d/3d"]
websocket = [
"dep:tokio-tungstenite",
"dep:futures-util",
"dep:web-sys",
"dep:wasm-bindgen",
"dep:wasm-bindgen-futures",
"dep:tokio-tungstenite",
"dep:futures-util",
"dep:web-sys",
"dep:wasm-bindgen",
"dep:wasm-bindgen-futures",
]
steam = ["dep:steamworks"]

Expand Down Expand Up @@ -87,8 +87,8 @@ lightyear_macros = { version = "0.16.4", path = "../macros" }
tracing = "0.1.40"
tracing-log = "0.2.0"
tracing-subscriber = { version = "0.3.17", features = [
"registry",
"env-filter",
"registry",
"env-filter",
] }

# server
Expand All @@ -99,19 +99,19 @@ metrics = { version = "0.23", optional = true }
metrics-util = { version = "0.15", optional = true }
metrics-tracing-context = { version = "0.15", optional = true }
metrics-exporter-prometheus = { version = "0.15.1", optional = true, default-features = false, features = [
"http-listener",
"http-listener",
] }

# bevy
bevy = { version = "0.14", default-features = false, features = [
"multi_threaded",
"bevy_state",
"serialize",
"multi_threaded",
"bevy_state",
"serialize",
] }

# compression
lz4_flex = { version = "0.11", optional = true, default-features = false, features = [
"std",
"std",
] }

# WebSocket
Expand All @@ -120,8 +120,8 @@ futures-util = { version = "0.3.30", optional = true }
# transport
# we don't need any tokio features, we use only use the tokio channels
tokio = { version = "1.36", features = [
"sync",
"macros",
"sync",
"macros",
], default-features = false }
futures = "0.3.30"
async-compat = "0.2.3"
Expand All @@ -132,15 +132,15 @@ async-channel = "2.2.0"
# steamworks-sys doesn't build on wasm
steamworks = { version = "0.11", optional = true }
# webtransport
wtransport = { version = "=0.1.13", optional = true, features = [
"quinn",
"self-signed",
"dangerous-configuration",
wtransport = { version = "=0.1.14", optional = true, features = [
"quinn",
"self-signed",
"dangerous-configuration",
] }
# websocket
tokio-tungstenite = { version = "0.23.0", optional = true, features = [
"connect",
"handshake",
"connect",
"handshake",
] }
# compression
zstd = { version = "0.13.1", optional = true }
Expand All @@ -149,29 +149,29 @@ zstd = { version = "0.13.1", optional = true }
console_error_panic_hook = { version = "0.1.7" }
ring = { version = "0.17.8", optional = true, default-features = false }
web-sys = { version = "0.3", optional = true, features = [
"Document",
"WebTransport",
"WebTransportHash",
"WebTransportOptions",
"WebTransportBidirectionalStream",
"WebTransportSendStream",
"WebTransportReceiveStream",
"ReadableStreamDefaultReader",
"WritableStreamDefaultWriter",
"WebTransportDatagramDuplexStream",
"WebSocket",
"CloseEvent",
"ErrorEvent",
"MessageEvent",
"BinaryType",
"Document",
"WebTransport",
"WebTransportHash",
"WebTransportOptions",
"WebTransportBidirectionalStream",
"WebTransportSendStream",
"WebTransportReceiveStream",
"ReadableStreamDefaultReader",
"WritableStreamDefaultWriter",
"WebTransportDatagramDuplexStream",
"WebSocket",
"CloseEvent",
"ErrorEvent",
"MessageEvent",
"BinaryType",
] }
bevy_web_keepalive = "0.3"
futures-lite = { version = "2.1.0", optional = true }
getrandom = { version = "0.2.11", features = [
"js", # feature 'js' is required for wasm
"js", # feature 'js' is required for wasm
] }
xwt-core = { version = "0.4", optional = true }
xwt-web-sys = { version = "0.11", optional = true }
xwt-core = { version = "0.5", optional = true }
xwt-web-sys = { version = "0.12", optional = true }
wasm-bindgen = { version = "0.2.90", optional = true }
wasm-bindgen-futures = { version = "0.4.42", optional = true }
# compression
Expand All @@ -180,7 +180,7 @@ zstd = { version = "0.13.1", optional = true, features = ["wasm"] }

[dev-dependencies]
wasm-bindgen-test = "0.3.39"
mock_instant = { version = "0.4.0" }
mock_instant = { version = "0.5" }
tracing-subscriber = "0.3.17"
bitvec = "1.0"
approx = "0.5.1"
Expand Down
2 changes: 1 addition & 1 deletion lightyear/src/tests/host_server_stepper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ impl HostServerStepper {
.insert_resource(TimeUpdateStrategy::ManualInstant(self.current_time));
self.server_app
.insert_resource(TimeUpdateStrategy::ManualInstant(self.current_time));
mock_instant::MockClock::advance(duration);
mock_instant::global::MockClock::advance(duration);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lightyear/src/tests/multi_stepper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl MultiBevyStepper {
.insert_resource(TimeUpdateStrategy::ManualInstant(self.current_time));
self.server_app
.insert_resource(TimeUpdateStrategy::ManualInstant(self.current_time));
mock_instant::MockClock::advance(duration);
mock_instant::global::MockClock::advance(duration);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lightyear/src/tests/stepper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ impl BevyStepper {
.insert_resource(TimeUpdateStrategy::ManualInstant(self.current_time));
self.server_app
.insert_resource(TimeUpdateStrategy::ManualInstant(self.current_time));
mock_instant::MockClock::advance(duration);
mock_instant::global::MockClock::advance(duration);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lightyear/src/transport/middleware/conditioner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::utils::ready_buffer::ReadyBuffer;

cfg_if! {
if #[cfg(test)] {
use mock_instant::Instant;
use mock_instant::global::Instant;
} else {
use bevy::utils::Instant;
}
Expand Down
2 changes: 1 addition & 1 deletion lightyear/src/transport/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ mod tests {

#[test]
fn test_udp_socket_with_conditioner() {
use mock_instant::MockClock;
use mock_instant::global::MockClock;

// let the OS assign a port
let local_addr = SocketAddr::from_str("127.0.0.1:0").unwrap();
Expand Down
4 changes: 2 additions & 2 deletions lightyear/src/utils/ready_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ impl<K: Ord, T: PartialEq> Ord for ItemWithReadyKey<K, T> {
#[cfg(test)]
mod tests {
use bevy::utils::Duration;
use mock_instant::Instant;
use mock_instant::MockClock;
use mock_instant::global::Instant;
use mock_instant::global::MockClock;

use crate::shared::tick_manager::Tick;

Expand Down
Loading