Skip to content
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

New BattlePoll message to inform Chobby about poll status #650

Open
DeinFreund opened this issue Oct 21, 2018 · 9 comments
Open

New BattlePoll message to inform Chobby about poll status #650

DeinFreund opened this issue Oct 21, 2018 · 9 comments

Comments

@DeinFreund
Copy link
Member

DeinFreund commented Oct 21, 2018

    [Message(Origin.Server)]
    public class BattlePoll
    {
        public class PollOption
        {
            public string Name { get; set; }
            public int Id { get; set; }
            public int Votes { get; set; }
        }

        public string Topic { get; set; }
        public List<PollOption> Options { get; set; } //Empty if there is no poll
        public int VotesToWin { get; set; } //If any single option receives this many votes, it will win instantly
    }

https://github.com/ZeroK-RTS/Zero-K-Infrastructure/blob/ed017f8181f5d7a9105db04b2fa22834f6c6a541/Shared/LobbyClient/Protocol/Messages.cs#L830

@DeinFreund
Copy link
Member Author

If there is no poll, VotesToWin is -1 and the other options are null

@GoogleFrog
Copy link

How does chobby send vote responses?

@DeinFreund
Copy link
Member Author

!vote [Id]
It is also backwards compatible with !y and !n for polls with only two options.

@Licho1
Copy link
Member

Licho1 commented Nov 11, 2018

Imo if we make a message it should be done all at once. Ingame, chobby (preferably using common code)

Problem is, old system relies on chat for communication and not chobby protocol.

@GoogleFrog
Copy link

How often and under which circumstances is this command sent? I dislike the unbounded number of poll options.

@GoogleFrog
Copy link

How can this be tested?

@DeinFreund
Copy link
Member Author

Merge ZeroK-RTS/Zero-K-Infrastructure#2431 to try it on the test server. Right now it will be four options for the automatic map vote and two options for all the old votes.

@GoogleFrog
Copy link

I want to use the current vote UI for yes/no votes, yet I see no hax-free way to detect these cases.

@DeinFreund
Copy link
Member Author

DeinFreund commented Nov 27, 2018

Added a bool DefaultPoll to the message, this signifies that there are only two options and !y and !n will select them appropriately.

ZeroK-RTS/Zero-K-Infrastructure@07b53d8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants