From 67f080a4854c92caeb5091472f6c6032de5fa3f5 Mon Sep 17 00:00:00 2001 From: euphyy Date: Fri, 12 Apr 2013 02:17:44 +0000 Subject: [PATCH] * Implemented new "login-failed" packet for 2012 clients. (Hercules 2b2b189) * Added birthdate to @accinfo. (Hercules 57b5943) * Some other insignificant changes. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17250 54d463be-8e91-2dee-dedb-b68131a5f0ec --- npc/re/instances/OctopusCave.txt | 2 +- src/char/inter.c | 9 +++++---- src/login/login.c | 17 +++++++++++++++-- src/map/atcommand.c | 4 ++-- src/map/guild.c | 1 - src/map/status.c | 2 +- 6 files changed, 24 insertions(+), 11 deletions(-) diff --git a/npc/re/instances/OctopusCave.txt b/npc/re/instances/OctopusCave.txt index aa08e7af89..8a950aee0e 100644 --- a/npc/re/instances/OctopusCave.txt +++ b/npc/re/instances/OctopusCave.txt @@ -1,5 +1,5 @@ //===== rAthena Script ======================================= -//= Octopus Cave +//= Octopus Cave //===== By: ================================================== //= Muad_Dib //===== Current Version: ===================================== diff --git a/src/char/inter.c b/src/char/inter.c index 18d17c4553..aae832f246 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -425,10 +425,10 @@ void mapif_parse_accinfo(int fd) { /* it will only get here if we have a single match */ if( account_id ) { - char userid[NAME_LENGTH], user_pass[NAME_LENGTH], email[40], last_ip[20], lastlogin[30], pincode[5]; + char userid[NAME_LENGTH], user_pass[NAME_LENGTH], email[40], last_ip[20], lastlogin[30], pincode[5], birthdate[11]; short level = -1; int logincount = 0,state = 0; - if ( SQL_ERROR == Sql_Query(sql_handle, "SELECT `userid`, `user_pass`, `email`, `last_ip`, `group_id`, `lastlogin`, `logincount`, `state`,`pincode` FROM `login` WHERE `account_id` = '%d' LIMIT 1", account_id) + if ( SQL_ERROR == Sql_Query(sql_handle, "SELECT `userid`, `user_pass`, `email`, `last_ip`, `group_id`, `lastlogin`, `logincount`, `state`,`pincode`,`birthdate` FROM `login` WHERE `account_id` = '%d' LIMIT 1", account_id) || Sql_NumRows(sql_handle) == 0 ) { if( Sql_NumRows(sql_handle) == 0 ) { inter_to_fd(fd, u_fd, aid, "No account with ID '%d' was found.", account_id ); @@ -447,6 +447,7 @@ void mapif_parse_accinfo(int fd) { Sql_GetData(sql_handle, 6, &data, NULL); logincount = atoi(data); Sql_GetData(sql_handle, 7, &data, NULL); state = atoi(data); Sql_GetData(sql_handle, 8, &data, NULL); safestrncpy(pincode, data, sizeof(pincode)); + Sql_GetData(sql_handle, 9, &data, NULL); safestrncpy(birthdate, data, sizeof(birthdate)); } Sql_FreeResult(sql_handle); @@ -464,9 +465,9 @@ void mapif_parse_accinfo(int fd) { inter_to_fd(fd, u_fd, aid, "Password: %s", user_pass ); } - inter_to_fd(fd, u_fd, aid, "Account e-mail: %s", email); + inter_to_fd(fd, u_fd, aid, "Account e-mail: %s | Birthdate: %s", email, birthdate); inter_to_fd(fd, u_fd, aid, "Last IP: %s (%s)", last_ip, geoip_getcountry(str2ip(last_ip)) ); - inter_to_fd(fd, u_fd, aid, "This user has logged %d times, the last time were at %s", logincount, lastlogin ); + inter_to_fd(fd, u_fd, aid, "This user has logged in %d times, the last time was at %s", logincount, lastlogin ); inter_to_fd(fd, u_fd, aid, "-- Character Details --" ); diff --git a/src/login/login.c b/src/login/login.c index 0e6aa50177..9fdc6b99b1 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -1309,18 +1309,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 } diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 294450c890..60673e5353 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -8835,8 +8835,6 @@ ACMD_FUNC(join) { } static inline void atcmd_channel_help(int fd, const char *command, bool can_create) { - sprintf(atcmd_output, msg_txt(1404),command); // %s failed. - clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(1414));// ---- Available options: if( can_create ) { sprintf(atcmd_output, msg_txt(1415),command);// * %s create <#channel_name> @@ -8863,6 +8861,8 @@ static inline void atcmd_channel_help(int fd, const char *command, bool can_crea sprintf(atcmd_output, msg_txt(1429),command);// * %s unbind clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(1430));// -- Unbinds your global chat from the attached channel, if any. + sprintf(atcmd_output, msg_txt(1404),command); // %s failed. + clif_displaymessage(fd, atcmd_output); } ACMD_FUNC(channel) { diff --git a/src/map/guild.c b/src/map/guild.c index a45d036a22..bc6b3753a1 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -401,7 +401,6 @@ int guild_create(struct map_session_data *sd, const char *name) int guild_created(int account_id,int guild_id) { struct map_session_data *sd=map_id2sd(account_id); - struct guild *guild; if(sd==NULL) return 0; diff --git a/src/map/status.c b/src/map/status.c index 2e4e0d0242..45279b20d5 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -6620,7 +6620,7 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty } undead_flag = battle_check_undead(status->race,status->def_ele); - //Check for inmunities / sc fails + //Check for immunities / sc fails switch (type) { case SC_ANGRIFFS_MODUS: case SC_GOLDENE_FERSE: