Closed GrimLothar closed 1 year ago
Hey!! Thanks!
Sorry for the (big) delay, I don't have much time anymore to spend on this project.
You can use manager.update.match()
. You have to update matches one by one, because the lib is intended to be used on an event basis, when a tournament is running. See the latest README.
See https://github.com/Drarig29/brackets-manager.js/pull/147 (released in v1.5.0)
See https://github.com/Drarig29/brackets-manager.js/pull/147 (released in v1.5.0)
If you know the current round (with manager.get.currentRound()
for example), depending on how your storage works, you can either search for a round which has an ID of currentRound.id + 1
or a round number of currentRound.number + 1
in the same group.
If you know that IDs are consecutive in your storage (e.g. auto-incremented with SQL, or you use the JSON storage), you can directly query manager.storage.select('match', { round_id: currentRound.id + 1 })
.
Otherwise, you'll first have to first find the next round:
const nextRound = await manager.storage.select('round', { group_id: currentRound.group_id, number: currentRound.number + 1 });
And then:
const nextRoundMatches = await manager.storage.select('match', { round_id: nextRound.id });
Closing for now, but don't hesitate to ask more questions :wink:
Oh this is awesome!! Thank you! Been focusing on building the actual game first, but now i'm getting back to this, so timing is perfect! (+/- a couple of months lol)
Hey!! This seems like a great library, but is there any chance we can get a bit more documentation on how to use it?
I see in the getting started how to create a stage. But how do we update matches? how to get all the matches in the current round? how to know if a round is finished and get all the matches for the next round? etc
Thanks!