Kiiyya / BattleFox

A modern Procon replacement for Battlefield 4.
GNU Affero General Public License v3.0
8 stars 2 forks source link

Voting enhancements #15

Closed Razer2015 closed 3 years ago

Razer2015 commented 3 years ago

mapvote

Add support for voting with numbers !1 2 3

Also possibly add an option for voting with shorter map names? The shortest unambiguous name. For example: !metro !metr !met

Configurable shortest character count to prevent conflicts with other plugins? Or perhaps an option to add reserved commands in blacklist?

Kiiyya commented 3 years ago

The way to do this would be to add a parse_map function on MapPool which handles the numbers etc, since it stores the maps in a vector a not a hash map. Though, maybe the better would be to convert MapPool to use a hash map internally, and instead store the map vote numbers in the Extra (generic param, currently ()).

Or just get rid of MapPool entirely and add traits for HashMap<MapInPool>? Maybe while I'm at it, remove MapInPool too lol, and replace it with traits too. Hmm...

Kiiyya commented 3 years ago

Length consideration:

So in total, for at most 6 options, you get an upper bound of 24 + 44 * 2 = 112 characters, which is less than 127 characters, so it'll work.

...And that's about as much as I have energy for, for the whole week, likely.