mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-11 05:46:50 +08:00
fixed previous update
This commit is contained in:
parent
0ca2384695
commit
ea43290ca0
1 changed files with 20 additions and 19 deletions
|
|
@ -433,28 +433,29 @@ exports.testCompleted = functions.https.onCall((request, response) => {
|
|||
request.obj.name = name;
|
||||
|
||||
//check keyspacing and duration here
|
||||
if (!verified) {
|
||||
if (
|
||||
keySpacing !== null &&
|
||||
keyDuration !== null &&
|
||||
obj.mode === "time"
|
||||
) {
|
||||
if(obj.mode === "time"){
|
||||
if (!verified) {
|
||||
if (
|
||||
keySpacing.sd < 15 ||
|
||||
keyDuration.sd < 15 ||
|
||||
keyDuration.average < 15
|
||||
keySpacing !== null &&
|
||||
keyDuration !== null &&
|
||||
) {
|
||||
console.error(
|
||||
`possible bot detected by user (${obj.wpm} ${obj.rawWpm} ${
|
||||
obj.acc
|
||||
}) ${request.uid} ${name} - spacing ${JSON.stringify(
|
||||
keySpacing
|
||||
)} duration ${JSON.stringify(keyDuration)}`
|
||||
);
|
||||
return { resultCode: -2 };
|
||||
if (
|
||||
keySpacing.sd < 15 ||
|
||||
keyDuration.sd < 15 ||
|
||||
keyDuration.average < 15
|
||||
) {
|
||||
console.error(
|
||||
`possible bot detected by user (${obj.wpm} ${obj.rawWpm} ${
|
||||
obj.acc
|
||||
}) ${request.uid} ${name} - spacing ${JSON.stringify(
|
||||
keySpacing
|
||||
)} duration ${JSON.stringify(keyDuration)}`
|
||||
);
|
||||
return { resultCode: -2 };
|
||||
}
|
||||
} else {
|
||||
return { resultCode: -3 };
|
||||
}
|
||||
} else {
|
||||
return { resultCode: -3 };
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue