Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revive headless mode #855

Draft
wants to merge 20 commits into
base: dev
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
964d303
Introduce FastMode for MiniInstaller
Wartori54 Nov 1, 2024
2f506ce
Remove PathEverestExe in favour of PathCelesteExe
Wartori54 Nov 1, 2024
f832a09
Split Program.cs into multiple files
Wartori54 Nov 2, 2024
7761543
Cache coreified dll in fastmode
Wartori54 Nov 2, 2024
551ab1f
Add linux build scripts
Wartori54 Nov 2, 2024
932b22e
Adjust linux build scripts according the given feedback
Wartori54 Nov 5, 2024
b8b2b83
Add MMR flag to stub out FNA's window for headless operations
psyGamer Nov 24, 2024
1b0c408
Update FNA3D Linux binary for headless support
psyGamer Nov 24, 2024
ee34ba3
Properly set Everest.Flags.IsHeadless
psyGamer Nov 24, 2024
864118b
Forward "headless" CLI flag from MiniInstaller to MMR
psyGamer Nov 24, 2024
0f048a9
Fix selecting headless FNA3D driver implicitly instead of explicitly
psyGamer Nov 24, 2024
a479285
Force "Headless" driver and disable splash in headless mode
psyGamer Nov 24, 2024
dca748b
Reduce Game.Tick() to only Update()
psyGamer Nov 25, 2024
66ff6a5
Stub-out FMOD functions and disable audio in headless mode
psyGamer Nov 27, 2024
66bbd6c
Disable graphics loading in headless mode
psyGamer Nov 27, 2024
eb43b8b
Only load width and height from textures in headless mode
psyGamer Nov 30, 2024
fbea436
Disable DiscordSDK and error log opening in headless mode
psyGamer Nov 30, 2024
573d5c4
Skip out-of-box-experience in headless mode
psyGamer Dec 15, 2024
0adc56c
Always skip game intro in headless mode
psyGamer Dec 15, 2024
a35b464
Prevent mod auto-updating in headless mode
psyGamer Dec 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove PathEverestExe in favour of PathCelesteExe
  • Loading branch information
Wartori54 committed Nov 1, 2024
commit 2f506cedb1a30e1b548c35dadab7b292dd7b35d6
26 changes: 13 additions & 13 deletions MiniInstaller/Program.cs
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ public enum InstallPlatform {
public static string PathGame;
public static string PathOSXExecDir;
public static string PathCelesteExe;
public static string PathEverestExe, PathEverestDLL;
public static string PathEverestDLL;
public static string PathEverestLib;
public static string PathOrig;
public static string PathLog;
@@ -146,20 +146,20 @@ public static int Standard(string[] args) {
if (AsmMonoMod == null || AsmNETCoreifier == null)
LoadModders();

ConvertToNETCore(Path.Combine(PathOrig, "Celeste.exe"), PathEverestExe);
ConvertToNETCore(Path.Combine(PathOrig, "Celeste.exe"), PathCelesteExe);

string everestModDLL = Path.ChangeExtension(PathCelesteExe, ".Mod.mm.dll");
string[] mods = new string[] { PathEverestLib, everestModDLL };
RunMonoMod(Path.Combine(PathEverestLib, "FNA.dll"), Path.Combine(PathGame, "FNA.dll"), dllPaths: mods); // We need to patch some methods in FNA as well
RunMonoMod(PathEverestExe, dllPaths: mods);
RunMonoMod(PathCelesteExe, dllPaths: mods);

string hookGenOutput = Path.Combine(PathGame, "MMHOOK_" + Path.ChangeExtension(Path.GetFileName(PathCelesteExe), ".dll"));
RunHookGen(PathEverestExe, PathCelesteExe);
RunHookGen(PathCelesteExe, PathCelesteExe);
RunMonoMod(hookGenOutput, dllPaths: mods); // We need to fix some MonoMod crimes, so relink it against the legacy MonoMod layer

MoveExecutable(PathEverestExe, PathEverestDLL);
MoveExecutable(PathCelesteExe, PathEverestDLL);
CreateRuntimeConfigFiles(PathEverestDLL, new string[] { everestModDLL, hookGenOutput });
SetupAppHosts(PathEverestExe, PathEverestDLL, PathEverestDLL);
SetupAppHosts(PathCelesteExe, PathEverestDLL, PathEverestDLL);

CombineXMLDoc(Path.ChangeExtension(PathCelesteExe, ".Mod.mm.xml"), Path.ChangeExtension(PathCelesteExe, ".xml"));

@@ -272,7 +272,7 @@ public static int FastMode(string[] args) {
// And assembly references changing is also a rare occasion, so skip it as well
if (doAppHost) {
CreateRuntimeConfigFiles(PathEverestDLL, new string[] { everestModDLL, hookGenOutput });
SetupAppHosts(PathEverestExe, PathEverestDLL, PathEverestDLL);
SetupAppHosts(PathCelesteExe, PathEverestDLL, PathEverestDLL);
}

// Combining xml docs is slow, and most of the time not even required
@@ -320,9 +320,9 @@ public static bool SetupPaths() {

// Here lies a reminder that patching into Everest.exe only caused confusion and issues.
// RIP Everest.exe 2019 - 2020
PathEverestExe = PathCelesteExe;
PathEverestDLL = Path.ChangeExtension(PathEverestExe, ".dll");
PathEverestLib = Path.Combine(Path.GetDirectoryName(PathEverestExe), "everest-lib");
// PathEverestExe = PathCelesteExe;
PathEverestDLL = Path.ChangeExtension(PathCelesteExe, ".dll");
PathEverestLib = Path.Combine(Path.GetDirectoryName(PathCelesteExe), "everest-lib");

PathOrig = Path.Combine(PathGame, "orig");
PathLog = Path.Combine(PathGame, "miniinstaller-log.txt");
@@ -354,7 +354,7 @@ public static void WaitForGameExit() {
}

if (
(File.Exists(PathEverestExe) && !CanReadWrite(PathEverestExe)) ||
(File.Exists(PathCelesteExe) && !CanReadWrite(PathCelesteExe)) ||
(File.Exists(PathEverestDLL) && !CanReadWrite(PathEverestDLL))
) {
LogErr("Celeste not read-writeable - waiting");
@@ -1056,9 +1056,9 @@ public static void StartGame() {
// If the game was installed via Steam, it should restart in a Steam context on its own.
if (Platform != InstallPlatform.Windows) {
// The Linux and macOS version apphosts don't end in ".exe"
game.StartInfo.FileName = Path.ChangeExtension(PathEverestExe, null);
game.StartInfo.FileName = Path.ChangeExtension(PathCelesteExe, null);
} else {
game.StartInfo.FileName = PathEverestExe;
game.StartInfo.FileName = PathCelesteExe;
}
game.StartInfo.WorkingDirectory = PathGame;
game.Start();