summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-06-18 21:00:37 +0200
committerGitHub <noreply@github.com>2018-06-18 21:00:37 +0200
commit242bb0f939ff2e68fff8914853cbb87baa8296b6 (patch)
treede2b65845517132611aad62926ecc26ac6e8f846 /src/map/clif.c
parent2d840771eeee1d9e158e843bcc14f9d69d1cf22e (diff)
parentdfc078354025408dd5140e95702b0661b52d1e16 (diff)
downloadhercules-242bb0f939ff2e68fff8914853cbb87baa8296b6.tar.gz
hercules-242bb0f939ff2e68fff8914853cbb87baa8296b6.tar.bz2
hercules-242bb0f939ff2e68fff8914853cbb87baa8296b6.tar.xz
hercules-242bb0f939ff2e68fff8914853cbb87baa8296b6.zip
Merge pull request #2064 from 4144/updatepackets
update packets and message table for clients 20180530 to 20180612
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 73dbb5f7d..aeaf03e43 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -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
}