Skip to content

Commit

Permalink
Send IQ response for gamereport requests
Browse files Browse the repository at this point in the history
XMPP demands a response for every IQ get/set stanza. This wasn't the
case for gamereport requests yet, so this commit adds it.

While Pyrogenesis neither expects nor handles these responses, it
doesn't result in any problems either.
  • Loading branch information
Dunedan committed May 16, 2024
1 parent cd00d9a commit b168928
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xpartamupp/echelon.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,10 +678,15 @@ def _iq_game_report_handler(self, iq):
if not iq['from'].resource.startswith('0ad'):
return

iq_r = iq.reply()

try:
self.report_manager.add_report(iq['from'], iq['gamereport']['game'])
except Exception:
logger.exception("Failed to update game statistics for %s", iq['from'].bare)
iq_r["error"]["condition"] = "internal-server-error"

iq_r.send()

rating_messages = self.leaderboard.get_rating_messages()
if rating_messages:
Expand Down

0 comments on commit b168928

Please sign in to comment.