Loading packages/client/src/components/Settings/AudioSettings.tsx +1 −2 Original line number Diff line number Diff line Loading @@ -166,8 +166,7 @@ export const AudioSettings = () => { if (!canvas?.lastPlace) return; const cooldown = CanvasLib.getPixelCooldown(pixelsAvailable + 1, config); const availableAt = canvas.lastPlace + cooldown * 1000 * (pixelsAvailable + 1); const availableAt = canvas.lastPlace + cooldown * 1000; const soundAt = availableAt + pixelAvailableOffset * 1000; const delay = soundAt - Date.now(); Loading packages/client/src/components/Toolbar/CanvasMeta.tsx +1 −6 Original line number Diff line number Diff line Loading @@ -35,12 +35,7 @@ const getTimeLeft = (available: number, config: ClientConfig) => { if (!lastPlace) return undefined; const cooldown = CanvasLib.getPixelCooldown(available + 1, config); const pixelAvailableAt = lastPlace + // include already collected pixels cooldown * 1000 * available + // pixel we're currently waiting for cooldown * 1000; const pixelAvailableAt = lastPlace + cooldown * 1000; const pixelCooldown = (Date.now() - pixelAvailableAt) / 1000; Loading packages/client/src/lib/canvas.ts +0 −1 Original line number Diff line number Diff line Loading @@ -794,7 +794,6 @@ export class CanvasCore extends EventEmitter<CanvasEvents> { .then((ack) => { if (ack.success) { this.handlePixel(ack.data); this.lastPlace = Date.now(); Network.emit("placeSuccessful"); return true; } else { Loading packages/server/src/controllers/SocketController.ts +0 −3 Original line number Diff line number Diff line Loading @@ -348,9 +348,6 @@ export class SocketController { new Date(Date.now() + CONFIG.canvas.undo.grace_period), ); // flag the user placed (used for next available pixel countdown) await user.markPlaced(); const newPixel: Pixel = { x: pixel.x, y: pixel.y, Loading packages/server/src/models/User.ts +0 −16 Original line number Diff line number Diff line Loading @@ -212,22 +212,6 @@ export class User { .io.to("user:" + this.sub) .emit(...args); async markPlaced() { await prisma.user.update({ where: { sub: this.sub, }, data: { lastTimeGainStarted: new Date(), }, }); await this.update(); } /** * Set undoExpires in database and notify all user's sockets of undo ttl */ async setUndo(expires?: Date) { if (expires) { // expiration being set Loading Loading
packages/client/src/components/Settings/AudioSettings.tsx +1 −2 Original line number Diff line number Diff line Loading @@ -166,8 +166,7 @@ export const AudioSettings = () => { if (!canvas?.lastPlace) return; const cooldown = CanvasLib.getPixelCooldown(pixelsAvailable + 1, config); const availableAt = canvas.lastPlace + cooldown * 1000 * (pixelsAvailable + 1); const availableAt = canvas.lastPlace + cooldown * 1000; const soundAt = availableAt + pixelAvailableOffset * 1000; const delay = soundAt - Date.now(); Loading
packages/client/src/components/Toolbar/CanvasMeta.tsx +1 −6 Original line number Diff line number Diff line Loading @@ -35,12 +35,7 @@ const getTimeLeft = (available: number, config: ClientConfig) => { if (!lastPlace) return undefined; const cooldown = CanvasLib.getPixelCooldown(available + 1, config); const pixelAvailableAt = lastPlace + // include already collected pixels cooldown * 1000 * available + // pixel we're currently waiting for cooldown * 1000; const pixelAvailableAt = lastPlace + cooldown * 1000; const pixelCooldown = (Date.now() - pixelAvailableAt) / 1000; Loading
packages/client/src/lib/canvas.ts +0 −1 Original line number Diff line number Diff line Loading @@ -794,7 +794,6 @@ export class CanvasCore extends EventEmitter<CanvasEvents> { .then((ack) => { if (ack.success) { this.handlePixel(ack.data); this.lastPlace = Date.now(); Network.emit("placeSuccessful"); return true; } else { Loading
packages/server/src/controllers/SocketController.ts +0 −3 Original line number Diff line number Diff line Loading @@ -348,9 +348,6 @@ export class SocketController { new Date(Date.now() + CONFIG.canvas.undo.grace_period), ); // flag the user placed (used for next available pixel countdown) await user.markPlaced(); const newPixel: Pixel = { x: pixel.x, y: pixel.y, Loading
packages/server/src/models/User.ts +0 −16 Original line number Diff line number Diff line Loading @@ -212,22 +212,6 @@ export class User { .io.to("user:" + this.sub) .emit(...args); async markPlaced() { await prisma.user.update({ where: { sub: this.sub, }, data: { lastTimeGainStarted: new Date(), }, }); await this.update(); } /** * Set undoExpires in database and notify all user's sockets of undo ttl */ async setUndo(expires?: Date) { if (expires) { // expiration being set Loading