Re-use XMPP resource GUID for whole app runtime

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
+2 -1
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};
}