From 3cde52381fe5ea8643e6b78393384df0cae696e1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 25 Apr 2019 03:42:35 +0300 Subject: Add packet ZC_ACK_CLOSE_ROULETTE --- src/map/clif.c | 14 ++++++++++++++ src/map/clif.h | 1 + src/map/packets_struct.h | 8 ++++++++ 3 files changed, 23 insertions(+) (limited to 'src/map') diff --git a/src/map/clif.c b/src/map/clif.c index 336bbb752..fb39d7427 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -20555,6 +20555,19 @@ static void clif_roulette_generate_ack(struct map_session_data *sd, enum GENERAT #endif } +static void clif_roulette_close(struct map_session_data *sd) +{ +#if PACKETVER_MAIN_NUM >= 20141008 || PACKETVER_RE_NUM >= 20140903 || defined(PACKETVER_ZERO) + nullpo_retv(sd); + + struct PACKET_ZC_ACK_CLOSE_ROULETTE p; + p.packetType = HEADER_ZC_ACK_CLOSE_ROULETTE; + p.result = 0; // close window + + clif->send(&p, sizeof(p), &sd->bl, SELF); +#endif +} + /** * Stackable items merger */ @@ -23328,6 +23341,7 @@ void clif_defaults(void) /* */ clif->parse_roulette_db = clif_parse_roulette_db; clif->roulette_generate_ack = clif_roulette_generate_ack; + clif->roulette_close = clif_roulette_close; /* Merge Items */ clif->openmergeitem = clif_openmergeitem; clif->cancelmergeitem = clif_cancelmergeitem; diff --git a/src/map/clif.h b/src/map/clif.h index 1f3f39874..84e675afb 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1262,6 +1262,7 @@ struct clif_interface { /* */ bool (*parse_roulette_db) (void); void (*roulette_generate_ack) (struct map_session_data *sd, enum GENERATE_ROULETTE_ACK result, short stage, short prizeIdx, int bonusItemID); + void (*roulette_close) (struct map_session_data *sd); /* Merge Items */ void (*openmergeitem) (int fd, struct map_session_data *sd); void (*cancelmergeitem) (int fd, struct map_session_data *sd); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 445e9a3e2..a9dba1720 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -3277,6 +3277,14 @@ struct PACKET_ZC_BAN_LIST { DEFINE_PACKET_HEADER(ZC_BAN_LIST, 0x0163); #endif +#if PACKETVER_MAIN_NUM >= 20141008 || PACKETVER_RE_NUM >= 20140903 || defined(PACKETVER_ZERO) +struct PACKET_ZC_ACK_CLOSE_ROULETTE { + int16 packetType; + uint8 result; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ACK_CLOSE_ROULETTE, 0x0a1e); +#endif + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris -- cgit v1.2.3-70-g09d2