Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New event system #2

Closed
ahmadbky opened this issue Apr 15, 2024 · 0 comments
Closed

New event system #2

ahmadbky opened this issue Apr 15, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@ahmadbky
Copy link
Member

ahmadbky commented Apr 15, 2024

This issue is related to the new event system integrated in the API.

Context

With the arrival of Benchmark 2, we needed a way to clear the leaderboards of its maps, but keep them saved for the original maps. Thus, the leaderboards needed to be separated. However, at the time, the only way to do this was to insert a new entry for each map with a distinct UID, such that we can retrieve the UID of the original map and vice-versa. The solution was to edit each map file manually to mark the _benchmark suffix for the map UID.

At the time, we also wanted to save the records made on maps with a UID *_benchmark to the original map, but not the reverse obviously. The only solution for this at this time is to hardcode it.

This mechanism needs to be generalized for all events incoming: we want to make a distinct leaderboard for the maps in the context of an event. This goes for the campaign, the benchmark, the Storm Runners, and any other incoming event that would be integrated in the Obstacle system.

What's new with this feature

From now on, events like Campaigns and Benchmarks are entities in their own right. It is based on an event "handle" (an identifier that is common for the various editions), and an edition ID. For example, the Summer 2023 campaign has the event handle "campaign" and the edition id "1" ; Benchmark 2 has the event handle "benchmark" and the edition id "2" ; and so on.

The events can be accessed with different routes:

  • /event: get the list of event handles with their last edition id
  • /event/:handle: get the list of edition ids of the provided event handle :handle
  • /event/:handle/:id: get almost-full information about an event edition with its handle and edition id (name, banner image, maps...).

Every route related to a map or a player in the context of an event is prefixed by the route of the event, eg. POST /event/:handle/:id/player/finished is used in the API to finish a map in the context of the given event. The API will thus save the record for the map in the event context and also to the original map.

Transition issues

See #7

@ahmadbky ahmadbky added the enhancement New feature or request label Apr 15, 2024
@ahmadbky ahmadbky self-assigned this Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant