mirror of
https://github.com/absoluteSpacehead/MercuryLauncher.git
synced 2026-01-13 03:02:21 +01:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
099478360f | ||
|
|
20492f45b8 | ||
|
|
ab6cccfd84 | ||
|
|
cd561c6721 |
@@ -10,20 +10,22 @@
|
|||||||
#define LAWIN_URL "https://github.com/Lawin0129/LawinServer/zipball/master"
|
#define LAWIN_URL "https://github.com/Lawin0129/LawinServer/zipball/master"
|
||||||
|
|
||||||
#define BINARY_PATH_OT L".\\FortniteGame\\Binaries\\Win32\\FortniteClient-Win32-Shipping.exe"
|
#define BINARY_PATH_OT L".\\FortniteGame\\Binaries\\Win32\\FortniteClient-Win32-Shipping.exe"
|
||||||
|
#define BINARY_PATH_OT_FUCKBLK L".\\FortniteGame\\Binaries\\Win32\\FortniteClient-Win64-Shipping.exe" // what the actual fuck is wrong with this guy
|
||||||
#define CONTENT_PATH_OT L".\\FortniteGame\\Content\\"
|
#define CONTENT_PATH_OT L".\\FortniteGame\\Content\\"
|
||||||
#define CONFIG_PATH_OT L".\\FortniteGame\\Config\\"
|
#define CONFIG_PATH_OT L".\\FortniteGame\\Config\\"
|
||||||
#define DEFAULTENGINE_URL "https://github.com/absoluteSpacehead/testtesttest/raw/refs/heads/main/DefaultEngine.ini"
|
#define DEFAULTENGINE_URL "https://github.com/absoluteSpacehead/MercuryLauncher-Assets/raw/refs/heads/main/DefaultEngine.ini"
|
||||||
#define DEFAULTGAME_URL "https://github.com/absoluteSpacehead/testtesttest/raw/refs/heads/main/DefaultGame.ini"
|
#define DEFAULTGAME_URL "https://github.com/absoluteSpacehead/MercuryLauncher-Assets/raw/refs/heads/main/DefaultGame.ini"
|
||||||
#define ABILITIES_URL "https://github.com/absoluteSpacehead/testtesttest/raw/refs/heads/main/GE_AllAbilities.uasset"
|
#define ABILITIES_URL "https://github.com/absoluteSpacehead/MercuryLauncher-Assets/raw/refs/heads/main/GE_AllAbilities.uasset"
|
||||||
#define ACTOR_URL "https://github.com/absoluteSpacehead/testtesttest/raw/refs/heads/main/InGame_Actor.uasset"
|
#define ACTOR_URL "https://github.com/absoluteSpacehead/MercuryLauncher-Assets/raw/refs/heads/main/InGame_Actor.uasset"
|
||||||
#define GAMEMODE_URL "https://github.com/absoluteSpacehead/testtesttest/raw/refs/heads/main/InGame_Gamemode.uasset"
|
#define GAMEMODE_URL "https://github.com/absoluteSpacehead/MercuryLauncher-Assets/raw/refs/heads/main/InGame_Gamemode.uasset"
|
||||||
|
#define PAK_URL_OT "https://github.com/absoluteSpacehead/MercuryLauncher-Assets/raw/refs/heads/main/FortniteGame-WindowsClient_p.pak"
|
||||||
|
|
||||||
#define BINARY_PATH_1_8 L".\\FortniteGame\\Binaries\\Win64\\FortniteClient-Win64-Shipping.exe"
|
#define BINARY_PATH_1_8 L".\\FortniteGame\\Binaries\\Win64\\FortniteClient-Win64-Shipping.exe"
|
||||||
#define PAKS_PATH_1_8 L".\\FortniteGame\\Content\\Paks\\"
|
#define PAKS_PATH_1_8 L".\\FortniteGame\\Content\\Paks\\"
|
||||||
#define PRODUCT_VERSION_1_8 L"3724489"
|
#define PRODUCT_VERSION_1_8 L"3724489"
|
||||||
#define DLL_URL "https://github.com/absoluteSpacehead/testtesttest/raw/refs/heads/main/Mercury-1.8.dll"
|
#define DLL_URL "https://github.com/absoluteSpacehead/MercuryLauncher-Assets/raw/refs/heads/main/Mercury-1.8.dll"
|
||||||
#define PAK_URL "https://github.com/absoluteSpacehead/testtesttest/raw/refs/heads/main/zzz_LawinServer.pak"
|
#define PAK_URL_18 "https://github.com/absoluteSpacehead/MercuryLauncher-Assets/raw/refs/heads/main/zzz_LawinServer.pak"
|
||||||
#define SIG_URL "https://github.com/absoluteSpacehead/testtesttest/raw/refs/heads/main/zzz_LawinServer.sig"
|
#define SIG_URL_18 "https://github.com/absoluteSpacehead/MercuryLauncher-Assets/raw/refs/heads/main/zzz_LawinServer.sig"
|
||||||
|
|
||||||
HANDLE job;
|
HANDLE job;
|
||||||
|
|
||||||
@@ -257,19 +259,31 @@ int RunLawin()
|
|||||||
|
|
||||||
// The setup for OT / 1.8 are *completely* different, to the point where theres no code shared between them
|
// The setup for OT / 1.8 are *completely* different, to the point where theres no code shared between them
|
||||||
|
|
||||||
int SetupOT()
|
int SetupOTPak()
|
||||||
{
|
{
|
||||||
int lawinStatus = RunLawin();
|
std::wstring pathAsWstring(CONTENT_PATH_OT);
|
||||||
if (lawinStatus != 0)
|
pathAsWstring += L"Paks\\";
|
||||||
return 1;
|
|
||||||
|
|
||||||
// are we pakless?
|
// https://forums.unrealengine.com/t/overriding-or-swapping-out-asset-in-a-pak-file/472404
|
||||||
if (!std::filesystem::exists(CONFIG_PATH_OT))
|
// despite arbitrary filenames working in 1.8, OT6.5 seemingly doesnt accept that?
|
||||||
|
if (!std::filesystem::exists(pathAsWstring + L"FortniteGame-WindowsClient_p.pak"))
|
||||||
{
|
{
|
||||||
std::cerr << "Build may not be pakless (Config folder not found). Ensure you downloaded the build from the Mercury server.\n";
|
std::cout << "Required Mercury file is missing. Downloading...\n";
|
||||||
return 2;
|
|
||||||
|
if (DownloadFile(PAK_URL_OT, (pathAsWstring + L"FortniteGame-WindowsClient_p.pak").c_str()) != 0)
|
||||||
|
{
|
||||||
|
std::cerr << "Failed to download FortniteGame-WindowsClient_p.pak.\n";
|
||||||
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::cout << "File downloaded.\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SetupOTPakless()
|
||||||
|
{
|
||||||
std::wstring pathAsWstring(CONTENT_PATH_OT);
|
std::wstring pathAsWstring(CONTENT_PATH_OT);
|
||||||
|
|
||||||
// check if we have InGame_Gamemode.uasset. we download this last so if we're missing this we can download everything just to be safe
|
// check if we have InGame_Gamemode.uasset. we download this last so if we're missing this we can download everything just to be safe
|
||||||
@@ -312,12 +326,50 @@ int SetupOT()
|
|||||||
std::cout << "All files downloaded.\n";
|
std::cout << "All files downloaded.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "Starting Fortnite...\nLoading may take a while. Enter anything on the login screen.\n";
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SetupOT()
|
||||||
|
{
|
||||||
|
int lawinStatus = RunLawin();
|
||||||
|
if (lawinStatus != 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
// i just cant fucking believe it
|
||||||
|
if (std::filesystem::exists(BINARY_PATH_OT_FUCKBLK))
|
||||||
|
{
|
||||||
|
std::cout << "Looks like this build was downloaded from blk. Fixing your build files...\n";
|
||||||
|
std::filesystem::rename(BINARY_PATH_OT_FUCKBLK, BINARY_PATH_OT);
|
||||||
|
std::filesystem::remove(L".\\FortniteGame\\Binaries\\Win32\\FortniteLauncher.exe");
|
||||||
|
std::filesystem::remove(L".\\FortniteGame\\Binaries\\Win32\\Launcher.bat");
|
||||||
|
}
|
||||||
|
|
||||||
|
// are we pakless?
|
||||||
|
if (!std::filesystem::exists(CONFIG_PATH_OT))
|
||||||
|
{
|
||||||
|
if (SetupOTPak() != 0)
|
||||||
|
{
|
||||||
|
std::cerr << "Failed to set up Mercury. (OT6.5 pakked)\n";
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (SetupOTPakless() != 0)
|
||||||
|
{
|
||||||
|
std::cerr << "Failed to set up Mercury. (OT6.5 pakless)\n";
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << "Starting Fortnite...\nLoading may take a while.\n";
|
||||||
|
|
||||||
STARTUPINFOW startupInfo = { 0 };
|
STARTUPINFOW startupInfo = { 0 };
|
||||||
startupInfo.cb = sizeof(STARTUPINFO);
|
startupInfo.cb = sizeof(STARTUPINFO);
|
||||||
PROCESS_INFORMATION processInformation = { 0 };
|
PROCESS_INFORMATION processInformation = { 0 };
|
||||||
CreateProcessW(BINARY_PATH_OT, nullptr, nullptr, nullptr, FALSE, 0x0, nullptr, nullptr, &startupInfo, &processInformation);
|
std::wstring cmd(BINARY_PATH_OT);
|
||||||
|
cmd += L" -log -AUTH_LOGIN=unknown -AUTH_PASSWORD=5001 -AUTH_TYPE=exchangecode";
|
||||||
|
CreateProcessW(BINARY_PATH_OT, &cmd[0], nullptr, nullptr, FALSE, 0x0, nullptr, nullptr, &startupInfo, &processInformation);
|
||||||
|
|
||||||
AssignProcessToJobObject(job, processInformation.hProcess);
|
AssignProcessToJobObject(job, processInformation.hProcess);
|
||||||
|
|
||||||
@@ -346,9 +398,9 @@ int Setup18()
|
|||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check that we have the mercury dll AND the pak. someone could be using the same build folder but have wiped their appdata, etc
|
// check that we have the mercury dll AND the sig. someone could be using the same build folder but have wiped their appdata, etc
|
||||||
std::wstring pathAsWstring(PAKS_PATH_1_8);
|
std::wstring pathAsWstring(PAKS_PATH_1_8);
|
||||||
if (!std::filesystem::exists(localAppData + L"\\Mercury-1.8.dll") || !std::filesystem::exists(pathAsWstring + L"zzz_LawinServer.pak"))
|
if (!std::filesystem::exists(localAppData + L"\\Mercury-1.8.dll") || !std::filesystem::exists(pathAsWstring + L"zzz_LawinServer.sig"))
|
||||||
{
|
{
|
||||||
std::cout << "Required Mercury files are missing. Downloading...\n";
|
std::cout << "Required Mercury files are missing. Downloading...\n";
|
||||||
|
|
||||||
@@ -358,13 +410,13 @@ int Setup18()
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DownloadFile(PAK_URL, (pathAsWstring + L"zzz_LawinServer.pak").c_str()) != 0)
|
if (DownloadFile(PAK_URL_18, (pathAsWstring + L"zzz_LawinServer.pak").c_str()) != 0)
|
||||||
{
|
{
|
||||||
std::cerr << "Failed to download zzz_LawinServer.pak.\n";
|
std::cerr << "Failed to download zzz_LawinServer.pak.\n";
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DownloadFile(SIG_URL, (pathAsWstring + L"zzz_LawinServer.sig").c_str()) != 0)
|
if (DownloadFile(SIG_URL_18, (pathAsWstring + L"zzz_LawinServer.sig").c_str()) != 0)
|
||||||
{
|
{
|
||||||
std::cerr << "Failed to download zzz_LawinServer.sig.\n";
|
std::cerr << "Failed to download zzz_LawinServer.sig.\n";
|
||||||
return 2;
|
return 2;
|
||||||
@@ -454,7 +506,7 @@ int main()
|
|||||||
CloseHandle(processInformation.hProcess);
|
CloseHandle(processInformation.hProcess);
|
||||||
CloseHandle(processInformation.hThread);
|
CloseHandle(processInformation.hThread);
|
||||||
|
|
||||||
if (std::filesystem::exists(BINARY_PATH_OT))
|
if (std::filesystem::exists(BINARY_PATH_OT) || std::filesystem::exists(BINARY_PATH_OT_FUCKBLK))
|
||||||
{
|
{
|
||||||
// we only have 1 32bit build lol
|
// we only have 1 32bit build lol
|
||||||
int status = SetupOT();
|
int status = SetupOT();
|
||||||
@@ -495,7 +547,7 @@ int main()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cerr << "No binaries could be found. Ensure the launcher is placed alongside the FortniteGame and Content folders.\n";
|
std::cerr << "No binaries could be found. Ensure the launcher is placed alongside the FortniteGame and Engine folders.\n";
|
||||||
Exit();
|
Exit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user