mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-12 06:33:22 +08:00
removed time traveler check after all
This commit is contained in:
parent
642df7ede4
commit
f5f9f021a7
1 changed files with 12 additions and 11 deletions
|
@ -113,17 +113,18 @@ class ResultController {
|
|||
|
||||
result.timestamp = Math.round(result.timestamp / 1000) * 1000;
|
||||
|
||||
if (result.timestamp > Math.round(Date.now() / 1000) * 1000 + 10) {
|
||||
Logger.log(
|
||||
"time_traveler",
|
||||
{
|
||||
resultTimestamp: result.timestamp,
|
||||
serverTimestamp: Math.round(Date.now() / 1000) * 1000 + 10,
|
||||
},
|
||||
uid
|
||||
);
|
||||
return res.status(400).json({ message: "Time traveler detected" });
|
||||
}
|
||||
//dont use - result timestamp is unreliable, can be changed by system time and stuff
|
||||
// if (result.timestamp > Math.round(Date.now() / 1000) * 1000 + 10) {
|
||||
// Logger.log(
|
||||
// "time_traveler",
|
||||
// {
|
||||
// resultTimestamp: result.timestamp,
|
||||
// serverTimestamp: Math.round(Date.now() / 1000) * 1000 + 10,
|
||||
// },
|
||||
// uid
|
||||
// );
|
||||
// return res.status(400).json({ message: "Time traveler detected" });
|
||||
// }
|
||||
|
||||
let timestampres = await ResultDAO.getResultByTimestamp(
|
||||
uid,
|
||||
|
|
Loading…
Reference in a new issue