diff --git a/api/savedata.go b/api/savedata.go index bb7b8d6..b22adfa 100644 --- a/api/savedata.go +++ b/api/savedata.go @@ -278,7 +278,7 @@ func (s *Server) HandleSavedataClear(w http.ResponseWriter, r *http.Request) { newCompletion := false if sessionCompleted { - newCompletion, err = db.TryAddSeedCompletion(uuid, session.Seed) + newCompletion, err = db.TryAddSeedCompletion(uuid, session.Seed, int(session.GameMode)) if err != nil { log.Print("failed to mark seed as completed") } diff --git a/db/savedata.go b/db/savedata.go index bc7fd80..8743567 100644 --- a/db/savedata.go +++ b/db/savedata.go @@ -1,6 +1,6 @@ package db -func TryAddSeedCompletion(uuid []byte, seed string) (bool, error) { +func TryAddSeedCompletion(uuid []byte, seed string, mode int) (bool, error) { if len(seed) < 24 { for range 24 - len(seed) { seed += "0" @@ -15,7 +15,7 @@ func TryAddSeedCompletion(uuid []byte, seed string) (bool, error) { return false, nil } - _, err = handle.Exec("INSERT INTO seedCompletions (uuid, seed, timestamp) VALUES (?, ?, UTC_TIMESTAMP())", uuid, seed) + _, err = handle.Exec("INSERT INTO seedCompletions (uuid, seed, mode, timestamp) VALUES (?, ?, ?, UTC_TIMESTAMP())", uuid, seed, mode) if err != nil { return false, err }