diff options
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index a4d2f62b1..aeaf03e43 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -3089,7 +3089,7 @@ void clif_updatestatus(struct map_session_data *sd,int type) WFIFOL(fd,4)=sd->status.zeny; len = packet_len(0xb1); break; -// [4144] unconfirment exact version can be from 20170405 to 20170913 +// [4144] exact version unknown, between 20170405 to 20170913? #if PACKETVER >= 20170830 case SP_BASEEXP: WFIFOW(fd, 0) = 0xacb; @@ -11081,7 +11081,7 @@ void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd) __attribute_ /// 1 = public void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd) { - int len = RFIFOW(fd,2)-15; + int len = (int)RFIFOW(fd, 2) - 15; int limit; bool pub; const char *password; //not zero-terminated @@ -11137,7 +11137,7 @@ void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data* sd) __attr /// 1 = public void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data* sd) { - int len = RFIFOW(fd,2)-15; + int len = (int)RFIFOW(fd, 2) - 15; int limit; bool pub; const char *password; // not zero-terminated @@ -13148,12 +13148,12 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd) __attribute__(( /// 0 = canceled /// 1 = open void clif_parse_OpenVending(int fd, struct map_session_data* sd) { - short len = (short)RFIFOW(fd,2) - 85; + int len = (int)RFIFOW(fd, 2) - 85; const char *message; bool flag; const uint8 *data; - if (len < 1) + if (len < 0) return; message = RFIFOP(fd,4); @@ -20531,36 +20531,43 @@ void clif_parse_open_ui_request(int fd, struct map_session_data *sd) clif->open_ui(sd, p->UIType); } -void clif_open_ui(struct map_session_data *sd, int8 UIType) +void clif_open_ui(struct map_session_data *sd, enum cz_ui_types uiType) { -#if PACKETVER_RE_NUM >= 20180307 || PACKETVER_MAIN_NUM >= 20180404 || PACKETVER_ZERO_NUM >= 20180411 - int claimed = 0; +#if PACKETVER >= 20150128 struct PACKET_ZC_OPEN_UI p; nullpo_retv(sd); - p.PacketType = 0xAE2; - switch (UIType) { - case STYLIST_UI: - p.UIType = STYLIST_UI; + p.PacketType = openUiType; + switch (uiType) { + case CZ_STYLIST_UI: + p.UIType = ZC_STYLIST_UI; +#if PACKETVER >= 20171122 p.data = 0; +#endif break; - case 5: // client will send 5 for the request but requires to receive ATTENDANCE_UI (7) to open the correct ui. + case CZ_ATTENDANCE_UI: + { +#if PACKETVER_RE_NUM >= 20180307 || PACKETVER_MAIN_NUM >= 20180404 || PACKETVER_ZERO_NUM >= 20180411 + int claimed = 0; if (clif->attendance_timediff(sd) != true) ++claimed; else if (sd->status.attendance_count >= VECTOR_LENGTH(clif->attendance_data)) sd->status.attendance_count = 0; - p.UIType = ATTENDANCE_UI; + p.UIType = ZC_ATTENDANCE_UI; p.data = sd->status.attendance_count * 10 + claimed; +#else + ShowWarning("Attendance System available only for PACKETVER_RE_NUM >= 20180307 || PACKETVER_MAIN_NUM >= 20180404 || PACKETVER_ZERO_NUM >= 20180411.\n"); + return; +#endif break; + } default: - ShowWarning("clif_open_ui: Requested UI (%d) is not implemented yet.\n", UIType); + ShowWarning("clif_open_ui: Requested UI (%u) is not implemented yet.\n", uiType); return; } clif->send(&p, sizeof(p), &sd->bl, SELF); -#else - ShowWarning("Attendance System available only for PACKETVER_RE_NUM >= 20180307 || PACKETVER_MAIN_NUM >= 20180404 || PACKETVER_ZERO_NUM >= 20180411.\n"); #endif } @@ -20827,7 +20834,7 @@ void clif_parse_cz_req_style_change(int fd, struct map_session_data *sd) if (p->BottomAccessory > 0) clif->cz_req_style_change_sub(sd, LOOK_HEAD_BOTTOM, p->BottomAccessory, true); - clif->style_change_response(sd, true); + clif->style_change_response(sd, STYLIST_SHOP_SUCCESS); return; } @@ -20850,7 +20857,7 @@ void clif_cz_req_style_change_sub(struct map_session_data *sd, int type, int16 i } } -void clif_style_change_response(struct map_session_data *sd, int8 flag) +void clif_style_change_response(struct map_session_data *sd, enum stylist_shop flag) { #if PACKETVER >= 20151104 struct PACKET_ZC_STYLE_CHANGE_RES p; |