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.
cardGame/gameMod.js

26 lines
799 B
JavaScript

// For anything related to the actual game itself (kinda)
// this will be split into different bits, but should be what manages a rooms
// game states, and alladat
// Basically here to prevent circular dependencies (where I can)
// PlayerId is using array 0,1,2 for now, not the actual id
// actual Id would be better, but the player should be passed correctly
// from the client. They can edit data, but server-side validation SHOULD prevent
// in the future
function passTurn(roomId, playerId){
// Check playerId (not correct atm) before doing the stuff, to verify the user
// IS the user, and in the room
// Test alert so that different data/emits can be sent per-player
global.socketAlert(roomData[roomId].playerData[0].socketId, 'Pass', 'alert');
}
module.exports = {
passTurn
};