fixed linting
This commit is contained in:
@@ -163,7 +163,6 @@ let stages: string[] = [];
|
|||||||
let currentIndex: number = 0;
|
let currentIndex: number = 0;
|
||||||
const defaultStages: string[] = ['cementery', 'prison', 'torture', 'inquisition', 'quadrangle', 'clock', 'spiral', 'empireo', 'cathedral', 'close', 'arrange'];
|
const defaultStages: string[] = ['cementery', 'prison', 'torture', 'inquisition', 'quadrangle', 'clock', 'spiral', 'empireo', 'cathedral', 'close', 'arrange'];
|
||||||
|
|
||||||
|
|
||||||
io.on('connection', (socket: socketIo.Socket) => {
|
io.on('connection', (socket: socketIo.Socket) => {
|
||||||
socket.on('disconnect', () => {
|
socket.on('disconnect', () => {
|
||||||
console.log('disconnect');
|
console.log('disconnect');
|
||||||
@@ -174,7 +173,7 @@ io.on('connection', (socket: socketIo.Socket) => {
|
|||||||
io.emit('exitGame');
|
io.emit('exitGame');
|
||||||
room = false;
|
room = false;
|
||||||
initRoom();
|
initRoom();
|
||||||
Object.keys(io.sockets.sockets).forEach((s) => {
|
Object.keys(io.sockets.sockets).forEach((s: string) => {
|
||||||
io.sockets.sockets[s].disconnect(true);
|
io.sockets.sockets[s].disconnect(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -185,15 +184,15 @@ io.on('connection', (socket: socketIo.Socket) => {
|
|||||||
} else if (playerTwo === data.userName) {
|
} else if (playerTwo === data.userName) {
|
||||||
playerTwoOption = data.option;
|
playerTwoOption = data.option;
|
||||||
}
|
}
|
||||||
console.log('playerOneOption',playerOneOption);
|
console.log('playerOneOption', playerOneOption);
|
||||||
console.log('playerTwoOption',playerTwoOption);
|
console.log('playerTwoOption', playerTwoOption);
|
||||||
if (playerOneOption !== '' && playerTwoOption !== '') {
|
if (playerOneOption !== '' && playerTwoOption !== '') {
|
||||||
const message: IJankenResult = {
|
const message: IJankenResult = {
|
||||||
playerOne,
|
playerOne,
|
||||||
playerOneOption,
|
playerOneOption,
|
||||||
playerTwo,
|
playerTwo,
|
||||||
playerTwoOption
|
playerTwoOption
|
||||||
}
|
};
|
||||||
io.emit('jankenResult', message);
|
io.emit('jankenResult', message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -207,10 +206,9 @@ io.on('connection', (socket: socketIo.Socket) => {
|
|||||||
socket.emit('registerUser', data);
|
socket.emit('registerUser', data);
|
||||||
}
|
}
|
||||||
const message = {
|
const message = {
|
||||||
playerOne: playerOne,
|
playerOne,
|
||||||
playerTwo: playerTwo,
|
playerTwo
|
||||||
};
|
};
|
||||||
console.log()
|
|
||||||
io.emit('login', message);
|
io.emit('login', message);
|
||||||
});
|
});
|
||||||
socket.on('moveToStage', () => {
|
socket.on('moveToStage', () => {
|
||||||
@@ -248,19 +246,18 @@ io.on('connection', (socket: socketIo.Socket) => {
|
|||||||
playerTwo: '',
|
playerTwo: '',
|
||||||
};
|
};
|
||||||
socket.emit('login', message);
|
socket.emit('login', message);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (playerOne === '' || playerTwo === '' || playerOneOption === '' || playerTwoOption === '') {
|
if (playerOne === '' || playerTwo === '' || playerOneOption === '' || playerTwoOption === '') {
|
||||||
const message = {
|
const message = {
|
||||||
playerOne: playerOne,
|
playerOne,
|
||||||
playerTwo: playerTwo,
|
playerTwo,
|
||||||
};
|
};
|
||||||
socket.emit('login', message);
|
socket.emit('login', message);
|
||||||
} else {
|
} else {
|
||||||
const message = {
|
const message = {
|
||||||
stages,
|
stages,
|
||||||
currentIndex
|
currentIndex
|
||||||
}
|
};
|
||||||
socket.emit('stages', message);
|
socket.emit('stages', message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user