Closed Douile closed 9 months ago
Great PR, very happy to see that adding a game can be simplified drastically, we can now also add query_with_timeout
and the other good stuff.
Further reduction is likely possible if we wrote a macro that made use of the generic implementation and called [...]
For sure, that can be done eventually.
But I think (and want to) further reduce code in a simple way:
Remove game files and have a separate file like valve
that defines all those games and modify the macro to include a namespace of their id mod game_id { //... }
, as I said I don't really know macros, but I think that's possible.
For sure, that can be done eventually. I think (and want to) further reduce code in a simple way: Remove game files and have a separate file like
valve
that defines all those games and modify the macro to include a namespace of their idmod game_id { //... }
, as I said I don't really know macros, but I think that's possible.
That's definitely possible, great idea.
A bit of python magic later, and I've moved them into protocol-specific files.
Using macros we can reduce the amount of code we have to write for each game.
Further reduction is likely possible if we wrote a macro that made use of the generic implementation and called the game query function macro generation as well as the game definition generation macro from the same place. But I think a ~500 line reduction is a good start.
These macros have the added nicety of generating doc comments for all the game query function based on the protocol, game name/protocol version, and default port.
Closes #120.