diff options
-rw-r--r-- | src/emap/clif.c | 96 | ||||
-rw-r--r-- | src/emap/clif.h | 4 | ||||
-rw-r--r-- | src/emap/init.c | 5 |
3 files changed, 105 insertions, 0 deletions
diff --git a/src/emap/clif.c b/src/emap/clif.c index 53d9a29..aa82932 100644 --- a/src/emap/clif.c +++ b/src/emap/clif.c @@ -529,6 +529,102 @@ void eclif_charnameupdate_pre(struct map_session_data **ssdPtr) } } +// clientVersion < 26 +void eclif_homname_ack_pre(int *fdPtr, struct block_list **blPtr) +{ + struct block_list *bl = *blPtr; + int fd = *fdPtr; + struct SessionExt *data = session_get(fd); + if (!data) + return; + if (data->clientVersion >= 26) + { + return; + } + + nullpo_retv(bl); + Assert_retv(bl->type == BL_HOM); + + struct packet_reqname_ack packet = { 0 }; + packet.packet_id = reqName; + packet.gid = bl->id; + memcpy(packet.name, BL_UCCAST(BL_HOM, bl)->homunculus.name, NAME_LENGTH); + clif->send_selforarea(fd, bl, &packet, sizeof(struct packet_reqname_ack)); + hookStop(); +} + +// clientVersion < 26 +void eclif_mername_ack_pre(int *fdPtr, struct block_list **blPtr) +{ + struct block_list *bl = *blPtr; + int fd = *fdPtr; + struct SessionExt *data = session_get(fd); + if (!data) + return; + if (data->clientVersion >= 26) + { + return; + } + + nullpo_retv(bl); + Assert_retv(bl->type == BL_MER); + + struct packet_reqname_ack packet = { 0 }; + packet.packet_id = reqName; + packet.gid = bl->id; + memcpy(packet.name, BL_UCCAST(BL_MER, bl)->db->name, NAME_LENGTH); + clif->send_selforarea(fd, bl, &packet, sizeof(struct packet_reqname_ack)); + hookStop(); +} + +// clientVersion < 26 +void eclif_petname_ack_pre(int *fdPtr, struct block_list **blPtr) +{ + struct block_list *bl = *blPtr; + int fd = *fdPtr; + struct SessionExt *data = session_get(fd); + if (!data) + return; + if (data->clientVersion >= 26) + { + return; + } + + nullpo_retv(bl); + Assert_retv(bl->type == BL_PET); + + struct packet_reqname_ack packet = { 0 }; + packet.packet_id = reqName; + packet.gid = bl->id; + memcpy(packet.name, BL_UCCAST(BL_PET, bl)->pet.name, NAME_LENGTH); + clif->send_selforarea(fd, bl, &packet, sizeof(struct packet_reqname_ack)); + hookStop(); +} + +// clientVersion < 26 +void eclif_elemname_ack_pre(int *fdPtr, struct block_list **blPtr) +{ + struct block_list *bl = *blPtr; + int fd = *fdPtr; + struct SessionExt *data = session_get(fd); + if (!data) + return; + if (data->clientVersion >= 26) + { + return; + } + + nullpo_retv(bl); + Assert_retv(bl->type == BL_ELEM); + + struct packet_reqname_ack packet = { 0 }; + packet.packet_id = reqName; + packet.gid = bl->id; + memcpy(packet.name, BL_UCCAST(BL_ELEM, bl)->db->name, NAME_LENGTH); + clif->send_selforarea(fd, bl, &packet, sizeof(struct packet_reqname_ack)); + hookStop(); +} + #define equipPos(index, field) \ equip = sd->equip_index[index]; \ if (equip >= 0) \ diff --git a/src/emap/clif.h b/src/emap/clif.h index 1c602d8..b4f384d 100644 --- a/src/emap/clif.h +++ b/src/emap/clif.h @@ -13,6 +13,10 @@ void eclif_blname_ack_pre(int *fdPtr, struct block_list **blPtr); void eclif_blname_ack_pre_sub(int *fdPtr, struct block_list **blPtr); +void eclif_homname_ack_pre(int *fdPtr, struct block_list **blPtr); +void eclif_mername_ack_pre(int *fdPtr, struct block_list **blPtr); +void eclif_petname_ack_pre(int *fdPtr, struct block_list **blPtr); +void eclif_elemname_ack_pre(int *fdPtr, struct block_list **blPtr); void eclif_charnameupdate_pre(struct map_session_data **ssdPtr); void eclif_getareachar_unit_post(TBL_PC *sd, struct block_list *bl); diff --git a/src/emap/init.c b/src/emap/init.c index dfc1241..0e83b9a 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -290,6 +290,11 @@ HPExport void plugin_init (void) addHookPre(clif, quest_send_list, eclif_quest_send_list_pre); addHookPre(clif, quest_add, eclif_quest_add_pre); addHookPre(clif, blname_ack, eclif_blname_ack_pre); + addHookPre(clif, homname_ack, eclif_homname_ack_pre); + addHookPre(clif, mername_ack, eclif_mername_ack_pre); + addHookPre(clif, petname_ack, eclif_petname_ack_pre); + addHookPre(clif, elemname_ack, eclif_elemname_ack_pre); + addHookPre(clif, charnameupdate, eclif_charnameupdate_pre); addHookPre(clif, getareachar_item, eclif_getareachar_item_pre); addHookPre(clif, dropflooritem, eclif_dropflooritem_pre); |