Re-use XMPP resource GUID for whole app runtime
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run

Instead of using a new GUID as part of the XMPP resource for each XMPP
connection, this keeps the same GUID as long as pyrogenesis is running.

This is meant to make it easier to detect players violating the Terms of
Use by using multiple accounts to smurf or circumvent bans, as after
this change it's not sufficient anymore to connect with another account
to stay anonymous, but instead players have to restart pyrogenesis as
well.
This commit is contained in:
Dunedan 2026-06-27 20:09:27 +02:00
parent bc0e043696
commit b848e760e4
No known key found for this signature in database
GPG key ID: 885B16854284E0B2

View file

@ -111,7 +111,8 @@ gloox::Client CreateClient(const bool regOpt, const std::string& username, const
return gloox::Client{servername};
// Generate a unique, unpredictable resource to allow multiple 0 A.D. instances to connect to the lobby.
gloox::JID clientJid(username + "@" + servername + "/0ad-" + ps_generate_guid());
static const CStr guid{ps_generate_guid()};
gloox::JID clientJid(username + "@" + servername + "/0ad-" + guid);
return gloox::Client{clientJid, password};
}