mirror of
https://github.com/gopher64/gopher64.git
synced 2026-07-11 01:25:20 +02:00
increase disconnect timeout (#1016)
* increase disconnect timeout * more
This commit is contained in:
+12
-5
@@ -230,6 +230,7 @@ pub fn process_netplay(
|
||||
ggrs::GgrsEvent::Synchronizing { .. } => {}
|
||||
ggrs::GgrsEvent::Synchronized { .. } => {}
|
||||
ggrs::GgrsEvent::Disconnected { .. } => {
|
||||
eprintln!("peer disconnected");
|
||||
ui::video::onscreen_message(
|
||||
"Peer disconnected",
|
||||
ui::video::MESSAGE_LENGTH_MESSAGE_LONG,
|
||||
@@ -245,6 +246,7 @@ pub fn process_netplay(
|
||||
println!("wait recommendation: skip_frames={}", skip_frames);
|
||||
}
|
||||
ggrs::GgrsEvent::DesyncDetected { .. } => {
|
||||
eprintln!("desync detected");
|
||||
ui::video::onscreen_message(
|
||||
"Desync detected",
|
||||
ui::video::MESSAGE_LENGTH_MESSAGE_LONG,
|
||||
@@ -283,11 +285,10 @@ pub fn init(
|
||||
input_delay: usize,
|
||||
pal: bool,
|
||||
) -> Option<Netplay> {
|
||||
let (socket, loop_fut) =
|
||||
matchbox_socket::WebRtcSocketBuilder::new(format!("{}/game", server_addr))
|
||||
.add_unreliable_channel()
|
||||
.add_reliable_channel()
|
||||
.build();
|
||||
let (socket, loop_fut) = matchbox_socket::WebRtcSocketBuilder::new(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);
|
||||
@@ -327,6 +328,12 @@ pub fn init(
|
||||
.unwrap()
|
||||
.with_desync_detection_mode(ggrs::DesyncDetection::On { interval: 60 });
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
session_builder =
|
||||
session_builder.with_disconnect_timeout(std::time::Duration::from_secs(10));
|
||||
}
|
||||
|
||||
let mut peers = vec![];
|
||||
for (i, peer) in player_numbers.iter() {
|
||||
if let Some(peer) = peer {
|
||||
|
||||
+3
-4
@@ -398,10 +398,9 @@ 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(format!("{}/lobby", server_addr))
|
||||
.add_unreliable_channel()
|
||||
.build();
|
||||
let (mut socket, loop_fut) = matchbox_socket::WebRtcSocketBuilder::new(server_addr)
|
||||
.add_unreliable_channel()
|
||||
.build();
|
||||
|
||||
tokio::spawn(async move {
|
||||
if let Err(e) = loop_fut.await {
|
||||
|
||||
Reference in New Issue
Block a user