mirror of
https://github.com/gopher64/gopher64.git
synced 2026-07-11 01:25:20 +02:00
use different rooms for lobby and game (#1009)
This commit is contained in:
+5
-4
@@ -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
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user