From ebf0ba7ddf1ef2c10515a1607ce7d4316e001a61 Mon Sep 17 00:00:00 2001 From: zephyrus Date: Sun, 2 Mar 2008 23:03:22 +0000 Subject: - The last, i hope, fix to the mail system. * kRO have a possible way to read mail by just sending the open mail window packet to the client. This protection adds a mapflag town, to set the only maps that allow mail operations. because there is no way to know when client closes the mail inbox window. * git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12279 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/clif.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 3c84b9df6..21e1d5e46 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11441,6 +11441,9 @@ void clif_parse_Mail_refreshinbox(int fd, struct map_session_data *sd) { struct mail_data* md = &sd->mail.inbox; + if( mail_invalid_operation(sd) ) + return; + if( md->amount < MAIL_MAX_INBOX && (md->full || md->changed) ) intif_Mail_requestinbox(sd->status.char_id, 1); else @@ -11517,6 +11520,9 @@ void clif_Mail_read(struct map_session_data *sd, int mail_id) void clif_parse_Mail_read(int fd, struct map_session_data *sd) { + if( mail_invalid_operation(sd) ) + return; + clif_Mail_read(sd, RFIFOL(fd,2)); } @@ -11528,6 +11534,9 @@ void clif_parse_Mail_getattach(int fd, struct map_session_data *sd) int i, mail_id = RFIFOL(fd,2); bool fail = false; + if( mail_invalid_operation(sd) ) + return; + ARR_FIND(0, MAIL_MAX_INBOX, i, sd->mail.inbox.msg[i].id == mail_id); if( i == MAIL_MAX_INBOX ) return; @@ -11580,6 +11589,9 @@ void clif_parse_Mail_delete(int fd, struct map_session_data *sd) { int i, mail_id = RFIFOL(fd,2); + if( mail_invalid_operation(sd) ) + return; + ARR_FIND(0, MAIL_MAX_INBOX, i, sd->mail.inbox.msg[i].id == mail_id); if (i < MAIL_MAX_INBOX) { @@ -11602,6 +11614,9 @@ void clif_parse_Mail_return(int fd, struct map_session_data *sd) { int i, mail_id = RFIFOL(fd,2); + if( mail_invalid_operation(sd) ) + return; + ARR_FIND(0, MAIL_MAX_INBOX, i, sd->mail.inbox.msg[i].id == mail_id); if (i < MAIL_MAX_INBOX) intif_Mail_return(sd->status.char_id, mail_id); -- cgit v1.2.3-70-g09d2