Skip to content

Commit

Permalink
Use release versions instead of git dependencies for networking
Browse files Browse the repository at this point in the history
  • Loading branch information
haihala committed Dec 23, 2024
1 parent 87d8b66 commit 33be4b8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 21 deletions.
24 changes: 16 additions & 8 deletions client/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 8 additions & 10 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[workspace]
resolver = "2"
members = [
"characters",
"input_parsing",
"lib",
"main",
"player_state",
"foundation",
"characters",
"input_parsing",
"lib",
"main",
"player_state",
"foundation",
]

[profile.dev]
Expand All @@ -19,10 +19,8 @@ opt-level = 3
[workspace.dependencies]
bevy = "0.15"
bevy-inspector-egui = "0.28"
bevy_matchbox = { git = "https://github.com/haihala/matchbox.git", features = [
"ggrs",
] }
bevy_ggrs = { git = "https://github.com/johanhelsing/bevy_ggrs.git", branch = "bevy-0.15" }
bevy_matchbox = { version = "0.11", features = ["ggrs"] }
bevy_ggrs = "0.17"

rand = "0.8"
strum = "0.26"
Expand Down
5 changes: 2 additions & 3 deletions client/lib/src/networking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,12 @@ fn setup_socket(mut commands: Commands) {
info!("connecting to matchbox server: {room_url}");
let sock = WebRtcSocketBuilder::new(room_url)
.add_reliable_channel()
.add_ggrs_channel()
.build();
commands.insert_resource(MatchboxSocket::from(sock));
}

fn teardown(mut commands: Commands) {
commands.remove_resource::<MatchboxSocket<MultipleChannels>>();
commands.remove_resource::<MatchboxSocket>();
commands.remove_resource::<bevy_ggrs::Session<Config>>();
commands.remove_resource::<bevy_ggrs::LocalInputs<Config>>();

Expand All @@ -183,7 +182,7 @@ enum ConnectionState {
fn wait_for_players(
mut commands: Commands,
mut connection_state: Local<ConnectionState>,
mut socket: ResMut<MatchboxSocket<MultipleChannels>>,
mut socket: ResMut<MatchboxSocket>,
local_character: Res<LocalCharacter>,
local_controls: Res<LocalController>,
args: Res<WagArgs>,
Expand Down

0 comments on commit 33be4b8

Please sign in to comment.