summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-07-12 18:12:53 +0300
committerAndrei Karas <akaras@inbox.ru>2017-07-12 18:14:03 +0300
commit763069245561fb981e97120f60ca417fd481ebf9 (patch)
tree7d27c8493a7d5cd2feb0c0754fcf1cf6f628bba9
parentb76f34136a4e59e2e3f4545c32f8bf5a848883e5 (diff)
downloadevol-hercules-763069245561fb981e97120f60ca417fd481ebf9.tar.gz
evol-hercules-763069245561fb981e97120f60ca417fd481ebf9.tar.bz2
evol-hercules-763069245561fb981e97120f60ca417fd481ebf9.tar.xz
evol-hercules-763069245561fb981e97120f60ca417fd481ebf9.zip
Add player self flags packet (0xb25)
Now it include group id Also change plugin version to 18.
-rw-r--r--src/elogin/send.c2
-rw-r--r--src/emap/clif.c1
-rw-r--r--src/emap/pc.c2
-rw-r--r--src/emap/script_buildins.c1
-rw-r--r--src/emap/send.c20
-rw-r--r--src/emap/send.h1
6 files changed, 26 insertions, 1 deletions
diff --git a/src/elogin/send.c b/src/elogin/send.c
index 6eb081e..a763cf8 100644
--- a/src/elogin/send.c
+++ b/src/elogin/send.c
@@ -24,7 +24,7 @@ void send_server_version(int fd)
WFIFOW(fd, 0) = 0x7531;
WFIFOW(fd, 2) = 16;
WFIFOL(fd, 4) = 0; // unused
- WFIFOL(fd, 8) = 17; // plugin version
+ WFIFOL(fd, 8) = 18; // plugin version
WFIFOL(fd, 12) = serverPacketVersion; // server packet version
WFIFOSET(fd, WFIFOW(fd,2));
diff --git a/src/emap/clif.c b/src/emap/clif.c
index f782100..0745cbb 100644
--- a/src/emap/clif.c
+++ b/src/emap/clif.c
@@ -435,6 +435,7 @@ void eclif_authok_post(TBL_PC *sd)
eclif_send_additional_slots(sd, sd);
send_pc_info(&sd->bl, &sd->bl, SELF);
+ send_pc_own_flags(&sd->bl);
struct MapdExt *data = mapd_get(sd->bl.m);
int mask = data ? data->mask : 1;
send_mapmask(sd->fd, mask);
diff --git a/src/emap/pc.c b/src/emap/pc.c
index c6fdb02..bed6848 100644
--- a/src/emap/pc.c
+++ b/src/emap/pc.c
@@ -64,6 +64,7 @@ int epc_setregistry_pre(TBL_PC **sdPtr,
return 0;
data->language = *val;
send_pc_info(&sd->bl, &sd->bl, AREA);
+ send_pc_own_flags(&sd->bl);
}
else if (*reg == mountScriptId)
{
@@ -74,6 +75,7 @@ int epc_setregistry_pre(TBL_PC **sdPtr,
{
data->mount = *val;
send_pc_info(&sd->bl, &sd->bl, SELF);
+ send_pc_own_flags(&sd->bl);
}
}
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index a636e21..d58220b 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -1566,6 +1566,7 @@ BUILDIN(setMount)
pc_setglobalreg(sd, mountScriptId, mount);
status_calc_pc(sd, SCO_NONE);
send_pc_info(&sd->bl, &sd->bl, AREA);
+ send_pc_own_flags(&sd->bl);
return true;
}
diff --git a/src/emap/send.c b/src/emap/send.c
index 1428df7..a42df55 100644
--- a/src/emap/send.c
+++ b/src/emap/send.c
@@ -168,6 +168,26 @@ void send_mob_info(struct block_list* bl1, struct block_list* bl2,
clif->send(&buf, sizeof(buf), bl2, target);
}
+void send_pc_own_flags(struct block_list* bl)
+{
+ if (!bl || bl->type != BL_PC)
+ return;
+
+ struct map_session_data *sd = (struct map_session_data *)bl;
+ struct SessionExt *data = session_get_bysd(sd);
+ if (!data)
+ return;
+ if (data->clientVersion < 22)
+ return;
+
+ const int fd = sd->fd;
+ WFIFOHEAD(fd, 8);
+ WFIFOW(fd, 0) = 0xb25;
+ WFIFOW(fd, 2) = 8;
+ WFIFOL(fd, 4) = sd->group_id;
+ WFIFOSET(fd, 8);
+}
+
void send_pc_info(struct block_list* bl1,
struct block_list* bl2,
enum send_target target)
diff --git a/src/emap/send.h b/src/emap/send.h
index 583f12b..b89f1fc 100644
--- a/src/emap/send.h
+++ b/src/emap/send.h
@@ -25,6 +25,7 @@ void send_advmoving(struct unit_data* ud, bool moving, struct block_list *tbl, e
void send_changemusic_brodcast(const int map, const char *music);
void send_changenpc_title (struct map_session_data *sd, const int npcId, const char *name);
void send_join_ack(int fd, const char *const name, int flag);
+void send_pc_own_flags(struct block_list* bl);
void send_pc_info(struct block_list* bl1,
struct block_list* bl2,
enum send_target target);