From b1b1b575bed80b399505859f8e6c8d7d2f4b8e34 Mon Sep 17 00:00:00 2001
From: Frederico Santos <frederico.f.santos@tecnico.ulisboa.pt>
Date: Tue, 4 Jun 2024 11:57:25 +0100
Subject: [PATCH] improved timestamp checks

---
 db/savedata.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/db/savedata.go b/db/savedata.go
index fe324fc..64bae9e 100644
--- a/db/savedata.go
+++ b/db/savedata.go
@@ -139,10 +139,10 @@ func StoreSessionSaveData(uuid []byte, data defs.SessionSaveData, slot int) erro
 		return errors.New("attempted to save an older session")
 	}
 
-	if data.Timestamp > int(time.Now().UTC().Add(time.Hour*48).UnixMilli()) {
+	if int64(data.Timestamp) > int64(time.Now().Add(time.Hour*48).UnixMilli()) {
 		return errors.New("attempted to save a future session save")
 	}
-	if data.Timestamp < int(time.Now().UTC().Add(-time.Hour*48).UnixMilli()) {
+	if int64(data.Timestamp) < int64(time.Now().Add(-time.Hour*48).UnixMilli()) {
 		return errors.New("attempted to save a past session save")
 	}