Commit a1d9008d authored by Mo Firouz's avatar Mo Firouz Committed by Andrei Mihu
Browse files

New duration field in the tournament API. (#267)

parent 8b5eeda4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@ All notable changes to this project are documented below.
The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org).

## [Unreleased]
### Added
- New duration field in the tournament API. 

### Fixed
- Set friend state correctly when initially adding friends.
- Join events on tournaments with an end time set now allow users to submit scores.
+219 −209

File changed.

Preview size limit exceeded, changes collapsed.

+2 −0
Original line number Diff line number Diff line
@@ -772,6 +772,8 @@ message Tournament {
  google.protobuf.Timestamp start_time = 14;
  // The UNIX time when the tournament will be stopped.
  google.protobuf.Timestamp end_time = 15;
  // The UNIX timestamp for duration of a tournament.
  uint32 duration = 16;
}

// A list of tournaments.
+5 −0
Original line number Diff line number Diff line
@@ -2964,6 +2964,11 @@
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the tournament will be stopped."
        },
        "duration": {
          "type": "integer",
          "format": "int64",
          "description": "The UNIX timestamp for duration of a tournament."
        }
      },
      "description": "A tournament on the server."
+1 −0
Original line number Diff line number Diff line
@@ -558,6 +558,7 @@ func parseTournament(scannable Scannable, now time.Time) (*api.Tournament, error
		Metadata:    dbMetadata,
		CreateTime:  &timestamp.Timestamp{Seconds: dbCreateTime.Time.UTC().Unix()},
		StartTime:   &timestamp.Timestamp{Seconds: dbStartTime.Time.UTC().Unix()},
		Duration:    uint32(dbDuration),
	}

	if dbEndTime.Time.Unix() > 0 {