diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-10-12 19:33:10 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-10-21 04:21:52 +0300 |
commit | 1962fe593393d260c5f170c5fe6932e130e495bf (patch) | |
tree | 476783454adee1cac9b6c3ad03f2df487e4ee401 /src/char | |
parent | 6791b26d7865c38129abd80f8e8a6a62872238f4 (diff) | |
download | hercules-1962fe593393d260c5f170c5fe6932e130e495bf.tar.gz hercules-1962fe593393d260c5f170c5fe6932e130e495bf.tar.bz2 hercules-1962fe593393d260c5f170c5fe6932e130e495bf.tar.xz hercules-1962fe593393d260c5f170c5fe6932e130e495bf.zip |
Add rodex 2017 packets.
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/int_rodex.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/char/int_rodex.c b/src/char/int_rodex.c index c45c88eb0..994e8110e 100644 --- a/src/char/int_rodex.c +++ b/src/char/int_rodex.c @@ -92,6 +92,19 @@ static int inter_rodex_fromsql(int char_id, int account_id, int8 opentype, int64 return -1; } break; + + case RODEX_OPENTYPE_UNSET: + if (SQL_ERROR == SQL->StmtPrepare(stmt, + "SELECT `mail_id`, `sender_name`, `sender_id`, `receiver_name`, `receiver_id`, `receiver_accountid`," + "`title`, `body`, `zeny`, `type`, `is_read`, `send_date`, `expire_date`, `weight`" + "FROM `%s` WHERE `expire_date` > '%d' AND (`receiver_id` = '%d' or `receiver_accountid` = '%d') AND `mail_id` > '%"PRId64"'" + "ORDER BY `mail_id` ASC", rodex_db, (int)time(NULL), char_id, account_id, mail_id) + ) { + SqlStmt_ShowDebug(stmt); + SQL->StmtFree(stmt); + return -1; + } + break; } if (SQL_ERROR == SQL->StmtExecute(stmt) @@ -173,7 +186,18 @@ static int inter_rodex_fromsql(int char_id, int account_id, int8 opentype, int64 msg.type &= ~MAIL_TYPE_ZENY; } +#if PACKETVER >= 20170419 + if (opentype == RODEX_OPENTYPE_UNSET) { + if (msg.receiver_id != 0) + msg.opentype = RODEX_OPENTYPE_MAIL; + else + msg.opentype = RODEX_OPENTYPE_ACCOUNT; + } else { + msg.opentype = opentype; + } +#else msg.opentype = opentype; +#endif #if PACKETVER < 20160601 // NPC Message Type isn't supported in old clients msg.type &= ~MAIL_TYPE_NPC; |