Skip to content

Commit

Permalink
chore(deps): Update iroh-net 0.27 + move to workspace dep (#487)
Browse files Browse the repository at this point in the history
This update should fix #428  🥳
  • Loading branch information
MaxCWhitehead authored Oct 26, 2024
1 parent 033e789 commit ba0bb88
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 66 deletions.
90 changes: 32 additions & 58 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ maybe-owned = "0.3"
parking_lot = "0.12"
smallvec = "1.11"
ustr = "0.10"
iroh-net = "0.27"

[profile.release]
lto = true
2 changes: 1 addition & 1 deletion framework_crates/bones_framework/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ rcgen = "0.12"
rustls = { version = "0.21", features = ["dangerous_configuration", "quic"] }
smallvec = "1.10"
iroh-quinn = { version = "0.11" }
iroh-net = { version = "0.26", features = ["discovery-local-network"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
turborand = { version = "0.10.0", features = ["atomic"] }
iroh-net = { workspace = true, features = ["discovery-local-network"] }

directories = "5.0"

Expand Down
2 changes: 1 addition & 1 deletion framework_crates/bones_framework/src/networking/online.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl MatchmakerConnectionState {
if self.conn.is_none() {
info!("Connecting to online matchmaker");
let ep = get_network_endpoint().await;
let conn = ep.connect(id.into(), MATCH_ALPN).await?;
let conn = ep.connect(id, MATCH_ALPN).await?;
self.ep = Some(ep.clone());
self.conn = Some(conn);
info!("Connected to online matchmaker");
Expand Down
2 changes: 1 addition & 1 deletion other_crates/bones_matchmaker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ postcard = { version = "1.0", default-features = false, features =
serde = { version = "1.0", features = ["derive"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
iroh-net = { version = "0.26", features = ["discovery-local-network"] }
iroh-net = { workspace = true, features = ["discovery-local-network"] }
quinn = { version = "0.11", package = "iroh-quinn" }
blake3 = "1.5.3"
13 changes: 9 additions & 4 deletions other_crates/bones_matchmaker/src/matchmaker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use once_cell::sync::Lazy;
use quinn::Connection;
use rand::{prelude::SliceRandom, SeedableRng};
use scc::HashMap as SccHashMap;
use std::cmp::Ordering;
use std::collections::HashMap;
use std::sync::Arc;
use tokio::sync::Mutex;
Expand Down Expand Up @@ -94,10 +95,14 @@ pub async fn start_game(
}
PlayerIdxAssignment::SpecifiedOrder(order) => {
let mut indices = order.clone();
if indices.len() < player_count {
indices.extend(indices.len()..player_count);
} else if indices.len() > player_count {
indices.truncate(player_count);
match indices.len().cmp(&player_count) {
Ordering::Less => {
indices.extend(indices.len()..player_count);
}
Ordering::Greater => {
indices.truncate(player_count);
}
_ => (),
}
indices
}
Expand Down
2 changes: 1 addition & 1 deletion other_crates/bones_matchmaker_proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ repository.workspace = true

[dependencies]
serde = { version = "1.0", features = ["derive"] }
iroh-net = "0.26"
iroh-net = { workspace = true }

0 comments on commit ba0bb88

Please sign in to comment.