Commit b376c99e authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Allow tournament joins before the tournament starts.

parent 8d8db890
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr

### Changed
- Rejoining a match the user is already part of will now return the match label.
- Allow tournament joins before the start of the tournament active period.

### Fixed
- Correctly report execution mode in Lua runtime after hooks.
+2 −2
Original line number Diff line number Diff line
@@ -133,8 +133,8 @@ func TournamentJoin(ctx context.Context, logger *zap.Logger, db *sql.DB, cache L

	now := time.Now().UTC()
	nowUnix := now.Unix()
	startActive, endActive, expiryTime := calculateTournamentDeadlines(leaderboard, now)
	if startActive > nowUnix || endActive <= nowUnix {
	_, endActive, expiryTime := calculateTournamentDeadlines(leaderboard, now)
	if endActive <= nowUnix {
		logger.Info("Cannot join tournament outside of tournament duration.")
		return ErrTournamentOutsideDuration
	}