From 87033090903591e95cf00bfbd0d58744ab526930 Mon Sep 17 00:00:00 2001 From: Sergey Stepanov Date: Sun, 24 Sep 2023 01:57:44 +0300 Subject: [PATCH] Remove old ping/pong handlers --- web/js/controller.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/web/js/controller.js b/web/js/controller.js index 489590ca0..a905daa2a 100644 --- a/web/js/controller.js +++ b/web/js/controller.js @@ -10,8 +10,6 @@ // first user interaction let interacted = false; - // ping-pong - // let pingPong = 0; const menuScreen = document.getElementById('menu-screen'); const helpOverlay = document.getElementById('help-overlay'); const playerIndex = document.getElementById('playeridx'); @@ -56,23 +54,7 @@ message.show('Now you can share you game!'); }; - // const onWebrtcMessage = () => { - // event.pub(PING_RESPONSE); - // }; - const onConnectionReady = () => { - // ping / pong - // if (pingPong === 0) { - // pingPong = setInterval(() => { - // if (!webrtc.message('x')) { - // clearInterval(pingPong); - // pingPong = 0; - // log.info("ping-pong was disabled due to remote channel error"); - // } - // event.pub(PING_REQUEST, {time: Date.now()}) - // }, 10000); - // } - // start a game right away or show the menu if (room.getId()) { startGame(); @@ -471,10 +453,6 @@ event.sub(WEBRTC_CONNECTION_READY, onConnectionReady); event.sub(WEBRTC_CONNECTION_CLOSED, () => { input.poll.disable(); - // if (pingPong > 0) { - // clearInterval(pingPong); - // pingPong = 0; - // } webrtc.stop(); }); event.sub(LATENCY_CHECK_REQUESTED, onLatencyCheck);