Skip to content

Commit

Permalink
Merge pull request eesast#228 from ONLOX/dev
Browse files Browse the repository at this point in the history
feat: Add player code execution
  • Loading branch information
DreamEnderKing authored Apr 14, 2024
2 parents bf33933 + 6262aa1 commit df9d93e
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions installer/ViewModel/LaunchViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,9 @@ private async Task SaveBtnClicked()
}
private async Task StartBtnClicked()
{
DebugAlert = "Start";
await Task.Run(() => Start());
DebugAlert = "";
}

private void Save()
Expand Down Expand Up @@ -446,13 +448,6 @@ private void Save()

private void Start()
{
// DebugAlert = IP + " "
// + Port + " "
// + TeamID + " "
// + PlayerID + " "
// + ShipType + " "
// + PlaybackFile + " "
// + PlaybackSpeed;
Process.Start(new ProcessStartInfo()
{
FileName = Path.Combine(Downloader.Data.Config.InstallPath, "logic", "Server", "Server.exe"),
Expand All @@ -462,6 +457,24 @@ private void Start()
{
FileName = Path.Combine(Downloader.Data.Config.InstallPath, "logic", "Client", "Client.exe"),
});
if (CppSelect && PlaybackFile == null)
{
Process.Start(new ProcessStartInfo()
{
FileName = Path.Combine(Downloader.Data.Config.InstallPath, "CAPI", "cpp", "x64", "Debug", "CAPI.exe"),
Arguments = $"--I {IP} --P {Port} -t {TeamID} -p {PlayerID} -d"
});
}
else if (PySelect && PlaybackFile == null)
{
Process.Start(new ProcessStartInfo()
{
FileName = "cmd.exe",
Arguments = "/c python"
+ Path.Combine(Downloader.Data.Config.InstallPath, "CAPI", "python", "PyAPI", "main.py")
+ $"--I {IP} --P {Port} -t {TeamID} -p {PlayerID} -d"
});
}
}

private string? debugAlert;
Expand Down

0 comments on commit df9d93e

Please sign in to comment.