Skip to content

Commit 7ee044e

Browse files
committed
Add support for launching via Heroic
1 parent f0960af commit 7ee044e

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

RLBotCS/ManagerTools/ConfigValidator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ public static bool Validate(MatchConfigurationT config)
2929
if (config.Launcher == Launcher.Custom)
3030
{
3131
config.LauncherArg = (config.LauncherArg ?? "").ToLower();
32-
if (config.LauncherArg != "legendary")
32+
if (config.LauncherArg != "legendary" && config.LauncherArg != "heroic")
3333
{
3434
Logger.LogError(
3535
$"Invalid {ctx.ToStringWithEnd(Fields.RlBotLauncherArg)} value \"{config.LauncherArg}\". "
36-
+ $"\"legendary\" is the only Custom launcher supported currently."
36+
+ $"\"legendary\" and \"heroic\" are the only Custom launchers supported currently."
3737
);
3838
valid = false;
3939
}

RLBotCS/ManagerTools/LaunchManager.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,15 @@ private static void LaunchGameViaLegendary()
135135
legendary.Start();
136136
}
137137

138+
private static void LaunchGameViaHeroic()
139+
{
140+
Logger.LogWarning("Launching via Heroic...");
141+
Process heroic = RunCommandInShell(
142+
"xdg-open 'heroic://launch?appName=Sugar&runner=legendary&arg=-rlbot&arg=RLBot_ControllerURL%3D127.0.0.1%3A23233&arg=RLBot_PacketSendRate%3D240&arg=-nomovie'"
143+
);
144+
heroic.Start();
145+
}
146+
138147
public static void LaunchBots(
139148
List<rlbot.flat.PlayerConfigurationT> bots,
140149
int rlbotSocketsPort
@@ -324,6 +333,11 @@ int gamePort
324333
LaunchGameViaLegendary();
325334
return;
326335
}
336+
else if (extraArg.ToLower() == "heroic")
337+
{
338+
LaunchGameViaHeroic();
339+
return;
340+
}
327341

328342
throw new NotSupportedException($"Unexpected launcher, \"{extraArg}\"");
329343
case rlbot.flat.Launcher.NoLaunch:
@@ -355,6 +369,11 @@ int gamePort
355369
LaunchGameViaLegendary();
356370
return;
357371
}
372+
else if (extraArg.ToLower() == "heroic")
373+
{
374+
LaunchGameViaHeroic();
375+
return;
376+
}
358377

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

0 commit comments

Comments
 (0)