Skip to content

Commit d9bbcce

Browse files
committed
also support heroic on windows
1 parent 7ee044e commit d9bbcce

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

RLBotCS/ManagerTools/LaunchManager.cs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,26 @@ private static void LaunchGameViaLegendary()
137137

138138
private static void LaunchGameViaHeroic()
139139
{
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-
);
140+
Process heroic;
141+
142+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
143+
{
144+
heroic = RunCommandInShell(
145+
"xdg-open 'heroic://launch?appName=Sugar&runner=legendary&arg=-rlbot&arg=RLBot_ControllerURL%3D127.0.0.1%3A23233&arg=RLBot_PacketSendRate%3D240&arg=-nomovie'"
146+
);
147+
}
148+
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
149+
{
150+
heroic = RunCommandInShell(
151+
"start \"\" \"heroic://launch?appName=Sugar&runner=legendary&arg=-rlbot&arg=RLBot_ControllerURL%3D127.0.0.1%3A23233&arg=RLBot_PacketSendRate%3D240&arg=-nomovie\""
152+
);
153+
}
154+
else
155+
{
156+
throw new PlatformNotSupportedException(
157+
"RLBot is not supported on non-Windows/Linux platforms"
158+
);
159+
}
144160
heroic.Start();
145161
}
146162

0 commit comments

Comments
 (0)