mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Save match start time to the database.
This commit is contained in:
6
arena.go
6
arena.go
@@ -327,6 +327,12 @@ func (arena *Arena) CheckCanStartMatch() error {
|
||||
func (arena *Arena) StartMatch() error {
|
||||
err := arena.CheckCanStartMatch()
|
||||
if err == nil {
|
||||
// Save the match start time to the database for posterity.
|
||||
arena.currentMatch.StartedAt = time.Now()
|
||||
if arena.currentMatch.Type != "test" {
|
||||
db.SaveMatch(arena.currentMatch)
|
||||
}
|
||||
|
||||
arena.MatchState = START_MATCH
|
||||
}
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user