Removed password output from atcommand accinfo

Thanks to @4144 for bringing this absurd thing to our attention in HerculesWS/Hercules#1975
This commit is contained in:
Lemongrass3110
2018-02-15 23:19:27 +01:00
parent e1b9d24324
commit 2746e0d351
5 changed files with 9 additions and 18 deletions

View File

@@ -149,7 +149,7 @@
216: No account with ID '%d' was found.
217: -- Account %d --
218: User: %s | GM Group: %d | State: %d
219: Password: %s (PIN:%s)
//219: FREE
220: ****
221: Account e-mail: %s | Birthdate: %s
222: Last IP: %s (%s)

View File

@@ -686,16 +686,16 @@ int chlogif_parse_AccInfoAck(int fd) {
return 0;
else {
int8 type = RFIFOB(fd, 18);
if (type == 0 || RFIFOREST(fd) < 155+PINCODE_LENGTH+NAME_LENGTH) {
mapif_accinfo_ack(false, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOL(fd,14), 0, -1, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
if (type == 0 || RFIFOREST(fd) < 122+NAME_LENGTH) {
mapif_accinfo_ack(false, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOL(fd,14), 0, -1, 0, 0, NULL, NULL, NULL, NULL, NULL);
RFIFOSKIP(fd,19);
return 1;
}
type>>=1;
mapif_accinfo_ack(true, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOL(fd,14), type, RFIFOL(fd,19), RFIFOL(fd,23), RFIFOL(fd,27),
RFIFOCP(fd,31), RFIFOCP(fd,71), RFIFOCP(fd,87), RFIFOCP(fd,111),
RFIFOCP(fd,122), RFIFOCP(fd,155), RFIFOCP(fd,155+PINCODE_LENGTH));
RFIFOSKIP(fd,155+PINCODE_LENGTH+NAME_LENGTH);
RFIFOCP(fd,122));
RFIFOSKIP(fd,122+NAME_LENGTH);
}
return 1;
}

View File

@@ -489,7 +489,7 @@ void mapif_parse_accinfo(int fd) {
*/
void mapif_accinfo_ack(bool success, int map_fd, int u_fd, int u_aid, int account_id, int8 type,
int group_id, int logincount, int state, const char *email, const char *last_ip, const char *lastlogin,
const char *birthdate, const char *user_pass, const char *pincode, const char *userid)
const char *birthdate, const char *userid)
{
if (map_fd <= 0 || !session_isActive(map_fd))
@@ -507,7 +507,6 @@ void mapif_accinfo_ack(bool success, int map_fd, int u_fd, int u_aid, int accoun
inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(217), account_id);
inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(218), userid, group_id, state);
inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(219), user_pass[0] != '\0' ? user_pass : msg_txt(220), pincode[0] != '\0' ? msg_txt(220) : pincode);
inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(221), email, birthdate);
inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(222), last_ip, geoip_getcountry(str2ip(last_ip)));
inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(223), logincount, lastlogin);

View File

@@ -26,7 +26,7 @@ int inter_mapif_init(int fd);
int mapif_disconnectplayer(int fd, uint32 account_id, uint32 char_id, int reason);
void mapif_accinfo_ack(bool success, int map_fd, int u_fd, int u_aid, int account_id, int8 type,
int group_id, int logincount, int state, const char *email, const char *last_ip, const char *lastlogin,
const char *birthdate, const char *user_pass, const char *pincode, const char *userid);
const char *birthdate, const char *userid);
int inter_log(const char *fmt,...);

View File

@@ -725,7 +725,7 @@ int logchrif_parse_accinfo(int fd) {
// Send back the result to char-server
if (accounts->load_num(accounts, &acc, account_id)) {
int len = 155 + PINCODE_LENGTH + NAME_LENGTH;
int len = 122 + NAME_LENGTH;
//ShowInfo("Found account info for %d, requested by %d\n", account_id, u_aid);
WFIFOHEAD(fd, len);
WFIFOW(fd, 0) = 0x2721;
@@ -741,15 +741,7 @@ int logchrif_parse_accinfo(int fd) {
safestrncpy(WFIFOCP(fd, 71), acc.last_ip, 16);
safestrncpy(WFIFOCP(fd, 87), acc.lastlogin, 24);
safestrncpy(WFIFOCP(fd, 111), acc.birthdate, 11);
if ((unsigned int)u_group >= acc.group_id) {
safestrncpy(WFIFOCP(fd, 122), acc.pass, 33);
safestrncpy(WFIFOCP(fd, 155), acc.pincode, PINCODE_LENGTH);
}
else {
memset(WFIFOP(fd, 122), '\0', 33);
memset(WFIFOP(fd, 155), '\0', PINCODE_LENGTH);
}
safestrncpy(WFIFOCP(fd, 155 + PINCODE_LENGTH), acc.userid, NAME_LENGTH);
safestrncpy(WFIFOCP(fd, 122), acc.userid, NAME_LENGTH);
WFIFOSET(fd, len);
}
else {