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
4 changes: 2 additions & 2 deletions RLBotCS/ManagerTools/ConfigValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public static bool Validate(MatchConfigurationT config)
if (config.Launcher == Launcher.Custom)
{
config.LauncherArg = (config.LauncherArg ?? "").ToLower();
if (config.LauncherArg != "legendary")
if (config.LauncherArg != "legendary" && config.LauncherArg != "heroic")
{
Logger.LogError(
$"Invalid {ctx.ToStringWithEnd(Fields.RlBotLauncherArg)} value \"{config.LauncherArg}\". "
+ $"\"legendary\" is the only Custom launcher supported currently."
+ $"\"legendary\" and \"heroic\" are the only Custom launchers supported currently."
);
valid = false;
}
Expand Down
35 changes: 35 additions & 0 deletions RLBotCS/ManagerTools/LaunchManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,31 @@ private static void LaunchGameViaLegendary()
legendary.Start();
}

private static void LaunchGameViaHeroic()
{
Process heroic;

if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
heroic = RunCommandInShell(
"xdg-open 'heroic://launch?appName=Sugar&runner=legendary&arg=-rlbot&arg=RLBot_ControllerURL%3D127.0.0.1%3A23233&arg=RLBot_PacketSendRate%3D240&arg=-nomovie'"
);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
heroic = RunCommandInShell(
"start \"\" \"heroic://launch?appName=Sugar&runner=legendary&arg=-rlbot&arg=RLBot_ControllerURL%3D127.0.0.1%3A23233&arg=RLBot_PacketSendRate%3D240&arg=-nomovie\""
);
}
else
{
throw new PlatformNotSupportedException(
"RLBot is not supported on non-Windows/Linux platforms"
);
}
heroic.Start();
}

public static void LaunchBots(
List<rlbot.flat.PlayerConfigurationT> bots,
int rlbotSocketsPort
Expand Down Expand Up @@ -324,6 +349,11 @@ int gamePort
LaunchGameViaLegendary();
return;
}
else if (extraArg.ToLower() == "heroic")
{
LaunchGameViaHeroic();
return;
}

throw new NotSupportedException($"Unexpected launcher, \"{extraArg}\"");
case rlbot.flat.Launcher.NoLaunch:
Expand Down Expand Up @@ -355,6 +385,11 @@ int gamePort
LaunchGameViaLegendary();
return;
}
else if (extraArg.ToLower() == "heroic")
{
LaunchGameViaHeroic();
return;
}

throw new NotSupportedException($"Unexpected launcher, \"{extraArg}\"");
case rlbot.flat.Launcher.NoLaunch:
Expand Down