From ebf09a72221e05de9cd60e3df806f54e29329f4c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 10 Jan 2015 20:30:41 +0300 Subject: Add support for sending group id to client. Add permission send_gm_flag. --- src/map/send.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/map/send.c') diff --git a/src/map/send.c b/src/map/send.c index b92065a..aa03de0 100644 --- a/src/map/send.c +++ b/src/map/send.c @@ -15,6 +15,9 @@ #include "../../../map/unit.h" #include "map/send.h" +#include "map/permission.h" +#include "map/data/session.h" +#include "map/struct/sessionext.h" void send_npccommand (struct map_session_data *sd, int npcId, int cmd) { @@ -121,6 +124,34 @@ void send_mob_info(struct block_list* bl1, struct block_list* bl2, clif->send(&buf, sizeof(buf), bl2, target); } +void send_pc_info(struct block_list* bl1, + struct block_list* bl2, + enum send_target target) +{ + char buf[12]; + + if (bl1->type != BL_PC) + return; + + struct map_session_data *sd = (struct map_session_data *)bl1; + + struct SessionExt *data = session_get_bysd(sd); + if (!data) + return; + if (data->clientVersion < 4) + return; + + WBUFW (buf, 0) = 0xb0a; + WBUFW (buf, 2) = 12; // len + WBUFL (buf, 4) = sd->bl.id; + if (pc_has_permission(sd, permission_send_gm_flag)) + WBUFL (buf, 8) = sd->group_id; + else + WBUFL (buf, 8) = 0; + + clif->send(&buf, sizeof(buf), bl2, target); +} + void send_advmoving(struct unit_data* ud, struct block_list *tbl, enum send_target target) { if (!ud) -- cgit v1.2.3-60-g2f50