File tree Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Original file line number Diff line number Diff line change 10
10
// first user interaction
11
11
let interacted = false ;
12
12
13
- // ping-pong
14
- // let pingPong = 0;
15
13
const menuScreen = document . getElementById ( 'menu-screen' ) ;
16
14
const helpOverlay = document . getElementById ( 'help-overlay' ) ;
17
15
const playerIndex = document . getElementById ( 'playeridx' ) ;
56
54
message . show ( 'Now you can share you game!' ) ;
57
55
} ;
58
56
59
- // const onWebrtcMessage = () => {
60
- // event.pub(PING_RESPONSE);
61
- // };
62
-
63
57
const onConnectionReady = ( ) => {
64
- // ping / pong
65
- // if (pingPong === 0) {
66
- // pingPong = setInterval(() => {
67
- // if (!webrtc.message('x')) {
68
- // clearInterval(pingPong);
69
- // pingPong = 0;
70
- // log.info("ping-pong was disabled due to remote channel error");
71
- // }
72
- // event.pub(PING_REQUEST, {time: Date.now()})
73
- // }, 10000);
74
- // }
75
-
76
58
// start a game right away or show the menu
77
59
if ( room . getId ( ) ) {
78
60
startGame ( ) ;
471
453
event . sub ( WEBRTC_CONNECTION_READY , onConnectionReady ) ;
472
454
event . sub ( WEBRTC_CONNECTION_CLOSED , ( ) => {
473
455
input . poll . disable ( ) ;
474
- // if (pingPong > 0) {
475
- // clearInterval(pingPong);
476
- // pingPong = 0;
477
- // }
478
456
webrtc . stop ( ) ;
479
457
} ) ;
480
458
event . sub ( LATENCY_CHECK_REQUESTED , onLatencyCheck ) ;
You can’t perform that action at this time.
0 commit comments