Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
de6235f6
Commit
de6235f6
authored
Dec 12, 2015
by
ctrlaltca
Browse files
Merge pull request #1698 from ctrlaltca/fix_1694
Improved login error message
parents
a07b72a0
beecc0f9
Changes
5
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/dlg_connect.cpp
View file @
de6235f6
...
...
@@ -8,6 +8,7 @@
#include
<QDebug>
#include
<QEvent>
#include
<QKeyEvent>
#include
<QMessageBox>
#include
<iostream>
#include
"dlg_connect.h"
#include
"settingscache.h"
...
...
@@ -149,6 +150,12 @@ void DlgConnect::actOk()
settingsCache
->
servers
().
setPreviousHostList
(
hostList
);
settingsCache
->
servers
().
setPrevioushostindex
(
previousHosts
->
currentIndex
());
if
(
playernameEdit
->
text
().
isEmpty
())
{
QMessageBox
::
critical
(
this
,
tr
(
"Connect Warning"
),
tr
(
"The player name can't be empty."
));
return
;
}
accept
();
}
...
...
cockatrice/src/dlg_register.cpp
View file @
de6235f6
...
...
@@ -361,6 +361,11 @@ void DlgRegister::actOk()
QMessageBox
::
critical
(
this
,
tr
(
"Registration Warning"
),
tr
(
"Your email addresses do not match, please try again."
));
return
;
}
if
(
playernameEdit
->
text
().
isEmpty
())
{
QMessageBox
::
critical
(
this
,
tr
(
"Registration Warning"
),
tr
(
"The player name can't be empty."
));
return
;
}
settingsCache
->
servers
().
setHostName
(
hostEdit
->
text
());
settingsCache
->
servers
().
setPort
(
portEdit
->
text
());
...
...
common/server_protocolhandler.cpp
View file @
de6235f6
...
...
@@ -387,7 +387,7 @@ Response::ResponseCode Server_ProtocolHandler::cmdLogin(const Command_Login &cmd
QString
clientId
=
QString
::
fromStdString
(
cmd
.
clientid
()).
simplified
();
QString
clientVersion
=
QString
::
fromStdString
(
cmd
.
clientver
()).
simplified
();
if
(
userName
.
isEmpty
()
||
(
userInfo
!=
0
)
)
if
(
userInfo
!=
0
)
return
Response
::
RespContextError
;
// check client feature set against server feature set
...
...
servatrice/src/servatrice.cpp
View file @
de6235f6
...
...
@@ -176,7 +176,8 @@ bool Servatrice::initServer()
bool
registrationEnabled
=
settingsCache
->
value
(
"registration/enabled"
,
false
).
toBool
();
bool
requireEmailForRegistration
=
settingsCache
->
value
(
"registration/requireemail"
,
true
).
toBool
();
qDebug
()
<<
"Registration enabled: "
<<
regServerOnly
;
qDebug
()
<<
"Accept registered users only: "
<<
regServerOnly
;
qDebug
()
<<
"Registration enabled: "
<<
registrationEnabled
;
if
(
registrationEnabled
)
qDebug
()
<<
"Require email address to register: "
<<
requireEmailForRegistration
;
...
...
servatrice/src/servatrice_database_interface.cpp
View file @
de6235f6
...
...
@@ -124,6 +124,8 @@ bool Servatrice_DatabaseInterface::execSqlQuery(QSqlQuery *query)
bool
Servatrice_DatabaseInterface
::
usernameIsValid
(
const
QString
&
user
,
QString
&
error
)
{
int
minNameLength
=
settingsCache
->
value
(
"users/minnamelength"
,
6
).
toInt
();
if
(
minNameLength
<
1
)
minNameLength
=
1
;
int
maxNameLength
=
settingsCache
->
value
(
"users/maxnamelength"
,
12
).
toInt
();
bool
allowLowercase
=
settingsCache
->
value
(
"users/allowlowercase"
,
true
).
toBool
();
bool
allowUppercase
=
settingsCache
->
value
(
"users/allowuppercase"
,
true
).
toBool
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment