fixes for linux
This commit is contained in:
parent
cbfd5f8da8
commit
5e439ee8d5
@ -34,7 +34,8 @@ public class GameVersion
|
|||||||
_gameArgs = new GameArguments(_descriptor);
|
_gameArgs = new GameArguments(_descriptor);
|
||||||
_libraries = new Libraries(_descriptor);
|
_libraries = new Libraries(_descriptor);
|
||||||
WorkingDirectory = GetVersionDir(_descriptor.id);
|
WorkingDirectory = GetVersionDir(_descriptor.id);
|
||||||
JavaExecutableFilePath = GetJavaExecutablePath(_descriptor.javaVersion.component, LauncherApp.Config.debug);
|
JavaExecutableFilePath = GetJavaExecutablePath(
|
||||||
|
_descriptor.javaVersion.component, LauncherApp.Config.redirect_game_output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Download(bool update, Action<NetworkTask> networkTaskCreatedCallback)
|
public async Task Download(bool update, Action<NetworkTask> networkTaskCreatedCallback)
|
||||||
@ -108,6 +109,7 @@ public class GameVersion
|
|||||||
if (string.IsNullOrWhiteSpace(LauncherApp.Config.player_name))
|
if (string.IsNullOrWhiteSpace(LauncherApp.Config.player_name))
|
||||||
throw new Exception("invalid player name");
|
throw new Exception("invalid player name");
|
||||||
|
|
||||||
|
string classSeparator = PlatformHelper.GetOs() == "windows" ? ";" : ":";
|
||||||
Directory.Create(WorkingDirectory);
|
Directory.Create(WorkingDirectory);
|
||||||
string uuid = GetPlayerUUID(LauncherApp.Config.player_name);
|
string uuid = GetPlayerUUID(LauncherApp.Config.player_name);
|
||||||
Dictionary<string, string> placeholder_values = new() {
|
Dictionary<string, string> placeholder_values = new() {
|
||||||
@ -127,14 +129,14 @@ public class GameVersion
|
|||||||
{ "launcher_version", "1.6.84-j" },
|
{ "launcher_version", "1.6.84-j" },
|
||||||
{ "classpath", _libraries.Libs.Select(l => l.jarFilePath)
|
{ "classpath", _libraries.Libs.Select(l => l.jarFilePath)
|
||||||
.Append(GetVersionJarFilePath(_descriptor.id))
|
.Append(GetVersionJarFilePath(_descriptor.id))
|
||||||
.MergeToString(';') },
|
.MergeToString(classSeparator) },
|
||||||
{ "assets_index_name", _descriptor.assets },
|
{ "assets_index_name", _descriptor.assets },
|
||||||
{ "assets_root", GetAssetsDir().ToString() },
|
{ "assets_root", GetAssetsDir().ToString() },
|
||||||
{ "game_assets", GetAssetsDir().ToString() },
|
{ "game_assets", GetAssetsDir().ToString() },
|
||||||
{ "game_directory", WorkingDirectory.ToString() },
|
{ "game_directory", WorkingDirectory.ToString() },
|
||||||
{ "natives_directory", GetNativeLibrariesDir(_descriptor.id).ToString() },
|
{ "natives_directory", GetNativeLibrariesDir(_descriptor.id).ToString() },
|
||||||
{ "library_directory", GetLibrariesDir().ToString() },
|
{ "library_directory", GetLibrariesDir().ToString() },
|
||||||
{ "classpath_separator", ";"},
|
{ "classpath_separator", classSeparator},
|
||||||
{ "path", GetLog4jConfigFilePath().ToString() },
|
{ "path", GetLog4jConfigFilePath().ToString() },
|
||||||
{ "version_name", _descriptor.id },
|
{ "version_name", _descriptor.id },
|
||||||
{ "version_type", _descriptor.type },
|
{ "version_type", _descriptor.type },
|
||||||
@ -186,4 +188,4 @@ public class GameVersion
|
|||||||
|
|
||||||
|
|
||||||
public override string ToString() => Id;
|
public override string ToString() => Id;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,9 +5,9 @@ namespace Mlaumcherb.Client.Avalonia.классы;
|
|||||||
|
|
||||||
public class JavaVersionCatalog
|
public class JavaVersionCatalog
|
||||||
{
|
{
|
||||||
[JsonProperty("linux")]
|
[JsonProperty("linux-i386")]
|
||||||
public Dictionary<string, JavaVersionProps[]>? linux_x86 { get; set; }
|
public Dictionary<string, JavaVersionProps[]>? linux_x86 { get; set; }
|
||||||
[JsonProperty("linux-i386")]
|
[JsonProperty("linux")]
|
||||||
public Dictionary<string, JavaVersionProps[]>? linux_x64 { get; set; }
|
public Dictionary<string, JavaVersionProps[]>? linux_x64 { get; set; }
|
||||||
[JsonProperty("mac-os")]
|
[JsonProperty("mac-os")]
|
||||||
public Dictionary<string, JavaVersionProps[]>? osx_x64 { get; set; }
|
public Dictionary<string, JavaVersionProps[]>? osx_x64 { get; set; }
|
||||||
@ -82,4 +82,4 @@ public class JavaCompressedArtifact
|
|||||||
{
|
{
|
||||||
public Artifact? lzma { get; set; }
|
public Artifact? lzma { get; set; }
|
||||||
[JsonRequired] public Artifact raw { get; set; } = null!;
|
[JsonRequired] public Artifact raw { get; set; } = null!;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,14 +40,17 @@ public static class PathHelper
|
|||||||
|
|
||||||
public static IOPath GetJavaBinDir(string id) =>
|
public static IOPath GetJavaBinDir(string id) =>
|
||||||
Path.Concat(GetJavaRuntimeDir(id), "bin");
|
Path.Concat(GetJavaRuntimeDir(id), "bin");
|
||||||
public static IOPath GetJavaExecutablePath(string id, bool debug)
|
public static IOPath GetJavaExecutablePath(string id, bool redirectOutput)
|
||||||
{
|
{
|
||||||
string executable_name = "java";
|
string executable_name = "java";
|
||||||
if (debug)
|
if (!redirectOutput)
|
||||||
executable_name += "w";
|
executable_name = "javaw";
|
||||||
if(OperatingSystem.IsWindows())
|
if(OperatingSystem.IsWindows())
|
||||||
executable_name += ".exe";
|
executable_name += ".exe";
|
||||||
return Path.Concat(GetJavaBinDir(id), executable_name);
|
var path = Path.Concat(GetJavaBinDir(id), executable_name);
|
||||||
|
if(!redirectOutput && !File.Exists(path))
|
||||||
|
return GetJavaExecutablePath(id, true);
|
||||||
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetLog4jConfigFileName() => "log4j.xml";
|
public static string GetLog4jConfigFileName() => "log4j.xml";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user