Skip to content

Commit

Permalink
Remove old ping/pong handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
sergystepanov committed Sep 24, 2023
1 parent da51639 commit 8703309
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions web/js/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8703309

Please sign in to comment.