mirror of
https://github.com/MaciejkaG/statki.git
synced 2024-11-30 00:42:54 +01:00
Minor bug fixes
This commit is contained in:
parent
7e3db33ae8
commit
322b932dbd
9
index.js
9
index.js
@ -555,7 +555,10 @@ io.on('connection', async (socket) => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (playerGame && playerGame.data.state === 'preparation') {
|
||||
const playerIdx = playerGame.data.hostId === session.userId ? 0 : 1;
|
||||
const userNotReady = !playerGame.data.ready[playerIdx];
|
||||
|
||||
if (playerGame && playerGame.data.state === 'preparation' && userNotReady) {
|
||||
await GInfo.setReady(socket);
|
||||
const playerGame = await GInfo.getPlayerGameData(socket);
|
||||
|
||||
@ -563,10 +566,14 @@ io.on('connection', async (socket) => {
|
||||
// Both set ready
|
||||
await GInfo.resetTimer(playerGame.id);
|
||||
|
||||
callback();
|
||||
|
||||
await finishPrepPhase(socket, playerGame);
|
||||
} else if (playerGame.data.ready[0] || playerGame.data.ready[1]) {
|
||||
// One player set ready
|
||||
|
||||
callback();
|
||||
|
||||
const members = [...roomMemberIterator(playerGame.id)];
|
||||
for (let i = 0; i < members.length; i++) {
|
||||
const sid = members[i][0];
|
||||
|
@ -255,6 +255,8 @@ socket.on('turn update', (turnData) => {
|
||||
$(".boardSwitch").css("opacity", 0.3);
|
||||
} else {
|
||||
if (!postPrep) {
|
||||
$(".readyButton").css({ pointerEvents: 'none', opacity: 0.3 });
|
||||
|
||||
$(".controlsOwnBoard").css("opacity", 0.3);
|
||||
|
||||
$(".ownBoardInfo").addClass("changing");
|
||||
|
Loading…
Reference in New Issue
Block a user