From 8ea2eac0fc4956e5699e5ffc4a3118b96f7a6944 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 2 Jul 2023 02:46:58 +0200 Subject: [PATCH] Move launcher/loader consts Move to shared PCH as these are low level defines. --- r5dev/core/shared_pch.h | 7 +++++++ r5dev/loader/loader.cpp | 8 ++++---- r5dev/sdklauncher/sdklauncher_const.h | 9 --------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/r5dev/core/shared_pch.h b/r5dev/core/shared_pch.h index a56febba..9f288915 100644 --- a/r5dev/core/shared_pch.h +++ b/r5dev/core/shared_pch.h @@ -68,4 +68,11 @@ #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 #endif +#define MAIN_WORKER_DLL "GameSDK.dll" +#define SERVER_WORKER_DLL "Dedicated.dll" +#define CLIENT_WORKER_DLL "bin\\x64_retail\\client.dll" + +#define MAIN_GAME_DLL "r5apex.exe" +#define SERVER_GAME_DLL "r5apex_ds.exe" + #endif // SHARED_PCH_H diff --git a/r5dev/loader/loader.cpp b/r5dev/loader/loader.cpp index 3da31f07..0f6a0ead 100644 --- a/r5dev/loader/loader.cpp +++ b/r5dev/loader/loader.cpp @@ -82,10 +82,10 @@ void InitGameSDK(const LPSTR lpCmdLine) // The dedicated server has its own SDK module, // so we need to check whether we are running // the base game or the dedicated server. - if (V_stricmp(pModuleName, "r5apex.exe") == NULL) - s_SdkModule = LoadLibraryA("GameSDK.dll"); - else if (V_stricmp(pModuleName, "r5apex_ds.exe") == NULL) - s_SdkModule = LoadLibraryA("Dedicated.dll"); + if (V_stricmp(pModuleName, MAIN_GAME_DLL) == NULL) + s_SdkModule = LoadLibraryA(MAIN_WORKER_DLL); + else if (V_stricmp(pModuleName, SERVER_GAME_DLL) == NULL) + s_SdkModule = LoadLibraryA(SERVER_WORKER_DLL); if (!s_SdkModule) { diff --git a/r5dev/sdklauncher/sdklauncher_const.h b/r5dev/sdklauncher/sdklauncher_const.h index 5e79df6a..412a3ef0 100644 --- a/r5dev/sdklauncher/sdklauncher_const.h +++ b/r5dev/sdklauncher/sdklauncher_const.h @@ -1,16 +1,7 @@ #pragma once -#define MAIN_WORKER_DLL "gamesdk.dll" -#define SERVER_WORKER_DLL "dedicated.dll" -#define CLIENT_WORKER_DLL "bin\\x64_retail\\client.dll" - -#define MAIN_GAME_DLL "r5apex.exe" -#define SERVER_GAME_DLL "r5apex_ds.exe" - #define GAME_CFG_PATH "platform\\cfg\\" - #define DEFAULT_WINDOW_CLASS_NAME "Respawn001" - #define LAUNCHER_SETTING_FILE "launcher.vdf" //-----------------------------------------------------------------------------