XQF / xqf

XQF game server browser
http://xqf.github.io
GNU General Public License v2.0
37 stars 12 forks source link

also write server_type enum from games.xml, avoid GAMES_TOTAL ambiguity #203

Closed illwieckz closed 6 years ago

illwieckz commented 6 years ago

Automatically generate the server_type enum from games.xml to reduce hand-written code and avoid sneaky sorting errors

GAMES_TOTAL is equal to UNKNOWN_SERVER and the GAMES_TOTAL name is ambiguous because people can believe it's the amount of games including UNKNOWN_SERVER.

Using UNKNOWN_SERVER instead of GAMES_TOTAL makes explicit that a code like that is listing every games except the unknown one:

        for (i = 0; i < UNKNOWN_SERVER; i+)