forked from ppfun/pixelplanet
adjust cd changes
This commit is contained in:
parent
a6b9c6099d
commit
08fef6f6dd
|
@ -41,9 +41,13 @@ export default function allowPlace(
|
|||
let idCdKey;
|
||||
if (id) {
|
||||
idCdKey = `${PREFIX}:${canvasId}:id:${id}`;
|
||||
/*
|
||||
* cooldown by subnet should be more restrictive
|
||||
*
|
||||
} else if (ip.includes('.')) {
|
||||
const ips = ip.slice(0, ip.lastIndexOf('.'));
|
||||
idCdKey = `${PREFIX}:${canvasId}:ips:${ips}`;
|
||||
*/
|
||||
} else {
|
||||
idCdKey = 'nope';
|
||||
}
|
||||
|
@ -75,10 +79,14 @@ export async function getCoolDown(
|
|||
if (id) {
|
||||
const ttlid = await client.pTTL(`${PREFIX}:${canvasId}:id:${id}`);
|
||||
ttl = Math.max(ttl, ttlid);
|
||||
/*
|
||||
* cooldown by subnet should be more restrictive
|
||||
*
|
||||
} else if (ip.includes('.')) {
|
||||
const ips = ip.slice(0, ip.lastIndexOf('.'));
|
||||
const ttlid = await client.pTTL(`${PREFIX}:${canvasId}:ips:${ips}`);
|
||||
ttl = Math.max(ttl, ttlid);
|
||||
*/
|
||||
}
|
||||
const cooldown = ttl < 0 ? 0 : ttl;
|
||||
return cooldown;
|
||||
|
|
Loading…
Reference in New Issue
Block a user