Loading CHANGELOG.md +2 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr ### Added - Explicitly set cache control header in all API responses. - Add support for CockroachDB 19.1. - Add tournament start active timestamp to the API response. ### Changed - Tournament start time can be set to past time. Loading api/api.pb.go +221 −211 File changed.Preview size limit exceeded, changes collapsed. Show changes api/api.proto +2 −0 Original line number Diff line number Diff line Loading @@ -784,6 +784,8 @@ message Tournament { google.protobuf.Timestamp end_time = 15; // The UNIX timestamp for duration of a tournament. uint32 duration = 16; // The UNIX timestamp when the tournament start being active. A computed value. uint32 start_active = 17; } // A list of tournaments. Loading apigrpc/apigrpc.swagger.json +5 −0 Original line number Diff line number Diff line Loading @@ -3043,6 +3043,11 @@ "type": "integer", "format": "int64", "description": "The UNIX timestamp for duration of a tournament." }, "start_active": { "type": "integer", "format": "int64", "description": "The UNIX timestamp when the tournament start being active. A computed value." } }, "description": "A tournament on the server." Loading server/core_tournament.go +3 −2 Original line number Diff line number Diff line Loading @@ -528,9 +528,9 @@ func parseTournament(scannable Scannable, now time.Time) (*api.Tournament, error canEnter := true endTime := dbEndTime.Time.UTC().Unix() _, endActiveUnix, expiryUnix := calculateTournamentDeadlines(dbStartTime.Time.UTC().Unix(), endTime, int64(dbDuration), resetSchedule, now) startActive, endActiveUnix, expiryUnix := calculateTournamentDeadlines(dbStartTime.Time.UTC().Unix(), endTime, int64(dbDuration), resetSchedule, now) if endActiveUnix < now.Unix() { if startActive > now.Unix() || endActiveUnix < now.Unix() { canEnter = false } Loading @@ -554,6 +554,7 @@ func parseTournament(scannable Scannable, now time.Time) (*api.Tournament, error CreateTime: ×tamp.Timestamp{Seconds: dbCreateTime.Time.UTC().Unix()}, StartTime: ×tamp.Timestamp{Seconds: dbStartTime.Time.UTC().Unix()}, Duration: uint32(dbDuration), StartActive: uint32(startActive), } if endTime > 0 { Loading Loading
CHANGELOG.md +2 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr ### Added - Explicitly set cache control header in all API responses. - Add support for CockroachDB 19.1. - Add tournament start active timestamp to the API response. ### Changed - Tournament start time can be set to past time. Loading
api/api.proto +2 −0 Original line number Diff line number Diff line Loading @@ -784,6 +784,8 @@ message Tournament { google.protobuf.Timestamp end_time = 15; // The UNIX timestamp for duration of a tournament. uint32 duration = 16; // The UNIX timestamp when the tournament start being active. A computed value. uint32 start_active = 17; } // A list of tournaments. Loading
apigrpc/apigrpc.swagger.json +5 −0 Original line number Diff line number Diff line Loading @@ -3043,6 +3043,11 @@ "type": "integer", "format": "int64", "description": "The UNIX timestamp for duration of a tournament." }, "start_active": { "type": "integer", "format": "int64", "description": "The UNIX timestamp when the tournament start being active. A computed value." } }, "description": "A tournament on the server." Loading
server/core_tournament.go +3 −2 Original line number Diff line number Diff line Loading @@ -528,9 +528,9 @@ func parseTournament(scannable Scannable, now time.Time) (*api.Tournament, error canEnter := true endTime := dbEndTime.Time.UTC().Unix() _, endActiveUnix, expiryUnix := calculateTournamentDeadlines(dbStartTime.Time.UTC().Unix(), endTime, int64(dbDuration), resetSchedule, now) startActive, endActiveUnix, expiryUnix := calculateTournamentDeadlines(dbStartTime.Time.UTC().Unix(), endTime, int64(dbDuration), resetSchedule, now) if endActiveUnix < now.Unix() { if startActive > now.Unix() || endActiveUnix < now.Unix() { canEnter = false } Loading @@ -554,6 +554,7 @@ func parseTournament(scannable Scannable, now time.Time) (*api.Tournament, error CreateTime: ×tamp.Timestamp{Seconds: dbCreateTime.Time.UTC().Unix()}, StartTime: ×tamp.Timestamp{Seconds: dbStartTime.Time.UTC().Unix()}, Duration: uint32(dbDuration), StartActive: uint32(startActive), } if endTime > 0 { Loading