Revert "Fix data override prevention on update"

This reverts commit 52756fdba3.
pull/4/head
Flashfyre 7 months ago
parent 52756fdba3
commit cde572d626

@ -279,29 +279,29 @@ func handleSaveData(w http.ResponseWriter, r *http.Request) {
} }
} }
if active || r.URL.Path == "/savedata/get" { switch r.URL.Path {
switch r.URL.Path { case "/savedata/get":
case "/savedata/get": save, err = savedata.Get(uuid, datatype, slot)
save, err = savedata.Get(uuid, datatype, slot) case "/savedata/update":
case "/savedata/update": err = savedata.Update(uuid, slot, save)
err = savedata.Update(uuid, slot, save) case "/savedata/delete":
case "/savedata/delete": err = savedata.Delete(uuid, datatype, slot)
err = savedata.Delete(uuid, datatype, slot) case "/savedata/clear":
case "/savedata/clear": if !active {
s, ok := save.(defs.SessionSaveData) // TODO: make this not suck
if !ok { save = savedata.ClearResponse{Error: "session out of date"}
err = fmt.Errorf("save data is not type SessionSaveData") break
break }
}
// doesn't return a save, but it works s, ok := save.(defs.SessionSaveData)
save, err = savedata.Clear(uuid, slot, daily.Seed(), s) if !ok {
err = fmt.Errorf("save data is not type SessionSaveData")
break
} }
} else {
// TODO: make this not suck
save = savedata.ClearResponse{Error: "session out of date"}
}
// doesn't return a save, but it works
save, err = savedata.Clear(uuid, slot, daily.Seed(), s)
}
if err != nil { if err != nil {
httpError(w, r, err, http.StatusInternalServerError) httpError(w, r, err, http.StatusInternalServerError)
return return

Loading…
Cancel
Save