Prevent players in waitlist from being considered in votes #2780#3020
Open
ykc1n wants to merge 6 commits intoZeroK-RTS:masterfrom
Open
Prevent players in waitlist from being considered in votes #2780#3020ykc1n wants to merge 6 commits intoZeroK-RTS:masterfrom
ykc1n wants to merge 6 commits intoZeroK-RTS:masterfrom
Conversation
Contributor
|
Where is the part where the votes required is set to only take the number of non-waitlist players into account? Or is that already the case? |
Author
|
It should already be the case: numvoters only considers users who are not given an ineligibilty reason. GetIneligibiltyReason simply just uses GetRunPermissions, which is the function i changed to reject a player who is in the waitlist. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Battlecommand.GetRunPermissions()will now check if the player is in the waitlist, before considering the player as part of a vote.I added a function in
ServerBattle,public bool ServerBattle.IsInWaitlist(username), that takes in a player's username, and returns a boolean to check whether or not they are in the waitlist.The logic in this function is basically identical to the first few lines in
ServerBattle.StartGame(). As far as I can tell, this is how you determine if a player is in the waitlist.If a player is considered part of the waitlist, they will not be able to vote, and the bot will specify that players in the waitlist should not be able to vote.
Some thoughts / concerns:
Not sure if there should be any difference between spectator and waitlisted specified in the messages.
Not sure if im missing any logic or edge cases in
IsInWaitlist(). It seems to be fine, since its exactly the code that determines what players actually play or not when a game is started, but still.Not sure if its safe to call
battle.IsInWaitlist(); I dont know if battle can be null when a vote is caused, and if that will cause some crash.