summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-04-12 00:31:40 +0300
committerAndrei Karas <akaras@inbox.ru>2019-04-14 01:14:56 +0300
commit5b502a267b6546ade4adb116d11354f0bf929cbf (patch)
treecbfe974ab458c6accf7c2db35b2cb1aceb8d7b28 /src
parentab81d4012eac5c2c00c485971fc9b89bf69761be (diff)
downloadhercules-5b502a267b6546ade4adb116d11354f0bf929cbf.tar.gz
hercules-5b502a267b6546ade4adb116d11354f0bf929cbf.tar.bz2
hercules-5b502a267b6546ade4adb116d11354f0bf929cbf.tar.xz
hercules-5b502a267b6546ade4adb116d11354f0bf929cbf.zip
Add account id and char id into inter server rodex update packet
Diffstat (limited to 'src')
-rw-r--r--src/char/int_rodex.c5
-rw-r--r--src/char/int_rodex.h2
-rw-r--r--src/char/inter.c2
-rw-r--r--src/char/mapif.c9
-rw-r--r--src/map/intif.c15
-rw-r--r--src/map/intif.h2
-rw-r--r--src/map/rodex.c12
7 files changed, 29 insertions, 18 deletions
diff --git a/src/char/int_rodex.c b/src/char/int_rodex.c
index 5725c3777..a21629344 100644
--- a/src/char/int_rodex.c
+++ b/src/char/int_rodex.c
@@ -349,8 +349,11 @@ static int64 inter_rodex_savemessage(struct rodex_message *msg)
/*==========================================
* Update/Delete mail
*------------------------------------------*/
-static bool inter_rodex_updatemail(int64 mail_id, int8 flag)
+static bool inter_rodex_updatemail(int fd, int account_id, int char_id, int64 mail_id, uint8 opentype, int8 flag)
{
+ Assert_retr(false, fd >= 0);
+ Assert_retr(false, account_id > 0);
+ Assert_retr(false, char_id > 0);
Assert_retr(false, mail_id > 0);
Assert_retr(false, flag >= 0 && flag <= 4);
diff --git a/src/char/int_rodex.h b/src/char/int_rodex.h
index 7fae77d8d..f081d96c6 100644
--- a/src/char/int_rodex.h
+++ b/src/char/int_rodex.h
@@ -36,7 +36,7 @@ struct inter_rodex_interface {
bool (*hasnew) (int char_id, int account_id);
bool (*checkname) (const char *name, int *target_char_id, int *target_class, int *target_level);
int64 (*savemessage) (struct rodex_message* msg);
- bool (*updatemail) (int64 mail_id, int8 flag);
+ bool (*updatemail) (int fd, int account_id, int char_id, int64 mail_id, uint8 opentype, int8 flag);
};
#ifdef HERCULES_CORE
diff --git a/src/char/inter.c b/src/char/inter.c
index 1f1750e32..64c840c16 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -79,7 +79,7 @@ static int inter_recv_packet_length[] = {
6,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3060- Quest system [Kevin] [Inkfish]
-1,10, 6,-1, 0, 0, 0, 0, 0, 0, 0, 0, -1,10, 6,-1, // 3070- Mercenary packets [Zephyrus], Elemental packets [pakpil]
56,14,-1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3080-
- -1,10,-1, 6, 0, 20,10,11, -1,6 + NAME_LENGTH, 0, 0, 0, 0, 0, 0, // 3090- Homunculus packets [albator], RoDEX packets
+ -1,10,-1, 6, 0, 20,10,20, -1,6 + NAME_LENGTH, 0, 0, 0, 0, 0, 0, // 3090- Homunculus packets [albator], RoDEX packets
};
static struct DBMap *wis_db = NULL; // int wis_id -> struct WisData*
diff --git a/src/char/mapif.c b/src/char/mapif.c
index fb904a46d..7e8f253bc 100644
--- a/src/char/mapif.c
+++ b/src/char/mapif.c
@@ -1744,10 +1744,13 @@ static void mapif_rodex_sendhasnew(int fd, int char_id, bool has_new)
*------------------------------------------*/
static void mapif_parse_rodex_updatemail(int fd)
{
- int64 mail_id = RFIFOL(fd, 2);
- int8 flag = RFIFOB(fd, 10);
+ int account_id = RFIFOL(fd, 2);
+ int char_id = RFIFOL(fd, 6);
+ int64 mail_id = RFIFOQ(fd, 10);
+ uint8 opentype = RFIFOB(fd, 18);
+ int8 flag = RFIFOB(fd, 19);
- inter_rodex->updatemail(mail_id, flag);
+ inter_rodex->updatemail(fd, account_id, char_id, mail_id, opentype, flag);
}
/*==========================================
diff --git a/src/map/intif.c b/src/map/intif.c
index 86bf07bce..e565c71e6 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -2754,16 +2754,21 @@ static void intif_parse_RodexNotifications(int fd)
/// 2 - user got Items
/// 3 - delete
/// 4 - sender Read (returned mail)
-static int intif_rodex_updatemail(int64 mail_id, int8 flag)
+static int intif_rodex_updatemail(struct map_session_data *sd, int64 mail_id, uint8 opentype, int8 flag)
{
+ nullpo_ret(sd);
+
if (intif->CheckForCharServer())
return 0;
- WFIFOHEAD(inter_fd, 11);
+ WFIFOHEAD(inter_fd, 20);
WFIFOW(inter_fd, 0) = 0x3097;
- WFIFOQ(inter_fd, 2) = mail_id;
- WFIFOB(inter_fd, 10) = flag;
- WFIFOSET(inter_fd, 11);
+ WFIFOL(inter_fd, 2) = sd->status.account_id;
+ WFIFOL(inter_fd, 6) = sd->status.char_id;
+ WFIFOQ(inter_fd, 10) = mail_id;
+ WFIFOB(inter_fd, 18) = opentype;
+ WFIFOB(inter_fd, 19) = flag;
+ WFIFOSET(inter_fd, 20);
return 0;
}
diff --git a/src/map/intif.h b/src/map/intif.h
index 425ab1d18..ee00baa41 100644
--- a/src/map/intif.h
+++ b/src/map/intif.h
@@ -135,7 +135,7 @@ struct intif_interface {
// RoDEX
int(*rodex_requestinbox) (int char_id, int account_id, int8 flag, int8 opentype, int64 mail_id);
int(*rodex_checkhasnew) (struct map_session_data *sd);
- int(*rodex_updatemail) (int64 mail_id, int8 flag);
+ int(*rodex_updatemail) (struct map_session_data *sd, int64 mail_id, uint8 opentype, int8 flag);
int(*rodex_sendmail) (struct rodex_message *msg);
int(*rodex_checkname) (struct map_session_data *sd, const char *name);
/* Clan System */
diff --git a/src/map/rodex.c b/src/map/rodex.c
index 33070c5f8..0d3bbf978 100644
--- a/src/map/rodex.c
+++ b/src/map/rodex.c
@@ -404,12 +404,12 @@ static void rodex_read_mail(struct map_session_data *sd, int64 mail_id)
if (msg->opentype == RODEX_OPENTYPE_RETURN) {
if (msg->sender_read == false) {
- intif->rodex_updatemail(msg->id, 4);
+ intif->rodex_updatemail(sd, msg->id, 0, 4);
msg->sender_read = true;
}
} else {
if (msg->is_read == false) {
- intif->rodex_updatemail(msg->id, 0);
+ intif->rodex_updatemail(sd, msg->id, 0, 0);
msg->is_read = true;
}
}
@@ -430,7 +430,7 @@ static void rodex_delete_mail(struct map_session_data *sd, int64 mail_id)
nullpo_retv(msg);
msg->is_deleted = true;
- intif->rodex_updatemail(msg->id, 3);
+ intif->rodex_updatemail(sd, msg->id, 0, 3);
clif->rodex_delete_mail(sd, msg->opentype, msg->id);
}
@@ -463,7 +463,7 @@ static void rodex_get_zeny(struct map_session_data *sd, int8 opentype, int64 mai
msg->type &= ~MAIL_TYPE_ZENY;
msg->zeny = 0;
- intif->rodex_updatemail(mail_id, 1);
+ intif->rodex_updatemail(sd, mail_id, opentype, 1);
clif->rodex_request_zeny(sd, opentype, mail_id, RODEX_GET_ZENY_SUCCESS);
}
@@ -538,7 +538,7 @@ static void rodex_get_items(struct map_session_data *sd, int8 opentype, int64 ma
if (pc->additem(sd, it, it->amount, LOG_TYPE_MAIL) != 0) {
clif->rodex_request_items(sd, opentype, mail_id, RODEX_GET_ITEM_FULL_ERROR);
- intif->rodex_updatemail(mail_id, 2);
+ intif->rodex_updatemail(sd, mail_id, opentype, 2);
return;
} else {
memset(it, 0x0, sizeof(*it));
@@ -547,7 +547,7 @@ static void rodex_get_items(struct map_session_data *sd, int8 opentype, int64 ma
msg->type &= ~MAIL_TYPE_ITEM;
msg->items_count = 0;
- intif->rodex_updatemail(mail_id, 2);
+ intif->rodex_updatemail(sd, mail_id, opentype, 2);
clif->rodex_request_items(sd, opentype, mail_id, RODEX_GET_ITEMS_SUCCESS);
}