Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Renet Steam
Transport layer for the renet2 crate using the steamworks-rs.
Usage
This crate adds SteamServerTransport and SteamClientTransport to replace the default transport layer that comes with renet:
Server
// Setup steam client
let = init_app.unwrap;
steam_client.networking_utils.init_relay_network_access;
// Create renet server
let connection_config = default;
let mut server: RenetServer = new;
// Create steam transport
let access_permission = Public;
let steam_transport_config = SteamServerConfig ;
let mut steam_transport = new.unwrap;
// Your gameplay loop
loop
Client
// Setup steam client
let = init_app.unwrap;
steam_client.networking_utils.init_relay_network_access;
// Create renet client
let connection_config = default;
let mut client = new;
// Create steam transport
let server_steam_id = from_raw; // Here goes the steam id of the host
let mut steam_transport = new.unwrap;
// Your gameplay loop
loop
Example
You can try the steam echo example with (steam needs to be running in the background):
- server:
cargo run --example echo server - client:
cargo run --example echo client [HOST_STEAM_ID]
The HOST_STEAM_ID is printed in the console when the server starts.
You can also run the echo example using steam lobbies. Only steam users connected to the lobby will be able to connect to the server. In the echo example, they will first try connect to the steam lobby and later to the renet server:
- server:
cargo run --example echo server lobby - client:
cargo run --example echo client [HOST_STEAM_ID] [LOBBY_ID]
The LOBBY_ID is printed in the console when the server starts.
Bevy
If you are using bevy, you can use the bevy_renet2 crate with the steam feature. That crate has SteamServerPlugin and SteamClientPlugin, with a similar setup.
You can check the Bevy Demo for how to use the default and steam transport switching between them using feature flags.