summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-06-25 01:03:59 +0200
committerHaru <haru@dotalux.com>2018-06-30 01:51:12 +0200
commited92fbc689ac441d0e42c3e332620f8410206e55 (patch)
tree3cd560c0a132247d104bbe3f0743ba28854825e8 /src/char
parent8b68532c0858889fe734b85c46c89a67ba832195 (diff)
downloadhercules-ed92fbc689ac441d0e42c3e332620f8410206e55.tar.gz
hercules-ed92fbc689ac441d0e42c3e332620f8410206e55.tar.bz2
hercules-ed92fbc689ac441d0e42c3e332620f8410206e55.tar.xz
hercules-ed92fbc689ac441d0e42c3e332620f8410206e55.zip
Move some non-mapif functionality from the mapif interface to the inter_rodex interface
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char')
-rw-r--r--src/char/int_rodex.c24
-rw-r--r--src/char/int_rodex.h1
2 files changed, 19 insertions, 6 deletions
diff --git a/src/char/int_rodex.c b/src/char/int_rodex.c
index 0dab66f61..8494c6427 100644
--- a/src/char/int_rodex.c
+++ b/src/char/int_rodex.c
@@ -444,13 +444,10 @@ void mapif_parse_rodex_checkhasnew(int fd)
/*==========================================
* Update/Delete mail
*------------------------------------------*/
-void mapif_parse_rodex_updatemail(int fd)
+bool inter_rodex_updatemail(int64 mail_id, int8 flag)
{
- int64 mail_id = RFIFOL(fd, 2);
- int8 flag = RFIFOB(fd, 10);
-
- Assert_retv(mail_id > 0);
- Assert_retv(flag >= 0 && flag <= 4);
+ Assert_retr(false, mail_id > 0);
+ Assert_retr(false, flag >= 0 && flag <= 4);
switch (flag) {
case 0: // Read
@@ -481,7 +478,21 @@ void mapif_parse_rodex_updatemail(int fd)
if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `sender_read` = 1 WHERE `mail_id` = '%"PRId64"'", rodex_db, mail_id))
Sql_ShowDebug(inter->sql_handle);
break;
+ default:
+ return false;
}
+ return true;
+}
+
+/*==========================================
+ * Update/Delete mail
+ *------------------------------------------*/
+void mapif_parse_rodex_updatemail(int fd)
+{
+ int64 mail_id = RFIFOL(fd, 2);
+ int8 flag = RFIFOB(fd, 10);
+
+ inter_rodex->updatemail(mail_id, flag);
}
/*==========================================
@@ -588,4 +599,5 @@ void inter_rodex_defaults(void)
inter_rodex->fromsql = inter_rodex_fromsql;
inter_rodex->hasnew = inter_rodex_hasnew;
inter_rodex->checkname = inter_rodex_checkname;
+ inter_rodex->updatemail = inter_rodex_updatemail;
}
diff --git a/src/char/int_rodex.h b/src/char/int_rodex.h
index 801ebcb89..43e2d891c 100644
--- a/src/char/int_rodex.h
+++ b/src/char/int_rodex.h
@@ -36,6 +36,7 @@ struct inter_rodex_interface {
bool (*hasnew) (int char_id, int account_id);
bool (*checkname) (const char *name, int *target_char_id, short *target_class, int *target_level);
int64 (*savemessage) (struct rodex_message* msg);
+ bool (*updatemail) (int64 mail_id, int8 flag);
};
#ifdef HERCULES_CORE