diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-02-24 23:48:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-03-11 04:32:23 +0300 |
commit | 4f9223991eb2029c1069d57eab219c303db42217 (patch) | |
tree | 32107776e0d54d62738c93a34a0ca010a7adc352 | |
parent | 7b72dee98c9cac94fe94c24d5ca791fac9f9f4ad (diff) | |
download | hercules-4f9223991eb2029c1069d57eab219c303db42217.tar.gz hercules-4f9223991eb2029c1069d57eab219c303db42217.tar.bz2 hercules-4f9223991eb2029c1069d57eab219c303db42217.tar.xz hercules-4f9223991eb2029c1069d57eab219c303db42217.zip |
Fix packet character name request reply for 20180221 clients.
-rw-r--r-- | src/char/char.c | 5 | ||||
-rw-r--r-- | src/map/clif.c | 25 |
2 files changed, 25 insertions, 5 deletions
diff --git a/src/char/char.c b/src/char/char.c index aef35f216..0069e7f1d 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -3328,7 +3328,12 @@ void char_char_name_ack(int fd, int char_id) WFIFOHEAD(fd,30); WFIFOW(fd,0) = 0x2b09; WFIFOL(fd,2) = char_id; +#if !defined(PACKETVER_ZERO) && (PACKETVER >= 20180307 || (defined(PACKETVER_RE) && PACKETVER >= 20180221)) + if (chr->loadName(char_id, WFIFOP(fd,6)) == 0) + WFIFOL(fd, 6) = 0; +#else chr->loadName(char_id, WFIFOP(fd,6)); +#endif WFIFOSET(fd,30); } diff --git a/src/map/clif.c b/src/map/clif.c index e3e659234..d2dc12377 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -6088,14 +6088,29 @@ void clif_wis_end(int fd, int flag) { /// Returns character name requested by char_id (ZC_ACK_REQNAME_BYGID). /// 0194 <char id>.L <name>.24B +/// 0af7 <flag>.W <char id>.L <name>.24B void clif_solved_charname(int fd, int charid, const char* name) { nullpo_retv(name); - WFIFOHEAD(fd,packet_len(0x194)); - WFIFOW(fd,0)=0x194; - WFIFOL(fd,2)=charid; - safestrncpy(WFIFOP(fd,6), name, NAME_LENGTH); - WFIFOSET(fd,packet_len(0x194)); +#if !defined(PACKETVER_ZERO) && (PACKETVER >= 20180307 || (defined(PACKETVER_RE) && PACKETVER >= 20180221)) + WFIFOHEAD(fd, packet_len(0x0af7)); + WFIFOW(fd, 0) = 0xaf7; + if (*name == 0) { + WFIFOW(fd, 2) = 2; + memset(WFIFOP(fd, 8), 0, NAME_LENGTH); + } else { + WFIFOW(fd, 2) = 3; + safestrncpy(WFIFOP(fd, 8), name, NAME_LENGTH); + } + WFIFOL(fd, 4) = charid; + WFIFOSET(fd, packet_len(0x0af7)); +#else + WFIFOHEAD(fd, packet_len(0x194)); + WFIFOW(fd, 0) = 0x194; + WFIFOL(fd, 2) = charid; + safestrncpy(WFIFOP(fd, 6), name, NAME_LENGTH); + WFIFOSET(fd, packet_len(0x194)); +#endif } /// Presents a list of items that can be carded/composed (ZC_ITEMCOMPOSITION_LIST). |