Skip to content

Despecialize the master protocol definition and the string parsing#5

Open
illwieckz wants to merge 1 commit intomasterfrom
illwieckz/despecialize
Open

Despecialize the master protocol definition and the string parsing#5
illwieckz wants to merge 1 commit intomasterfrom
illwieckz/despecialize

Conversation

@illwieckz
Copy link
Member

@illwieckz illwieckz commented Feb 13, 2026

  • despecialize the master protocol definition and the string parsing
  • also implement World of Padman as an example

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:

  • StringParser
    • Q3StringParser (adds basic ^0 colors)
      • RGBStringParser (adds ^x000 colors)
        • DaemonStringParser (adds extra ^A colors)
          • 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_Protocol and uses Q3StringParser.

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:

[xon_server_list master_protocol='worldofpadman']

But in the future I would want to be able to do:

[xon_server_list master_protocol='q3' string_parser='q3' query_game='WorldofPadman' query_protocol='71' masters='master.worldofpadman.com:27955,master.worldofpadman.net:27955' prefix_url='worldofpadman://connect/']

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.

- despecialize the master protocol definition and the string parsing
- also implement World of Padman as an example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant