summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-04-04 22:33:05 +0300
committerAndrei Karas <akaras@inbox.ru>2017-04-04 22:34:00 +0300
commitec28958d868afdb3b3e421200c630d15b3526096 (patch)
treed40202cfd941c1aa89277a1124785a1e18e15587
parent8fe364817c3e670f1d36d9fa09a8be5a2668a150 (diff)
downloadevol-hercules-ec28958d868afdb3b3e421200c630d15b3526096.tar.gz
evol-hercules-ec28958d868afdb3b3e421200c630d15b3526096.tar.bz2
evol-hercules-ec28958d868afdb3b3e421200c630d15b3526096.tar.xz
evol-hercules-ec28958d868afdb3b3e421200c630d15b3526096.zip
Send current player language in send_pc_info.
Send send_pc_info if language was changed. Also change plugin version to 17.
-rw-r--r--src/elogin/send.c2
-rw-r--r--src/emap/pc.c1
-rw-r--r--src/emap/send.c21
3 files changed, 15 insertions, 9 deletions
diff --git a/src/elogin/send.c b/src/elogin/send.c
index d1cb423..6eb081e 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) = 16; // plugin version
+ WFIFOL(fd, 8) = 17; // plugin version
WFIFOL(fd, 12) = serverPacketVersion; // server packet version
WFIFOSET(fd, WFIFOW(fd,2));
diff --git a/src/emap/pc.c b/src/emap/pc.c
index 92e6fca..c6fdb02 100644
--- a/src/emap/pc.c
+++ b/src/emap/pc.c
@@ -63,6 +63,7 @@ int epc_setregistry_pre(TBL_PC **sdPtr,
if (!data)
return 0;
data->language = *val;
+ send_pc_info(&sd->bl, &sd->bl, AREA);
}
else if (*reg == mountScriptId)
{
diff --git a/src/emap/send.c b/src/emap/send.c
index a570ec0..616713f 100644
--- a/src/emap/send.c
+++ b/src/emap/send.c
@@ -185,28 +185,33 @@ void send_pc_info(struct block_list* bl1,
if (!bl1 || bl1->type != BL_PC)
return;
- char buf[14];
struct map_session_data *sd = (struct map_session_data *)bl1;
struct SessionExt *data = session_get_bysd(sd);
if (!data)
return;
struct map_session_data *tsd = (struct map_session_data *)bl2;
- if (tsd)
- {
- struct SessionExt *tdata = session_get_bysd(tsd);
- if (!tdata || (bl1 != bl2 && tdata->clientVersion < 4))
- return;
- }
+ if (!tsd)
+ return;
+ struct SessionExt *tdata = session_get_bysd(tsd);
+ if (!tdata || (bl1 != bl2 && tdata->clientVersion < 4))
+ return;
+ int len = 14;
+ if (tdata->clientVersion >= 21)
+ len = 16;
+ char buf[len];
WBUFW (buf, 0) = 0xb0a;
- WBUFW (buf, 2) = 14; // len
+ WBUFW (buf, 2) = 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;
WBUFW (buf, 12) = data->mount;
+ if (tdata->clientVersion >= 21)
+ WBUFW (buf, 14) = data->language;
+
clif->send(&buf, sizeof(buf), bl2, target);
}