summaryrefslogtreecommitdiff
path: root/src/map/mail.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/mail.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/mail.c')
-rw-r--r--src/map/mail.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/map/mail.c b/src/map/mail.c
index 0640fa521..b2a4697e5 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -4,8 +4,10 @@
#ifndef TXT_ONLY
#include "../common/nullpo.h"
+#include "../common/showmsg.h"
#include "mail.h"
+#include "atcommand.h"
#include "itemdb.h"
#include "clif.h"
#include "pc.h"
@@ -177,4 +179,16 @@ void mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg)
clif_Mail_send(sd->fd, true);
}
+// This function only check if the mail operations are valid
+bool mail_invalid_operation(struct map_session_data *sd)
+{
+ if( !map[sd->bl.m].flag.town && pc_isGM(sd) < get_atcommand_level(atcommand_mail) )
+ {
+ ShowWarning("clif_parse_Mail: char '%s' trying to do invalid mail operations.\n", sd->status.name);
+ return true;
+ }
+
+ return false;
+}
+
#endif