summaryrefslogtreecommitdiff
path: root/src/login/login.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-04-10 20:33:42 -0300
committershennetsind <ind@henn.et>2013-04-10 20:33:42 -0300
commit2b2b18938fe528f9999fb1674ed750c10f9c9880 (patch)
treeaa077d45bfaf24622e6e99b10e68d97df8587077 /src/login/login.c
parenta59be8328048f628cd200996b5d4a530a4d99cea (diff)
downloadhercules-2b2b18938fe528f9999fb1674ed750c10f9c9880.tar.gz
hercules-2b2b18938fe528f9999fb1674ed750c10f9c9880.tar.bz2
hercules-2b2b18938fe528f9999fb1674ed750c10f9c9880.tar.xz
hercules-2b2b18938fe528f9999fb1674ed750c10f9c9880.zip
Implementing the new "login-failed" packet
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/login/login.c')
-rw-r--r--src/login/login.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/login/login.c b/src/login/login.c
index 712fa0e31..16835d675 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -1325,18 +1325,31 @@ void login_auth_failed(struct login_session_data* sd, int result)
if( result == 1 && login_config.dynamic_pass_failure_ban )
ipban_log(ip); // log failed password attempt
+#if PACKETVER >= 20120000 /* not sure when this started */
+ WFIFOHEAD(fd,26);
+ WFIFOW(fd,0) = 0x83e;
+ WFIFOL(fd,2) = result;
+ if( result != 6 )
+ memset(WFIFOP(fd,6), '\0', 20);
+ else { // 6 = Your are Prohibited to log in until %s
+ struct mmo_account acc;
+ time_t unban_time = ( accounts->load_str(accounts, &acc, sd->userid) ) ? acc.unban_time : 0;
+ timestamp2string((char*)WFIFOP(fd,6), 20, unban_time, login_config.date_format);
+ }
+ WFIFOSET(fd,26);
+#else
WFIFOHEAD(fd,23);
WFIFOW(fd,0) = 0x6a;
WFIFOB(fd,2) = (uint8)result;
if( result != 6 )
memset(WFIFOP(fd,3), '\0', 20);
- else
- {// 6 = Your are Prohibited to log in until %s
+ else { // 6 = Your are Prohibited to log in until %s
struct mmo_account acc;
time_t unban_time = ( accounts->load_str(accounts, &acc, sd->userid) ) ? acc.unban_time : 0;
timestamp2string((char*)WFIFOP(fd,3), 20, unban_time, login_config.date_format);
}
WFIFOSET(fd,23);
+#endif
}
@@ -1493,7 +1506,7 @@ int parse_login(int fd)
login_auth_failed(sd, 3); // send "rejected from server"
return 0;
}
-
+
result = mmo_auth(sd, false);
if( result == -1 )