feat: auto-generate multiplayer tokens

Replace manual token verification with automatic UUID generation.
Tokens are now auto-generated on first save and can be reset via button.

- Remove verification logic and base64 encoding
- Add ResetToken() method with UUID generation
- Sync profile username to web service settings
- Simplify UI and improve error messages

Based on Torzu PRs #22 and #28.

Co-authored-by: anon <anon@noreply.localhost>
Co-authored-by: spectranator <spectranator@y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
Zephyron
2025-10-21 18:34:18 +10:00
parent f6c2cfe69d
commit caf1f93131
5 changed files with 46 additions and 117 deletions

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <future>
@@ -183,10 +184,10 @@ void HostRoomWindow::Host() {
if (result.result_code != WebService::WebResult::Code::Success) {
QMessageBox::warning(
this, tr("Error"),
tr("Failed to announce the room to the public lobby. In order to host a "
"room publicly, you must have a valid citron account configured in "
"Emulation -> Configure -> Web. If you do not want to publish a room in "
"the public lobby, then select Unlisted instead.\nDebug Message: ") +
tr("Failed to announce the room to the public lobby. To host a room "
"publicly, you must have a generated token configured in "
"Emulation -> Configure -> Web. If you do not want to publish a room "
"in a public lobby, then select Unlisted instead.\n\nDebug Message: ") +
QString::fromStdString(result.result_string),
QMessageBox::Ok);
ui->host->setEnabled(true);