Skip to content

Commit

Permalink
Merge pull request #158 from rankynbass/fix-ldpreload-to-xlpreload
Browse files Browse the repository at this point in the history
  • Loading branch information
Blooym authored Jun 26, 2024
2 parents daa3abc + aff3492 commit bc5e800
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/XIVLauncher.Core/Components/MainPage/MainPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,17 @@ public async Task<Process> StartGameAndAddon(Launcher.LoginResult loginResult, b

IGameRunner runner;

// Set LD_PRELOAD to value of XL_PRELOAD if we're running as a steam compatibility tool.
// This check must be done before the FixLDP check so that it will still work.
if (CoreEnvironmentSettings.IsSteamCompatTool)
{
var ldpreload = System.Environment.GetEnvironmentVariable("LD_PRELOAD") ?? "";
var xlpreload = System.Environment.GetEnvironmentVariable("XL_PRELOAD") ?? "";
ldpreload = (ldpreload + ":" + xlpreload).Trim(':');
if (!string.IsNullOrEmpty(ldpreload))
System.Environment.SetEnvironmentVariable("LD_PRELOAD", ldpreload);
}

// Hack: Force C.utf8 to fix incorrect unicode paths
if (App.Settings.FixLocale == true && !string.IsNullOrEmpty(Program.CType))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ public class SettingsTabGame : SettingsTab
new SettingsEntry<DpiAwareness>("Game DPI Awareness", "Select the game's DPI Awareness. Change this if the game's scaling looks wrong.", () => Program.Config.DpiAwareness ?? DpiAwareness.Unaware, x => Program.Config.DpiAwareness = x),
new SettingsEntry<bool>("Free Trial Account", "Check this if you are using a free trial account.", () => Program.Config.IsFt ?? false, x => Program.Config.IsFt = x),
new SettingsEntry<bool>("Use XIVLauncher authenticator/OTP macros", "Check this if you want to use the XIVLauncher authenticator app or macros.", () => Program.Config.IsOtpServer ?? false, x => Program.Config.IsOtpServer = x),
new SettingsEntry<bool>("Ignore Steam", "Check this if you do not want XIVLauncher to communicate with Steam (Requires Restart).", () => Program.Config.IsIgnoringSteam ?? false, x => Program.Config.IsIgnoringSteam = x),
new SettingsEntry<bool>("Ignore Steam", "Check this if you do not want XIVLauncher to communicate with Steam (Requires Restart).", () => Program.Config.IsIgnoringSteam ?? false, x => Program.Config.IsIgnoringSteam = x)
{
CheckVisibility = () => !CoreEnvironmentSettings.IsSteamCompatTool,
},
new SettingsEntry<bool>("Use Experimental UID Cache", "Tries to save your login token for the next start. Can result in launching with expired sessions.\nDisable if receiving FFXIV error 1012 or 500X.", () => Program.Config.IsUidCacheEnabled ?? false, x => Program.Config.IsUidCacheEnabled = x),
};

Expand Down
1 change: 1 addition & 0 deletions src/XIVLauncher.Core/CoreEnvironmentSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public static class CoreEnvironmentSettings
public static bool ClearLogs => CheckEnvBool("XL_CLEAR_LOGS");
public static bool ClearAll => CheckEnvBool("XL_CLEAR_ALL");
public static bool? UseSteam => CheckEnvBoolOrNull("XL_USE_STEAM"); // Fix for Steam Deck users who lock themselves out
public static bool IsSteamCompatTool => CheckEnvBool("XL_SCT");

private static bool CheckEnvBool(string key)
{
Expand Down
2 changes: 1 addition & 1 deletion src/XIVLauncher.Core/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ private static void Main(string[] args)
default:
throw new PlatformNotSupportedException();
}
if (!Config.IsIgnoringSteam ?? true)
if (Config.IsIgnoringSteam != true || CoreEnvironmentSettings.IsSteamCompatTool)
{
try
{
Expand Down

0 comments on commit bc5e800

Please sign in to comment.