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
Option polls #2431
Option polls #2431
Conversation
…d BattlePoll server message that is sent to inform users on poll updates.
Note that this requires changes ingame/chobby |
Yes, I'm waiting with this merge until @GoogleFrog is ready to use it in Chobby. |
for (int i = 0; i < NumberOfMapChoices; i++) | ||
{ | ||
Resource map; | ||
if (i < NumberOfMapChoices / 2 && MinimalMapSupportLevel < MapSupportLevel.Featured) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be simpler
if (i < NumberOfMapChoices / 2 && MinimalMapSupportLevel < MapSupportLevel.Featured) | |
if (i < NumberOfMapChoices / 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A server could be set to only allow Matchmaker maps. Imagine a 1v1 training server for example. In this case he should not show any featured maps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reminder for in-game compat
{ | ||
Ended = true; | ||
await battle.SayBattle($"Poll: {question} [END:FAILED]"); | ||
Outcome = new PollOutcome() { Success = false }; | ||
await battle.SayBattle($"Poll Ended: {Topic} [No option achieved absolute majority]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These messages have to be backwards compatible for in-game.
if (winCount <= 0) winCount = 1; | ||
|
||
if (!await Vote(e, true)) | ||
{ | ||
if (e == null) await battle.SayBattle($"Poll: {question} [!y=0/{winCount}, !n=0/{winCount}]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, this can't be removed because in-game needs it.
d9749c6
to
38abd5a
Compare
Polls now have multiple options instead of just Yes and No.