mirror of
https://github.com/PretendoNetwork/super-mario-maker.git
synced 2026-08-03 00:41:40 -05:00
23 lines
703 B
Go
23 lines
703 B
Go
package database
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/PretendoNetwork/nex-go"
|
|
)
|
|
|
|
func UpdateCourseWorldRecord(courseID uint64, ownerPID uint32, score int32) {
|
|
datetime := nex.NewDateTime(0)
|
|
now := datetime.Now()
|
|
|
|
if GetCourseWorldRecord(courseID) == nil {
|
|
if err := cassandraClusterSession.Query(`UPDATE pretendo_smm.courses SET world_record_first_pid=?, world_record_creation_date=? WHERE data_id=?`, ownerPID, now, courseID).Exec(); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|
|
|
|
if err := cassandraClusterSession.Query(`UPDATE pretendo_smm.courses SET world_record_pid=?, world_record_update_date=?, world_record=? WHERE data_id=?`, ownerPID, now, score, courseID).Exec(); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|