Open ckocank opened 1 week ago
Can you give more context? What game is it? How can both of them lose?
Can you give more context? What game is it? How can both of them lose?
I have a condition that both player must have met before the match start. If one player fail to match the condition, the other will win. So both player fail to match the condition, they will be eliminated. In round-robin, I can set a match draw but not elimination.
Can you forfeit them instead?
Can you forfeit them instead?
https://drarig29.github.io/brackets-docs/reference/manager/functions/helpers.setForfeits.html Is this the fuction you are talking about?
https://drarig29.github.io/brackets-docs/reference/manager/functions/helpers.setForfeits.html Is this the fuction you are talking about?
No, generally you should not have to use helpers. I'm talking about using the usual manager.update.match()
method.
You can pass forfeits there:
await manager.update.match({
id: YOUR_MATCH_ID,
opponent1: { forfeit: true },
opponent2: { forfeit: true },
});
See unit tests:
I have a condition that both player must have met before the match start.
I'm going to close the issue because this is the only solution, and you can say that "players failing to match those conditions will be forfeited". Cheers! 🥂
Thanks for your replied. I tried
await manager.update.match({
id: match.id,
opponent1: { id: match.opponent1.id, forfeit: true },
opponent2: { id: match.opponent2.id, forfeit: true },
});
But it return
Error: There are two forfeits.
I can only forfeit 1 player.
Ha... OK I think I designed it this way (double forfeits are only supported in round-robin), but I agree there is a use case.
I'll try to fix this so you are able to have 2 forfeits.
Due to https://github.com/Drarig29/brackets-manager.js/issues/160 I know there can't be 2 player lose at the same time but I want to make this case works, any idea how? Both player will be eliminated at the same time.