summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-02 23:03:22 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-02 23:03:22 +0000
commitebf0ba7ddf1ef2c10515a1607ce7d4316e001a61 (patch)
tree51d030ed2e8e3c841690c3d879257270a2bb9064 /src/map/clif.c
parentc90e9f42da90183a0be9c29a11beec7db606d44f (diff)
downloadhercules-ebf0ba7ddf1ef2c10515a1607ce7d4316e001a61.tar.gz
hercules-ebf0ba7ddf1ef2c10515a1607ce7d4316e001a61.tar.bz2
hercules-ebf0ba7ddf1ef2c10515a1607ce7d4316e001a61.tar.xz
hercules-ebf0ba7ddf1ef2c10515a1607ce7d4316e001a61.zip
- 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
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c15
1 files changed, 15 insertions, 0 deletions
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);