Skip to content

Commit 224d337

Browse files
authored
Add zenserver as an option to uet run (#734)
1 parent 47df4a3 commit 224d337

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

UET/uet/Commands/Run/RunCommand.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ internal sealed class RunCommand : ICommandDescriptorProvider<UetGlobalCommandCo
5959
xcode: Run the version of Xcode that this Unreal Engine version requires.
6060
fastlane: Install and run Fastlane.
6161
unrealpak: Run UnrealPak.
62+
zenserver: Run the Zen server.
6263
6364
If --path points to a project file, the target will automatically receive the project file as an argument in an appropriate manner, if possible.
6465
"""
@@ -129,6 +130,7 @@ public Options(
129130
"xcode",
130131
"fastlane",
131132
"unrealpak",
133+
"zenserver",
132134
]);
133135
Target.Arity = ArgumentArity.ExactlyOne;
134136
Target.HelpName = "target";
@@ -687,6 +689,36 @@ void SearchForPaths()
687689
CaptureSpecification.Passthrough,
688690
context.GetCancellationToken()).ConfigureAwait(false);
689691
}
692+
case "zenserver":
693+
{
694+
var executableSuffix = OperatingSystem.IsWindows() ? ".exe" : string.Empty;
695+
696+
var zenServerPath = Path.Combine(
697+
engineWorkspace.Path,
698+
"Engine",
699+
"Binaries",
700+
platformName,
701+
"zenserver" + executableSuffix);
702+
if (!File.Exists(zenServerPath))
703+
{
704+
_logger.LogError("Can't find existing zenserver executable.");
705+
return 1;
706+
}
707+
708+
var runArguments = new List<LogicalProcessArgument>();
709+
runArguments.AddRange(arguments.Select(x => new LogicalProcessArgument(x)));
710+
711+
LogExecution(zenServerPath, runArguments, false);
712+
return await _processExecutor.ExecuteAsync(
713+
new ProcessSpecification
714+
{
715+
FilePath = zenServerPath,
716+
Arguments = runArguments,
717+
WorkingDirectory = engineWorkspace.Path,
718+
},
719+
CaptureSpecification.Passthrough,
720+
context.GetCancellationToken()).ConfigureAwait(false);
721+
}
690722
case "uat":
691723
case "ubt":
692724
{

0 commit comments

Comments
 (0)