From 1efc9f3571988551407191a0784b363022c7fcc5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 5 Feb 2019 22:30:04 +0300 Subject: Add packet CZ_CLIENT_VERSION For now unused, but can be used. This packet works in some old clients near 2015 versions. --- configure | 2 +- src/map/clif.c | 9 +++++++++ src/map/clif.h | 1 + src/map/packets.h | 4 ++++ src/map/packets_struct.h | 8 ++++++++ 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 41b308828..0560d8d85 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac e207bf99b. +# From configure.ac 5b2340b4d. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # diff --git a/src/map/clif.c b/src/map/clif.c index 44635d699..ae92e7b2c 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -22289,6 +22289,14 @@ static void clif_parse_NPCBarterPurchase(int fd, struct map_session_data *sd) #endif } +static void clif_parse_clientVersion(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); +static void clif_parse_clientVersion(int fd, struct map_session_data *sd) +{ +#if PACKETVER_MAIN_NUM >= 20090406 || PACKETVER_RE_NUM >= 20090408 || PACKETVER_SAK_NUM >= 20090408 || defined(PACKETVER_ZERO) + // TODO: show or store client version +#endif +} + /*========================================== * Main client packet processing function *------------------------------------------*/ @@ -23478,4 +23486,5 @@ void clif_defaults(void) clif->npc_barter_open = clif_npc_barter_open; clif->pNPCBarterClosed = clif_parse_NPCBarterClosed; clif->pNPCBarterPurchase = clif_parse_NPCBarterPurchase; + clif->pClientVersion = clif_parse_clientVersion; } diff --git a/src/map/clif.h b/src/map/clif.h index 1aee11c33..36c360cbc 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1599,6 +1599,7 @@ struct clif_interface { void (*npc_barter_open) (struct map_session_data *sd, struct npc_data *nd); void (*pNPCBarterClosed) (int fd, struct map_session_data *sd); void (*pNPCBarterPurchase) (int fd, struct map_session_data *sd); + void (*pClientVersion) (int fd, struct map_session_data *sd); }; #ifdef HERCULES_CORE diff --git a/src/map/packets.h b/src/map/packets.h index d430a6de8..50784f09a 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -649,6 +649,10 @@ packet(0x96e,clif->ackmergeitems); packet(0x0439,clif->pUseItem,2,4); #endif +#if PACKETVER_MAIN_NUM >= 20090406 || PACKETVER_RE_NUM >= 20090408 || PACKETVER_SAK_NUM >= 20090408 || defined(PACKETVER_ZERO) + packet(0x044a,clif->pClientVersion); +#endif + // 2009-05-20aRagexe, 2009-05-20aRagexeRE #if PACKETVER >= 20090520 // new packets diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 9ebc8a75e..2339935ec 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -3152,6 +3152,14 @@ struct PACKET_ZC_USESKILL_ACK { DEFINE_PACKET_HEADER(ZC_USESKILL_ACK, 0x013e); #endif +#if PACKETVER_MAIN_NUM >= 20090406 || PACKETVER_RE_NUM >= 20090408 || PACKETVER_SAK_NUM >= 20090408 || defined(PACKETVER_ZERO) +struct PACKET_CZ_CLIENT_VERSION { + int16 packetType; + uint32 clientVersion; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_CLIENT_VERSION, 0x044a); +#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