summaryrefslogtreecommitdiff
path: root/src/gui/login.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-04-09 10:41:28 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-04-09 10:41:28 +0000
commitcfe8dc3f2e2d7d03491be03513a19221ccfad457 (patch)
tree4b8e9abaa07cd5201f17da0b375b52dab11de389 /src/gui/login.cpp
parent16ef8c97d9da0f2346af1f6426944379730fa6f4 (diff)
downloadmana-cfe8dc3f2e2d7d03491be03513a19221ccfad457.tar.gz
mana-cfe8dc3f2e2d7d03491be03513a19221ccfad457.tar.bz2
mana-cfe8dc3f2e2d7d03491be03513a19221ccfad457.tar.xz
mana-cfe8dc3f2e2d7d03491be03513a19221ccfad457.zip
Added check for username length > 4 characters
Diffstat (limited to 'src/gui/login.cpp')
-rw-r--r--src/gui/login.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/login.cpp b/src/gui/login.cpp
index ab06be75..bedc1e5d 100644
--- a/src/gui/login.cpp
+++ b/src/gui/login.cpp
@@ -119,6 +119,8 @@ void LoginDialog::action(const std::string& eventId)
// Check login
if (user.length() == 0) {
new OkDialog("Error", "Enter your username first");
+ } else if (user.length() < 4) {
+ new OkDialog("Error", "The username needs to be at least 4 characters");
} else {
server_login(user, passField->getText());
close_session();
@@ -193,8 +195,6 @@ void server_login(const std::string& user, const std::string& pass) {
while ((in_size < 23) || (out_size > 0)) {
flush();
}
- logger.log("Network: Packet ID: %x", RFIFOW(0));
- logger.log("Network: Packet length: %d", get_packet_length(RFIFOW(0)));
if (RFIFOW(0) == 0x0069) {
while (in_size < RFIFOW(2)) {
@@ -216,7 +216,6 @@ void server_login(const std::string& user, const std::string& pass) {
logger.log("Network: Server: %s (%s:%d)", server_info[0].name,
iptostring(server_info[0].address),
server_info[0].port);
- logger.log("Network: Users: %d", server_info[0].online_users);
RFIFOSKIP(RFIFOW(2));
}
else if (RFIFOW(0) == 0x006a) {