summaryrefslogtreecommitdiff
path: root/src/map/send.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-01-10 20:30:41 +0300
committerAndrei Karas <akaras@inbox.ru>2015-01-10 20:33:26 +0300
commitebf09a72221e05de9cd60e3df806f54e29329f4c (patch)
tree5e146cc81c971d40586cf8d464844679d078c6da /src/map/send.c
parented39e0835a4afc21335bac2ab3cb8c974c371da0 (diff)
downloadevol-hercules-ebf09a72221e05de9cd60e3df806f54e29329f4c.tar.gz
evol-hercules-ebf09a72221e05de9cd60e3df806f54e29329f4c.tar.bz2
evol-hercules-ebf09a72221e05de9cd60e3df806f54e29329f4c.tar.xz
evol-hercules-ebf09a72221e05de9cd60e3df806f54e29329f4c.zip
Add support for sending group id to client.
Add permission send_gm_flag.
Diffstat (limited to 'src/map/send.c')
-rw-r--r--src/map/send.c31
1 files changed, 31 insertions, 0 deletions
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)