[package] name = "lightyear" version = "0.17.1" authors = ["Charles Bournhonesque "] edition = "2021" rust-version = "1.76" description = "Server-client networking library for the Bevy game engine" readme = "../README.md" repository = "https://github.com/cBournhonesque/lightyear" keywords = ["bevy", "multiplayer", "networking", "netcode", "gamedev"] categories = ["game-development", "network-programming"] license = "MIT OR Apache-2.0" exclude = ["/tests"] [features] # Enable sending messages bigger than 300KB big_messages = [] trace = [] metrics = [ "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", ] 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", ] steam = ["dep:steamworks"] # compression lz4 = ["dep:lz4_flex"] zstd = ["dep:zstd"] [dependencies] # utils chrono = "=0.4.34" cfg-if = "1.0" enum_dispatch = "0.3" hashbrown = "0.14" governor = "0.6.0" mock_instant = { version = "0.4.0", optional = true } nonzero_ext = "0.3.0" parking_lot = "0.12.1" paste = "1.0" rand = "0.8" ringbuffer = "0.15" thiserror = "1.0.50" seahash = "4.1.0" # input leafwing-input-manager = { version = "0.15", optional = true } # physics avian2d = { version = "0.1.1", optional = true, default-features = false } avian3d = { version = "0.1.1", optional = true, default-features = false } # serialization bincode = { version = "2.0.0-rc.3", features = ["serde"] } byteorder = "1.5.0" bytes = { version = "1.5", features = ["serde"] } self_cell = "1.0" serde = { version = "1", features = ["derive"] } # netcode chacha20poly1305 = { version = "0.10", features = ["std"] } # derive lightyear_macros = { version = "0.17.1", path = "../macros" } # tracing tracing = "0.1.40" tracing-log = "0.2.0" tracing-subscriber = { version = "0.3.17", features = [ "registry", "env-filter", ] } # server crossbeam-channel = { version = "0.5.8", features = [] } # metrics 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", ] } # bevy bevy = { version = "0.14", default-features = false, features = [ "multi_threaded", "bevy_state", "serialize", ] } # compression lz4_flex = { version = "0.11", optional = true, default-features = false, features = [ "std", ] } # WebSocket 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", ], default-features = false } futures = "0.3.30" async-compat = "0.2.3" async-channel = "2.2.0" [target."cfg(not(target_family = \"wasm\"))".dependencies] # connection # steamworks-sys doesn't build on wasm steamworks = { version = "0.11", optional = true } # webtransport 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", ] } # compression zstd = { version = "0.13.1", optional = true } [target."cfg(target_family = \"wasm\")".dependencies] 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", ] } 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 ] } 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 zstd = { version = "0.13.1", optional = true, features = ["wasm"] } [dev-dependencies] wasm-bindgen-test = "0.3.39" mock_instant = { version = "0.5" } tracing-subscriber = "0.3.17" bitvec = "1.0" approx = "0.5.1" # docs.rs-specific configuration [package.metadata.docs.rs] # we cannot use all-features = true, because we need to provide additional features for avian # when building the docs # NOTE: building docs.rs doesn't work if I include avian features = ["metrics", "webtransport", "leafwing", "websocket", "steam", "zstd"] rustdoc-args = ["--cfg", "docsrs"]