Page MenuHomeWildfire Games

Add XSDs for the custom XMPP IQ stanzas
Changes PlannedPublic

Authored by Dunedan on Oct 22 2017, 10:13 PM.

Details

Reviewers
user1
Summary

0ad and the XMPP bots talk to each other using custom IQ stanzas. Up to now these stanzas weren't properly defined so to check how they look like one had to look into the code itself. As there are two components in different languages implementing handling for these stanzas that caused a certain ambiguity.

This patch adds XSDs for the custom IQ stanzas used by 0ad. You can use tools like xmllint to verify a IQ stanza sent by 0ad fits the schema:

    
xmllint --noout --schema XSD_FILE XML_FILE

I wasn't sure where to put these files into, so if they should live somewhere else in the repo, just drop me a note.

Test Plan
  • Capture XMPP messages sent between 0ad and XpartaMuPP and verify they fit the proper schema.
  • Check the code of 0ad and XpartaMuPP to check if the XSDs handle all possible cases.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

Dunedan created this revision.Oct 22 2017, 10:13 PM
Dunedan planned changes to this revision.Jan 24 2018, 1:36 PM

XSD for game results is still missing.

Stan added a subscriber: Stan.Jan 24 2018, 2:48 PM

Might seem like a stupid question but why xsd when we use RNG and RNC everywhere else ?

Easy to answer:

  • I wasn't aware that there are already other schemas for XML documents in 0ad (I might have searched for XSD only).
  • XMPP extensions are usually defined using XSD (e.g. here is a random example: https://xmpp.org/extensions/xep-0092.html#schema)
Stan added a reviewer: user1.Jan 22 2021, 2:16 PM
Stan added a subscriber: user1.

@user1 What do you think of this patch?