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

Remove Steam transport #144

Closed
wants to merge 1 commit into from
Closed
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
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ members = [
"renetcode",
"bevy_renet",
"renet_visualizer",
"renet_steam",
]
resolver = "2"
2 changes: 0 additions & 2 deletions bevy_renet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ version = "0.0.10"
default = ["transport"]
serde = ["renet/serde"]
transport = ["renet/transport"]
steam = ["renet_steam"]

[[example]]
name = "simple"
Expand All @@ -23,7 +22,6 @@ required-features = ["serde", "transport"]
[dependencies]
bevy = {version = "0.12", default-features = false}
renet = {path = "../renet", version = "0.0.14", default-features=false, features = ["bevy"]}
renet_steam = { path = "../renet_steam", version = "0.0.1", features = [ "bevy" ], optional = true }

[dev-dependencies]
bevy = {version = "0.12", default-features = false, features = ["bevy_core_pipeline", "bevy_render", "bevy_asset", "bevy_pbr", "x11", "tonemapping_luts", "ktx2", "zstd"]}
Expand Down
3 changes: 0 additions & 3 deletions bevy_renet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ use renet::{RenetClient, RenetServer, ServerEvent};
#[cfg(feature = "transport")]
pub mod transport;

#[cfg(feature = "steam")]
pub mod steam;

/// This system set is where all transports receive messages
///
/// If you want to ensure data has arrived in the [`RenetClient`] or [`RenetServer`], then schedule your
Expand Down
107 changes: 0 additions & 107 deletions bevy_renet/src/steam.rs

This file was deleted.

3 changes: 0 additions & 3 deletions demo_bevy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ path = "src/bin/server.rs"

[features]
transport = ["bevy_renet/transport"]
steam = ["bevy_renet/steam", "steamworks"]

[dependencies]
bevy = {version = "0.12", default-features = false, features = ["bevy_core_pipeline", "bevy_render", "bevy_asset", "bevy_pbr", "x11", "tonemapping_luts", "ktx2", "zstd"]}
Expand All @@ -23,5 +22,3 @@ bevy_egui = "0.23.0"
renet_visualizer = { path = "../renet_visualizer", features = ["bevy"] }
smooth-bevy-cameras = "0.10"
fastrand = "2.0.0"

steamworks = { git = "https://github.com/Noxime/steamworks-rs", rev = "a4dfe2a", optional = true }
6 changes: 0 additions & 6 deletions demo_bevy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,4 @@ Running using the netcode transport:
- server: `cargo run --bin server --features transport`
- client: `cargo run --bin client --features transport`

Running using the steam transport:

- server: `cargo run --bin server --features steam`
- client: `cargo run --bin client --features steam -- [HOST_STEAM_ID]`
- The `HOST_STEAM_ID` is printed in the console when the server is started

You can toogle [renet_visualizer](https://github.com/lucaspoffo/renet/tree/master/renet_visualizer) with `F1` in the client.
44 changes: 0 additions & 44 deletions demo_bevy/src/bin/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,47 +80,6 @@ fn add_netcode_network(app: &mut App) {
app.add_systems(Update, panic_on_error_system);
}

#[cfg(feature = "steam")]
fn add_steam_network(app: &mut App) {
use bevy_renet::steam::{SteamClientPlugin, SteamClientTransport, SteamTransportError};
use steamworks::{SingleClient, SteamId};

let (steam_client, single) = steamworks::Client::init_app(480).unwrap();

steam_client.networking_utils().init_relay_network_access();

let args: Vec<String> = std::env::args().collect();
let server_steam_id: u64 = args[1].parse().unwrap();
let server_steam_id = SteamId::from_raw(server_steam_id);

let client = RenetClient::new(connection_config());
let transport = SteamClientTransport::new(&steam_client, &server_steam_id).unwrap();

app.add_plugins(SteamClientPlugin);
app.insert_resource(client);
app.insert_resource(transport);
app.insert_resource(CurrentClientId(steam_client.user().steam_id().raw()));

app.configure_sets(Update, Connected.run_if(client_connected()));

app.insert_non_send_resource(single);
fn steam_callbacks(client: NonSend<SingleClient>) {
client.run_callbacks();
}

app.add_systems(PreUpdate, steam_callbacks);

// If any error is found we just panic
#[allow(clippy::never_loop)]
fn panic_on_error_system(mut renet_error: EventReader<SteamTransportError>) {
for e in renet_error.read() {
panic!("{}", e);
}
}

app.add_systems(Update, panic_on_error_system);
}

fn main() {
let mut app = App::new();
app.add_plugins(DefaultPlugins);
Expand All @@ -133,9 +92,6 @@ fn main() {
#[cfg(feature = "transport")]
add_netcode_network(&mut app);

#[cfg(feature = "steam")]
add_steam_network(&mut app);

app.add_event::<PlayerCommand>();

app.insert_resource(ClientLobby::default());
Expand Down
31 changes: 0 additions & 31 deletions demo_bevy/src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,34 +57,6 @@ fn add_netcode_network(app: &mut App) {
app.insert_resource(transport);
}

#[cfg(feature = "steam")]
fn add_steam_network(app: &mut App) {
use bevy_renet::steam::{AccessPermission, SteamServerConfig, SteamServerPlugin, SteamServerTransport};
use demo_bevy::connection_config;
use steamworks::SingleClient;

let (steam_client, single) = steamworks::Client::init_app(480).unwrap();

let server: RenetServer = RenetServer::new(connection_config());

let steam_transport_config = SteamServerConfig {
max_clients: 10,
access_permission: AccessPermission::Public,
};
let transport = SteamServerTransport::new(&steam_client, steam_transport_config).unwrap();

app.add_plugins(SteamServerPlugin);
app.insert_resource(server);
app.insert_non_send_resource(transport);
app.insert_non_send_resource(single);

fn steam_callbacks(client: NonSend<SingleClient>) {
client.run_callbacks();
}

app.add_systems(PreUpdate, steam_callbacks);
}

fn main() {
let mut app = App::new();
app.add_plugins(DefaultPlugins);
Expand All @@ -102,9 +74,6 @@ fn main() {
#[cfg(feature = "transport")]
add_netcode_network(&mut app);

#[cfg(feature = "steam")]
add_steam_network(&mut app);

app.add_systems(
Update,
(
Expand Down
5 changes: 0 additions & 5 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@ wildcards = "allow"
[sources]
unknown-registry = "deny"
unknown-git = "deny"

allow-git = [
# Unreleased version for steamworks, need release with PR https://github.com/Noxime/steamworks-rs/pull/134
"https://github.com/Noxime/steamworks-rs"
]
24 changes: 0 additions & 24 deletions renet_steam/Cargo.toml

This file was deleted.

3 changes: 0 additions & 3 deletions renet_steam/README.md

This file was deleted.

Loading
Loading