summaryrefslogtreecommitdiff
path: root/src/char_sql/int_mail.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-08 20:11:28 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-08 20:11:28 +0000
commit603dc60466a7067ecb68384185cb1c20aaea7366 (patch)
treeb8e75ab3e5b7fe481571738ad7454262607d403f /src/char_sql/int_mail.c
parent1f4883d1f4fb65260691692879a795992fdbcf88 (diff)
downloadhercules-603dc60466a7067ecb68384185cb1c20aaea7366.tar.gz
hercules-603dc60466a7067ecb68384185cb1c20aaea7366.tar.bz2
hercules-603dc60466a7067ecb68384185cb1c20aaea7366.tar.xz
hercules-603dc60466a7067ecb68384185cb1c20aaea7366.zip
- Auction System implementation completed.
- As mail system, this will need a "mapflag" or something to only allow auctions on some maps. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12325 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql/int_mail.c')
-rw-r--r--src/char_sql/int_mail.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/char_sql/int_mail.c b/src/char_sql/int_mail.c
index 9ef9f9fd3..9ae4e1ccd 100644
--- a/src/char_sql/int_mail.c
+++ b/src/char_sql/int_mail.c
@@ -429,6 +429,27 @@ static void mapif_parse_Mail_send(int fd)
mapif_Mail_send(fd, &msg);
}
+void mail_sendmail(int send_id, const char* send_name, int dest_id, const char* dest_name, const char* title, const char* body, int zeny, struct item *item)
+{
+ struct mail_message msg;
+ memset(&msg, 0, sizeof(struct mail_message));
+
+ msg.send_id = send_id;
+ safestrncpy(msg.send_name, send_name, NAME_LENGTH);
+ msg.dest_id = dest_id;
+ safestrncpy(msg.dest_name, dest_name, NAME_LENGTH);
+ safestrncpy(msg.title, title, MAIL_TITLE_LENGTH);
+ safestrncpy(msg.body, body, MAIL_BODY_LENGTH);
+ msg.zeny = zeny;
+ if( item != NULL )
+ memcpy(&msg.item, item, sizeof(struct item));
+
+ msg.timestamp = (int)calc_times();
+
+ mail_savemessage(&msg);
+ mapif_Mail_new(&msg);
+}
+
/*==========================================
* Packets From Map Server
*------------------------------------------*/