You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
586 B
JavaScript
21 lines
586 B
JavaScript
// Any socket request/responses for the actual game (when in a match)
|
|
|
|
function requestPassTurn(){
|
|
console.log('>> passTurn');
|
|
socket.emit('passTurn', gameData.roomId, gameData.playerId);
|
|
}
|
|
socket.on('responsePassTurn', function (data) {
|
|
console.log('<< passTurn');
|
|
// Set turn data for clients (bolds their name)
|
|
updateTurn(data.turn, data.playerTurn);
|
|
drawGameBoard();
|
|
});
|
|
|
|
// Functions like this would be elsewhere, do client-side
|
|
// validation THEN request stuff from the server?
|
|
// This is here for now, as it's used by the button
|
|
function passTurn(){
|
|
requestPassTurn();
|
|
}
|
|
|