summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-06 20:57:29 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-07 00:35:13 +0300
commitd808fef992c2f37bd89fd8336f20cf587016e5a9 (patch)
tree2d390c3f544316b3713a9ba372aa3b0afa0667ce /src/map/script.c
parentfeba0e8cd021ab0a0b469e79125dfc794442db17 (diff)
downloadevol-hercules-d808fef992c2f37bd89fd8336f20cf587016e5a9.tar.gz
evol-hercules-d808fef992c2f37bd89fd8336f20cf587016e5a9.tar.bz2
evol-hercules-d808fef992c2f37bd89fd8336f20cf587016e5a9.tar.xz
evol-hercules-d808fef992c2f37bd89fd8336f20cf587016e5a9.zip
Add packet for accept client version in map server.
Add struct for additional connection data. Add functions for get additional connection data. Impliment script function: getclientversion.
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 9e72453..074e873 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -14,9 +14,29 @@
#include "../../../map/pc.h"
#include "../../../map/script.h"
+#include "map/session.h"
+#include "map/sessionext.h"
+
BUILDIN(l)
{
// for now not translate and not use format parameters
script_pushstr(st, aStrdup(script_getstr(st, 2)));
return true;
}
+
+BUILDIN(getClientVersion)
+{
+ if (!st->rid)
+ {
+ script_pushint(st, 0);
+ return true;
+ }
+ TBL_PC *sd = script->rid2sd(st);
+ if (!sd)
+ {
+ script_pushint(st, 0);
+ return true;
+ }
+ struct SessionExt *data = session_get(sd->fd);
+ script_pushint(st, data->clientVersion);
+}