@@ -135,6 +135,31 @@ private static void LaunchGameViaLegendary()
135135 legendary . Start ( ) ;
136136 }
137137
138+ private static void LaunchGameViaHeroic ( )
139+ {
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+ }
160+ heroic . Start ( ) ;
161+ }
162+
138163 public static void LaunchBots (
139164 List < rlbot . flat . PlayerConfigurationT > bots ,
140165 int rlbotSocketsPort
@@ -324,6 +349,11 @@ int gamePort
324349 LaunchGameViaLegendary ( ) ;
325350 return ;
326351 }
352+ else if ( extraArg . ToLower ( ) == "heroic" )
353+ {
354+ LaunchGameViaHeroic ( ) ;
355+ return ;
356+ }
327357
328358 throw new NotSupportedException ( $ "Unexpected launcher, \" { extraArg } \" ") ;
329359 case rlbot . flat . Launcher . NoLaunch :
@@ -355,6 +385,11 @@ int gamePort
355385 LaunchGameViaLegendary ( ) ;
356386 return ;
357387 }
388+ else if ( extraArg . ToLower ( ) == "heroic" )
389+ {
390+ LaunchGameViaHeroic ( ) ;
391+ return ;
392+ }
358393
359394 throw new NotSupportedException ( $ "Unexpected launcher, \" { extraArg } \" ") ;
360395 case rlbot . flat . Launcher . NoLaunch :
0 commit comments