mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 22:32:52 +02:00
Do not allow save game time reset
This commit is contained in:
@@ -153,6 +153,8 @@ module.exports = class ChessCommand extends Command {
|
|||||||
const verification = await verify(msg.channel, author);
|
const verification = await verify(msg.channel, author);
|
||||||
if (!verification) continue; // eslint-disable-line max-depth
|
if (!verification) continue; // eslint-disable-line max-depth
|
||||||
}
|
}
|
||||||
|
if (gameState.turn === 'black') blackTime -= new Date() - now;
|
||||||
|
if (gameState.turn === 'white') whiteTime -= new Date() - now;
|
||||||
await this.client.redis.set(
|
await this.client.redis.set(
|
||||||
`chess-${author.id}`,
|
`chess-${author.id}`,
|
||||||
this.exportGame(game, blackTime, whiteTime, whitePlayer.id === author.id ? 'white' : 'black')
|
this.exportGame(game, blackTime, whiteTime, whitePlayer.id === author.id ? 'white' : 'black')
|
||||||
|
|||||||
Reference in New Issue
Block a user