using sent timestamp to verify and then changing to server time

This commit is contained in:
Jack 2021-12-13 16:23:01 +00:00
parent 57b25bbfcc
commit 6dc72700da

View file

@ -106,7 +106,7 @@ class ResultController {
// return res.status(400).json({ message: "Time traveler detected" });
// }
result.timestamp = Math.round(Date.now() / 1000) * 1000;
result.timestamp = Math.round(result.timestamp / 1000) * 1000;
let timestampres = await ResultDAO.getResultByTimestamp(
uid,
@ -116,6 +116,8 @@ class ResultController {
return res.status(400).json({ message: "Duplicate result" });
}
result.timestamp = Math.round(Date.now() / 1000) * 1000;
try {
result.keySpacingStats = {
average: