Protect against cross-session overwrites

This commit is contained in:
Flashfyre committed 2024-04-21 16:23:25 -04:00
1 parent 75cf6f3ab1
commit 6acbb6448a
3 files changed
+91 -15

No files matched your search

+3 -2
View File
@@ -12,7 +12,8 @@ import (
)
type ClearResponse struct {
Success bool `json:"success"`
Success bool `json:"success"`
Error string `json:"error"`
}
// /savedata/clear - mark session save data as cleared and delete
@@ -34,7 +35,7 @@ func Clear(uuid []byte, slot int, seed string, save defs.SessionSaveData) (Clear
if !sessionCompleted {
waveCompleted--
}
err = db.AddOrUpdateAccountDailyRun(uuid, save.Score, waveCompleted)
if err != nil {
log.Printf("failed to add or update daily run record: %s", err)