From 11672146b9bf67cae05e8e3207c9bd1e47d52220 Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Fri, 5 Jan 2024 04:53:20 -0600 Subject: extracts natives --- src/launch.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/launch.c (limited to 'src/launch.c') diff --git a/src/launch.c b/src/launch.c new file mode 100644 index 0000000..cc0721f --- /dev/null +++ b/src/launch.c @@ -0,0 +1,31 @@ +#include "l2su.h" + +/* TODO launch struct */ + +int l2_launch_fill_substitutor(l2_subst_t *st, void *reserved, json_t *version, struct l2_instance *inst) +{ +#define L2_LAUNCH_ADD_SUB(_st, _name, _val) \ + if (l2_subst_add(_st, _name, _val) < 0) return -1 + + const char *ver_name; + if (json_unpack(version, "{s:s}", "id", &ver_name) < 0) { + return -1; + } + + /* auth_access_token */ + /* user_properties */ + /* user_property_map */ + L2_LAUNCH_ADD_SUB(st, "auth_session", "-"); + + L2_LAUNCH_ADD_SUB(st, "auth_player_name", "figboot"); + L2_LAUNCH_ADD_SUB(st, "auth_uuid", "00000000000000000000000000000000"); + L2_LAUNCH_ADD_SUB(st, "user_type", "legacy"); + + L2_LAUNCH_ADD_SUB(st, "profile_name", inst->name); + L2_LAUNCH_ADD_SUB(st, "version_name", ver_name); + L2_LAUNCH_ADD_SUB(st, "game_directory", "."); + + + return 0; +#undef L2_LAUNCH_ADD_SUB +} -- cgit v1.2.3-70-g09d2