From 2336ee4f840f1ef3df8d3dd6cae6d1b052c5f0c9 Mon Sep 17 00:00:00 2001 From: Matt Lowe Date: Tue, 14 Apr 2015 09:59:29 +0200 Subject: [PATCH] Updated invalid username dlg Relates to #964. We want to give a the correct reason for failed logins and display the reason why. --- cockatrice/src/window_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/window_main.cpp b/cockatrice/src/window_main.cpp index 51bb73c4d..186ab2fbb 100644 --- a/cockatrice/src/window_main.cpp +++ b/cockatrice/src/window_main.cpp @@ -78,7 +78,7 @@ void MainWindow::processConnectionClosedEvent(const Event_ConnectionClosed &even break; } case Event_ConnectionClosed::SERVER_SHUTDOWN: reasonStr = tr("Scheduled server shutdown."); break; - case Event_ConnectionClosed::USERNAMEINVALID: reasonStr = tr("Invalid username."); break; + case Event_ConnectionClosed::USERNAMEINVALID: reasonStr = tr("Invalid username.\nAvailable chars: [a-z][A-Z][0-9][-_]"); break; default: reasonStr = QString::fromStdString(event.reason_str()); } QMessageBox::critical(this, tr("Connection closed"), tr("The server has terminated your connection.\nReason: %1").arg(reasonStr)); @@ -261,7 +261,7 @@ void MainWindow::loginError(Response::ResponseCode r, QString reasonStr, quint32 break; } case Response::RespUsernameInvalid: - QMessageBox::critical(this, tr("Error"), tr("Invalid username.")); + QMessageBox::critical(this, tr("Error"), tr("Invalid username.\nAvailable chars: [a-z][A-Z][0-9][-_]")); break; case Response::RespRegistrationRequired: QMessageBox::critical(this, tr("Error"), tr("This server requires user registration."));