mirror of
https://github.com/pagefaultgames/rogueserver.git
synced 2025-02-22 16:41:28 +08:00
Fix higher score being overwritten by worse daily runs
This commit is contained in:
parent
4419ead54c
commit
48c533cb78
@ -14,7 +14,7 @@ func TryAddDailyRun(seed string) error {
|
||||
}
|
||||
|
||||
func AddOrUpdateAccountDailyRun(uuid []byte, score int, wave int) error {
|
||||
_, err := handle.Exec("INSERT INTO accountDailyRuns (uuid, date, score, wave, timestamp) VALUES (?, UTC_DATE(), ?, ?, UTC_TIMESTAMP()) ON DUPLICATE KEY UPDATE score = ?, wave = GREATEST(wave, ?), timestamp = IF(score < ?, UTC_TIMESTAMP(), timestamp)", uuid, score, wave, score, wave, score)
|
||||
_, err := handle.Exec("INSERT INTO accountDailyRuns (uuid, date, score, wave, timestamp) VALUES (?, UTC_DATE(), ?, ?, UTC_TIMESTAMP()) ON DUPLICATE KEY UPDATE score = GREATEST(score, ?), wave = GREATEST(wave, ?), timestamp = IF(score < ?, UTC_TIMESTAMP(), timestamp)", uuid, score, wave, score, wave, score)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user