Update generic savedata Update function

This commit is contained in:
Pancakes 2025-04-26 14:57:10 -04:00
parent 42a53dbb57
commit aff371836c
No known key found for this signature in database
GPG Key ID: 5792877BFA27DC8F

View File

@ -38,19 +38,13 @@ func Update(uuid []byte, slot int, save any) error {
return fmt.Errorf("invalid system data")
}
err = db.UpdateAccountStats(uuid, save.GameStats, save.VoucherCounts)
if err != nil {
return fmt.Errorf("failed to update account stats: %s", err)
}
return db.StoreSystemSaveData(uuid, save)
return UpdateSystem(uuid, save)
case defs.SessionSaveData: // Session
if slot < 0 || slot >= defs.SessionSlotCount {
return fmt.Errorf("slot id %d out of range", slot)
}
return db.StoreSessionSaveData(uuid, save, slot)
return UpdateSession(uuid, slot, save)
default:
return fmt.Errorf("invalid data type")
}