From b837ef02aff4c0974161ff2e077551a9710fdac5 Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Thu, 11 Jan 2024 00:39:56 -0600 Subject: add auth --- src/macros.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/macros.h') diff --git a/src/macros.h b/src/macros.h index 684323e..8749abb 100644 --- a/src/macros.h +++ b/src/macros.h @@ -46,13 +46,36 @@ #define L2_URL_META_RUNTIME_MANIFEST L2_URL_META_BASE "/v1/products/java-runtime/2ec0cc96c44e5a76b9c8b7c39df7210883d12871/all.json" #define L2_URL_RESOURCES_BASE "https://resources.download.minecraft.net" +#define L2_MSA_CLIENT_ID "60b6cc54-fc07-4bab-bca9-cbe9aa713c80" +#define L2_MSA_SCOPES "Xboxlive.signin offline_access" + +#define L2_MSA_URL_XBOX_AUTH "https://login.microsoftonline.com/consumers/oauth2/v2.0/token" +#define L2_MSA_URL_XBOX_LOGIN "https://user.auth.xboxlive.com/user/authenticate" +#define L2_MSA_URL_XBOX_XSTS "https://xsts.auth.xboxlive.com/xsts/authorize" +#define L2_MSA_URL_MINECRAFT_LOGIN "https://api.minecraftservices.com/authentication/login_with_xbox" + +#define L2_MC_API_PROFILE "https://api.minecraftservices.com/minecraft/profile" +#define L2_MC_API_OPROFILE_FORMAT "https://sessionserver.mojang.com/session/minecraft/profile/%s?unsigned=false" + #ifdef __GNUC__ #define L2_GNU_ATTRIBUTE(_x) __attribute__(_x) #define L2_FORMAT(_flavor, _stridx, _argidx) L2_GNU_ATTRIBUTE((format (_flavor, _stridx, _argidx))) #define L2_SENTINEL L2_GNU_ATTRIBUTE((sentinel)) + +#define L2_PRAGMA(_x) _Pragma(#_x) +#define L2_DIAG_PUSH L2_PRAGMA(GCC diagnostic push) +#define L2_DIAG_POP L2_PRAGMA(GCC diagnostic pop) +#define L2_DIAG_IGNORED(_w) L2_PRAGMA(GCC diagnostic ignored #_w) + #else #define L2_FORMAT(_unused1, _unused2, _unused3) +#define L2_SENTINEL + +#define L2_PRAGMA(_x) +#define L2_DIAG_PUSH +#define L2_DIAG_POP +#define L2_DIAG_IGNORED(_w) #endif #ifdef __cplusplus -- cgit v1.2.3-70-g09d2