Despecialize the master protocol definition and the string parsing#5
Open
Despecialize the master protocol definition and the string parsing#5
Conversation
- despecialize the master protocol definition and the string parsing - also implement World of Padman as an example
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.
This patch is motivated by the need to make Xonpress easier to integrate for other idTech-derivated games, especially make it usable by our friends of WorldOfPadman.
So we now have this hierarchy of master protocol definitions:
Q3_Protocol(base engine definition)WoP_Protocol(game definition)Darkplaces_Protocol(base engine definition)Xonotic_Protocol(game definition)Daemon_Protocol(base engine definition)Unvanquished_Protocol(game definition)We also now have this hierarchy of string parsers:
StringParserQ3StringParser(adds basic^0colors)RGBStringParser(adds^x000colors)DaemonStringParser(adds extra^Acolors)UnvanquishedStringParser(adds[name]icons)DarkplacesStringParser(adds specific characters)This despecialization make it easier to specialize the plugin for other games, for example the World of Padman implementation now extends
Q3_Protocoland usesQ3StringParser.Actually I would like to configuration strings currently set in Protocol extension classes to be set instead, either in pluging configuration, either as string in the page itself.
Currently we can do:
But in the future I would want to be able to do:
and remove all the game-specific classes extending engine classes created just to set configuration.
But the current implementation is good enough as a first step.
I tested the code on a staging version of our wordpress. I tested both Unvanquished, WoP and Xonotic.
A work-in-progress WoP instance can be seen there: https://worldofpadman.net/en/servers/
When testing Xonotic (to make sure I didn't break Darkplaces support), I noticed that the QFont support makes PHP leak memory (in a way the page isn't rendered because PHP aborts), but that's not my fault, it can be disabled in options by the way.
Adding support for World of Padman shows that the current scheme implementation is wrong as it makes assumptions that should not be made, the code still works but it may be reworded later to be semantically easier to follow.