summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-19 15:37:17 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-19 16:49:42 +0300
commit6eb6d10d8e1f4fa01d6a5bdc222149cd8552eb6a (patch)
treef7423968f9b11349f0aecbac1dca63f851ef9099 /src
parent605743927ad2d23df4c889b9dabd23f03b9c158b (diff)
downloadevol-hercules-6eb6d10d8e1f4fa01d6a5bdc222149cd8552eb6a.tar.gz
evol-hercules-6eb6d10d8e1f4fa01d6a5bdc222149cd8552eb6a.tar.bz2
evol-hercules-6eb6d10d8e1f4fa01d6a5bdc222149cd8552eb6a.tar.xz
evol-hercules-6eb6d10d8e1f4fa01d6a5bdc222149cd8552eb6a.zip
add mount into pc into packet.
Diffstat (limited to 'src')
-rw-r--r--src/elogin/send.c2
-rw-r--r--src/emap/data/session.c1
-rw-r--r--src/emap/init.c2
-rw-r--r--src/emap/pc.c9
-rw-r--r--src/emap/send.c6
-rw-r--r--src/emap/struct/sessionext.h1
6 files changed, 16 insertions, 5 deletions
diff --git a/src/elogin/send.c b/src/elogin/send.c
index daad1ea..c3b49b5 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) = 8; // plugin version
+ WFIFOL(fd, 8) = 9; // plugin version
WFIFOL(fd, 12) = serverPacketVersion; // server packet version
WFIFOSET(fd, WFIFOW(fd,2));
diff --git a/src/emap/data/session.c b/src/emap/data/session.c
index 4b4792c..dea86e6 100644
--- a/src/emap/data/session.c
+++ b/src/emap/data/session.c
@@ -47,5 +47,6 @@ struct SessionExt *session_create(void)
data->state = 0;
data->onlinelistlasttime = 0;
data->teamId = 0;
+ data->mount = 0;
return data;
}
diff --git a/src/emap/init.c b/src/emap/init.c
index dd81344..cfa8940 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -62,6 +62,7 @@
#include "common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) */
extern int langScriptId;
+extern int mountScriptId;
HPExport struct hplugin_info pinfo =
{
@@ -228,6 +229,7 @@ HPExport void plugin_init (void)
addHookPost("pc->insert_card", epc_insert_card_post);
langScriptId = script->add_str("Lang");
+ mountScriptId = script->add_str("Mount");
}
HPExport void server_preinit (void)
diff --git a/src/emap/pc.c b/src/emap/pc.c
index 73b9e58..a099c3c 100644
--- a/src/emap/pc.c
+++ b/src/emap/pc.c
@@ -28,6 +28,7 @@
#include "emap/struct/sessionext.h"
int langScriptId;
+int mountScriptId;
int epc_readparam_pre(TBL_PC* sd, int *type)
{
@@ -49,9 +50,15 @@ int epc_setregistry(TBL_PC *sd, int64 *reg, int *val)
struct SessionExt *data = session_get_bysd(sd);
if (!data)
return 0;
-
data->language = *val;
}
+ else if (*reg == mountScriptId)
+ {
+ struct SessionExt *data = session_get_bysd(sd);
+ if (!data)
+ return 0;
+ data->mount = *val;
+ }
return 0;
}
diff --git a/src/emap/send.c b/src/emap/send.c
index d899fdb..8af9dc6 100644
--- a/src/emap/send.c
+++ b/src/emap/send.c
@@ -177,7 +177,7 @@ void send_pc_info(struct block_list* bl1,
if (!bl1 || bl1->type != BL_PC)
return;
- char buf[12];
+ char buf[14];
TBL_PC *sd = (TBL_PC *)bl1;
struct SessionExt *data = session_get_bysd(sd);
if (!data)
@@ -192,13 +192,13 @@ void send_pc_info(struct block_list* bl1,
}
WBUFW (buf, 0) = 0xb0a;
- WBUFW (buf, 2) = 12; // len
+ WBUFW (buf, 2) = 14; // 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;
clif->send(&buf, sizeof(buf), bl2, target);
}
diff --git a/src/emap/struct/sessionext.h b/src/emap/struct/sessionext.h
index 2f1e9d7..89cf163 100644
--- a/src/emap/struct/sessionext.h
+++ b/src/emap/struct/sessionext.h
@@ -10,6 +10,7 @@ struct SessionExt
int clientVersion;
int language;
int teamId;
+ uint16 mount;
uint8 state;
};