summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-08-24 02:02:05 +0300
committerAndrei Karas <akaras@inbox.ru>2018-08-24 02:02:05 +0300
commit69165395c7c6d4d23cd8b3044a4a5bf82a4216d1 (patch)
treeccd9419a55e38e4d9fc0ea8ad3da61c011a09793 /src
parent538c34ac4534390112837f631b1f9898f79c0796 (diff)
downloadhercules-69165395c7c6d4d23cd8b3044a4a5bf82a4216d1.tar.gz
hercules-69165395c7c6d4d23cd8b3044a4a5bf82a4216d1.tar.bz2
hercules-69165395c7c6d4d23cd8b3044a4a5bf82a4216d1.tar.xz
hercules-69165395c7c6d4d23cd8b3044a4a5bf82a4216d1.zip
Update packet ZC_ACK_BAN_GUILD.
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c25
-rw-r--r--src/map/clif.h2
-rw-r--r--src/map/guild.c2
-rw-r--r--src/map/packets_struct.h34
4 files changed, 48 insertions, 15 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 1797a8fae..41076b160 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8126,26 +8126,25 @@ static void clif_guild_leave(struct map_session_data *sd, const char *name, cons
/// Notifies clients of a guild of an expelled member.
/// 015c <char name>.24B <reason>.40B <account name>.24B (ZC_ACK_BAN_GUILD)
/// 0839 <char name>.24B <reason>.40B (ZC_ACK_BAN_GUILD_SSO)
-static void clif_guild_expulsion(struct map_session_data *sd, const char *name, const char *mes, int account_id)
+static void clif_guild_expulsion(struct map_session_data *sd, const char *name, int char_id, const char *mes, int account_id)
{
- unsigned char buf[128];
-#if PACKETVER < 20100803
- const unsigned short cmd = 0x15c;
-#else
- const unsigned short cmd = 0x839;
-#endif
-
nullpo_retv(sd);
nullpo_retv(name);
nullpo_retv(mes);
- WBUFW(buf,0) = cmd;
- safestrncpy(WBUFP(buf,2), name, NAME_LENGTH);
- safestrncpy(WBUFP(buf,26), mes, 40);
+ struct PACKET_ZC_ACK_BAN_GUILD p;
+ p.packetType = guildExpulsion;
+#if PACKETVER_MAIN_NUM >= 20161019 || PACKETVER_RE_NUM >= 20160921 || defined(PACKETVER_ZERO)
+ p.GID = char_id;
+#else
+ safestrncpy(&p.name[0], name, NAME_LENGTH);
+#endif
+ safestrncpy(&p.reason[0], mes, 40);
+
#if PACKETVER < 20100803
- memset(WBUFP(buf,66), 0, NAME_LENGTH); // account name (not used for security reasons)
+ memset(&p.account_name, 0, NAME_LENGTH); // account name (not used for security reasons)
#endif
- clif->send(buf, packet_len(cmd), &sd->bl, GUILD_NOBG);
+ clif->send(&p, sizeof(p), &sd->bl, GUILD_NOBG);
}
/// Guild expulsion list (ZC_BAN_LIST).
diff --git a/src/map/clif.h b/src/map/clif.h
index a94a08080..7307e7461 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -1025,7 +1025,7 @@ struct clif_interface {
void (*guild_invite) (struct map_session_data *sd,struct guild *g);
void (*guild_inviteack) (struct map_session_data *sd,int flag);
void (*guild_leave) (struct map_session_data *sd,const char *name,const char *mes);
- void (*guild_expulsion) (struct map_session_data* sd, const char* name, const char* mes, int account_id);
+ void (*guild_expulsion) (struct map_session_data* sd, const char* name, int char_id, const char* mes, int account_id);
void (*guild_positionchanged) (struct guild *g,int idx);
void (*guild_memberpositionchanged) (struct guild *g,int idx);
void (*guild_emblem) (struct map_session_data *sd,struct guild *g);
diff --git a/src/map/guild.c b/src/map/guild.c
index f82928c4d..01372921b 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -927,7 +927,7 @@ static int guild_member_withdraw(int guild_id, int account_id, int char_id, int
if(!flag)
clif->guild_leave(online_member_sd, name, mes);
else
- clif->guild_expulsion(online_member_sd, name, mes, account_id);
+ clif->guild_expulsion(online_member_sd, name, char_id, mes, account_id);
// remove member from guild
memset(&g->member[i],0,sizeof(struct guild_member));
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 1f22d5081..5aeb40be5 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -421,6 +421,13 @@ enum packet_headers {
#else
skilWarpPointType = 0x11c,
#endif
+#if PACKETVER_MAIN_NUM >= 20161019 || PACKETVER_RE_NUM >= 20160921 || defined(PACKETVER_ZERO)
+ guildExpulsion = 0xa82,
+#elif PACKETVER >= 20100803
+ guildExpulsion = 0x839,
+#else
+ guildExpulsion = 0x15c,
+#endif
};
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
@@ -2727,6 +2734,33 @@ struct PACKET_ZC_INVENTORY_MOVE_FAILED {
int16 unknown;
} __attribute__((packed));
+#if PACKETVER_MAIN_NUM >= 20161019 || PACKETVER_RE_NUM >= 20160921 || defined(PACKETVER_ZERO)
+#define PACKET_ZC_ACK_BAN_GUILD PACKET_ZC_ACK_BAN_GUILD3
+#elif PACKETVER >= 20100803
+#define PACKET_ZC_ACK_BAN_GUILD PACKET_ZC_ACK_BAN_GUILD2
+#else
+#define PACKET_ZC_ACK_BAN_GUILD PACKET_ZC_ACK_BAN_GUILD1
+#endif
+
+struct PACKET_ZC_ACK_BAN_GUILD1 {
+ int16 packetType;
+ char name[NAME_LENGTH];
+ char reason[40];
+ char account_name[NAME_LENGTH];
+} __attribute__((packed));
+
+struct PACKET_ZC_ACK_BAN_GUILD2 {
+ int16 packetType;
+ char name[NAME_LENGTH];
+ char reason[40];
+} __attribute__((packed));
+
+struct PACKET_ZC_ACK_BAN_GUILD3 {
+ int16 packetType;
+ char reason[40];
+ uint32 GID;
+} __attribute__((packed));
+
#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