use different rooms for lobby and game (#1009)

This commit is contained in:
Logan McNaughton
2026-06-05 23:35:59 +02:00
committed by GitHub
parent 077c1f439c
commit 19dc966abd
2 changed files with 9 additions and 7 deletions
+5 -4
View File
@@ -283,10 +283,11 @@ pub fn init(
input_delay: usize,
pal: bool,
) -> Option<Netplay> {
let (socket, loop_fut) = matchbox_socket::WebRtcSocketBuilder::new(server_addr)
.add_unreliable_channel()
.add_reliable_channel()
.build();
let (socket, loop_fut) =
matchbox_socket::WebRtcSocketBuilder::new(format!("{}/game", server_addr))
.add_unreliable_channel()
.add_reliable_channel()
.build();
tokio::spawn(async move {
if let Err(e) = loop_fut.await {
eprintln!("WebRTC loop failed: {}", e);
+4 -3
View File
@@ -398,9 +398,10 @@ fn update_ping(
mut close_ping_rx: tokio::sync::broadcast::Receiver<()>,
weak_app: slint::Weak<AppWindow>,
) {
let (mut socket, loop_fut) = matchbox_socket::WebRtcSocketBuilder::new(server_addr)
.add_unreliable_channel()
.build();
let (mut socket, loop_fut) =
matchbox_socket::WebRtcSocketBuilder::new(format!("{}/lobby", server_addr))
.add_unreliable_channel()
.build();
tokio::spawn(async move {
if let Err(e) = loop_fut.await {