Skip to content

Commit

Permalink
RenetSteam: fix update to bevy 0.13
Browse files Browse the repository at this point in the history
also fixes demo_bevy update
  • Loading branch information
lucaspoffo committed Feb 21, 2024
1 parent a5a8f8c commit 5351179
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions demo_bevy/src/bin/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn add_netcode_network(app: &mut App) {

app.add_plugins(bevy_renet::transport::NetcodeClientPlugin);

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

let client = RenetClient::new(connection_config());

Expand Down Expand Up @@ -101,7 +101,7 @@ fn add_steam_network(app: &mut App) {
app.insert_resource(transport);
app.insert_resource(CurrentClientId(steam_client.user().steam_id().raw()));

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

app.insert_non_send_resource(single);
fn steam_callbacks(client: NonSend<SingleClient>) {
Expand Down
12 changes: 6 additions & 6 deletions renet_steam/src/bevy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ impl Plugin for SteamServerPlugin {
PreUpdate,
Self::update_system
.in_set(RenetReceive)
.run_if(resource_exists::<RenetServer>())
.run_if(resource_exists::<RenetServer>)
.after(RenetServerPlugin::update_system)
.before(RenetServerPlugin::emit_server_events_system),
);

app.add_systems(
PostUpdate,
(Self::send_packets.in_set(RenetSend), Self::disconnect_on_exit).run_if(resource_exists::<RenetServer>()),
(Self::send_packets.in_set(RenetSend), Self::disconnect_on_exit).run_if(resource_exists::<RenetServer>),
);
}
}
Expand Down Expand Up @@ -72,15 +72,15 @@ impl Plugin for SteamClientPlugin {
PreUpdate,
Self::update_system
.in_set(RenetReceive)
.run_if(resource_exists::<SteamClientTransport>())
.run_if(resource_exists::<RenetClient>())
.run_if(resource_exists::<SteamClientTransport>)
.run_if(resource_exists::<RenetClient>)
.after(RenetClientPlugin::update_system),
);
app.add_systems(
PostUpdate,
(Self::send_packets.in_set(RenetSend), Self::disconnect_on_exit)
.run_if(resource_exists::<SteamClientTransport>())
.run_if(resource_exists::<RenetClient>()),
.run_if(resource_exists::<SteamClientTransport>)
.run_if(resource_exists::<RenetClient>),
);
}
}
Expand Down

0 comments on commit 5351179

Please sign in to comment.