aboutsummaryrefslogtreecommitdiffstats
path: root/src/launch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/launch.c')
-rw-r--r--src/launch.c31
1 files changed, 31 insertions, 0 deletions
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
+}