aboutsummaryrefslogtreecommitdiffstats
path: root/src/launch.c
blob: cc0721fe20c30b883a1fb024b5dc2eb2f88d8901 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
}