-
Notifications
You must be signed in to change notification settings - Fork 7
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
Is there any way to update a match as a tie? #20
Comments
Hmm yeah as far as I can tell there is currently no way to do this. I have tested a bit, and the api doesn't seem to recognise the id in String form (e.g. Also a note on forward compatibility - challonge-java uses the v1 api currently which will be deprecated someday (which I didn't know until today). I don't know if there are plans to migrate this project to v2, so it might break in the future. |
Yeah, I seem to have overlooked this when writing the first implementation. The easiest fix I see would be to change Something like this: @Data
@Builder
public class MatchQuery {
/**
* winnerId can be either a long identifying the winner of the match or the string "tie" to declare the match as tied.
**/
private Object winnerId;
private Integer votesForPlayer1;
private Integer votesForPlayer2;
private String scoresCsv;
public static class MatchQueryBuilder {
public MatchQueryBuilder winnerId(final Long winnerId) {
this.winnerId = winnerId;
return this;
}
public MatchQueryBuilder winnerTied() {
this.winnerId = "tie";
return this;
}
}
} Any opinions on this solution? I also tested the API a little bit as I was unsure if tied matches would maybe return a string as |
Also, the little red banner on the Challonge API page that states that certain features will be available in v2 of the API has been around for years. I don't see v2 of the API being released or the current version being deprecated any time soon. Any updates on that matter will probably be announced in the Google group, but as you can see the last update is from 2017 - so there is probably no hope. |
I'll look at the other comment in a bit, but the v2 I'm referring to is at https://challonge.com/de/connect, and the docs are at https://www.notion.so/Challonge-Connect-Documentation-ab016fd6b875474b9b67b9d8f8590497. They don't seem to have announced it in their changelogs or api changelogs, I only saw it because of a banner on the v1 documentation page. |
This would probably work well. A disadvantage would be that in An alternative would be to add a boolean I don't know if either approach is strictly better here. But I think those are probably the best approaches for this problem. |
As an extra field would most definitely make more sense from a design perspective, having the I also didn't know about Challonge Connect. This will require a major rework and is probably a good opportunity to finally port this project to Kotlin. I probably won't have time to do this before fall, though. |
I'm currently working on a bot for a league system where, on some occasions, a tie is possible (in a round robin).
However, i can only provide a Long for MatchQueryBuilder#winnerId, but the Challonge API insists on having a String of
"tie"
as winnerId (if a tie occurs.)Leaving the winnersId
null
or0L
will leave the match open and inputting something else than the participant's IDs will throw a DataAccessException.I was looking in every Java file involved for some clues, but to no avail.
Is there any way to update a match as a tie?
The text was updated successfully, but these errors were encountered: