diff --git a/README.md b/README.md index 6ca5cf1..8fe4eac 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ Meaning of some values: | hid | Hidden canvases, can be just seen by pressing P (default: false)| | sd | Start-date of the canvas (for historical view) | | ed | end date for historical view (canvas retired) | +| linkcd | id of another canvas to take the cooldown from | Notes: diff --git a/src/canvases.json b/src/canvases.json index d74a221..bddb7bd 100644 --- a/src/canvases.json +++ b/src/canvases.json @@ -373,6 +373,7 @@ "pcd" : 7000, "cds": 60000, "ranked" : true, + "linkcd" : 0, "sd": "2024-02-22" } } diff --git a/src/core/draw.js b/src/core/draw.js index fab94c7..7f54691 100644 --- a/src/core/draw.js +++ b/src/core/draw.js @@ -189,6 +189,7 @@ export default async function drawByOffsets( user.country, ranked, canvasId, + canvas.linkcd ?? canvasId, i, j, clrIgnore, req, diff --git a/src/data/redis/cooldown.js b/src/data/redis/cooldown.js index ab8e0f1..fd9e9e7 100644 --- a/src/data/redis/cooldown.js +++ b/src/data/redis/cooldown.js @@ -23,6 +23,8 @@ const PREFIX = 'cd'; * @param id userId * @param ranked boolean if increasing rank (should only be true if logged in) * @param clrIgnore, bcd, pcd, cds information about canvas + * @param canvasId id of the canvas we are placing on + * @param canvasCdId id of the canvas we take the cooldown from * @param i, j chunk coordinates * @param pxls Array with offsets of pixels * @return see lua/placePixel.lua @@ -33,6 +35,7 @@ export default function allowPlace( country, ranked, canvasId, + canvasCdId, i, j, clrIgnore, req, @@ -44,11 +47,6 @@ export default function allowPlace( ) { const isalKey = `${ALLOWED_PREFIX}:${ip}`; const captKey = (CAPTCHA_TIME >= 0) ? `${CAPTCHA_PREFIX}:${ip}` : 'nope'; - // ATTENTION: HARDCODED LINKED COODLOWN OF MINIMAP AND EARTH CANVAS - let canvasCdId = canvasId; - if (canvasId === 11) { - canvasCdId = 0; - } const ipCdKey = `${PREFIX}:${canvasCdId}:ip:${ip}`; let idCdKey; if (id) {