Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions BedrockLauncher.Core/BedrockCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@

if (processes.Length > 0)
{
return processes

Check warning on line 247 in BedrockLauncher.Core/BedrockCore.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference return.

Check warning on line 247 in BedrockLauncher.Core/BedrockCore.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference return.
.Where(p => p.StartTime > startTime)
.OrderBy(p => (p.StartTime - startTime).TotalMilliseconds)
.FirstOrDefault();
Expand All @@ -254,7 +254,7 @@
await Task.Delay(200);
}

return null;

Check warning on line 257 in BedrockLauncher.Core/BedrockCore.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference return.

Check warning on line 257 in BedrockLauncher.Core/BedrockCore.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference return.
}
private static DateTime GetStartTimeSafe(Process proc)
{
Expand Down Expand Up @@ -287,16 +287,17 @@
.ToDictionary(p => p.Id, p => GetStartTimeSafe(p));

DateTime launchTime = DateTime.Now;
string cmdLine = $"/c start \"\" \"{fullPath}\" {options.LaunchArgs}";

Process.Start(new ProcessStartInfo
{
FileName = "cmd.exe",
ArgumentList =
{ "/c", "start", $"\"{fullPath}\"", string.IsNullOrEmpty(options.LaunchArgs) ? "" : options.LaunchArgs },
Arguments = cmdLine,
UseShellExecute = false,
CreateNoWindow = true
});

Process minecraftProcess = null;

Check warning on line 300 in BedrockLauncher.Core/BedrockCore.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Converting null literal or possible null value to non-nullable type.

Check warning on line 300 in BedrockLauncher.Core/BedrockCore.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Converting null literal or possible null value to non-nullable type.


for (int i = 0; i < 10; i++)
Expand Down Expand Up @@ -469,7 +470,7 @@
process = processes.OrderBy(p => p.StartTime).Last();
}

return process;

Check warning on line 473 in BedrockLauncher.Core/BedrockCore.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference return.

Check warning on line 473 in BedrockLauncher.Core/BedrockCore.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference return.
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions BedrockLauncher.Core/BedrockLauncher.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<Version>2.0.4.6-dev</Version>
<Version>2.0.4.7-dev</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<Version>2.0.4.6</Version>
<Version>2.0.4.7</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
10 changes: 8 additions & 2 deletions TestProject/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static void Main(string[] args)
var bedrockCore = new BedrockCore();
bedrockCore.InitAsync().Wait();

bedrockCore.InstallPackageAsync(new LocalGamePackageOptions()
/*bedrockCore.InstallPackageAsync(new LocalGamePackageOptions()
{
FileFullPath = @"D:\BedrockBoot\version_save\1.26.2.insPack",
Type = MinecraftBuildTypeVersion.GDK,
Expand All @@ -25,8 +25,14 @@ static void Main(string[] args)
Console.WriteLine($"Extract: [{p.CurrentCount}/{p.TotalCount}] {p.FileName}")),
InstallStates = new Progress<InstallStates>(s =>
Console.WriteLine($"State: {s}")),
}).Wait();
}).Wait();*/

bedrockCore.LaunchGameAsync(new()
{
MinecraftBuildType = MinecraftBuildTypeVersion.GDK,
GameFolder = "E:\\Bedrock Test\\bedrock_versions\\1.26.3202",
GameType = MinecraftGameTypeVersion.Release
});
Console.WriteLine("Install done.");
}
}
Expand Down
Loading