This commit is contained in:
trichimtrich 2019-05-15 12:13:06 +08:00
parent acff5d8bc9
commit d5061ff7a0
2 changed files with 2 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

4
static/js/ws.js vendored
View file

@ -62,7 +62,7 @@ conn.onmessage = e => {
//conn.send(JSON.stringify({"id": "remotestart", "data": GAME_LIST[gameIdx].nes, "room_id": roomID.value, "player_index": parseInt(playerIndex.value, 10)}));inputTimer
//break;
case "heartbeat":
console.log("Ping: ", Date.now() - d["data"])
// console.log("Ping: ", Date.now() - d["data"])
// TODO: Calc time
break;
case "start":
@ -207,7 +207,7 @@ function startGame() {
screenState = "game";
// conn.send(JSON.stringify({"id": "start", "data": gameList[gameIdx].file, "room_id": $("#room-txt").val(), "player_index": parseInt(playerIndex.value, 10)}));
conn.send(JSON.stringify({"id": "start", "data": gameList[gameIdx].file, "room_id": $("#room-txt").val(), "player_index": 0}));
conn.send(JSON.stringify({"id": "start", "data": gameList[gameIdx].file, "room_id": $("#room-txt").val(), "player_index": 1}));
// clear menu screen
stopInputTimer();