From d808fef992c2f37bd89fd8336f20cf587016e5a9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 6 Nov 2014 20:57:29 +0300 Subject: 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. --- src/map/script.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/map/script.c') 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); +} -- cgit v1.2.3-60-g2f50