@@ -4,40 +4,43 @@ namespace RLBotCS.ManagerTools;
44
55public static partial class LaunchManager
66{
7- private static void LaunchGameViaLegendary ( )
7+ private static void LaunchGameViaLegendary ( int gamePort )
88 {
9- Process legendary = RunCommandInShell (
10- "legendary launch Sugar -rlbot RLBot_ControllerURL=127.0.0.1:23233 RLBot_PacketSendRate=240 -nomovie"
11- ) ;
9+ string args = string . Join ( " " , GetRLBotArgs ( gamePort ) ) ;
10+ Process legendary = RunCommandInShell ( $ "legendary launch Sugar { args } -noeac") ;
1211 legendary . Start ( ) ;
1312 }
1413
15- private static void LaunchGameViaHeroic ( )
14+ private static void LaunchGameViaHeroic ( int gamePort )
1615 {
16+ string [ ] rlbotArgs = GetRLBotArgs ( gamePort ) ;
17+ string heroicArgs = string . Join (
18+ "" ,
19+ rlbotArgs . Select ( a => $ "&arg={ Uri . EscapeDataString ( a ) } ")
20+ ) ;
21+ string heroicUrl =
22+ $ "heroic://launch?appName=Sugar&runner=legendary{ heroicArgs } &arg=-noeac";
23+
1724 Process heroic ;
1825
1926#if WINDOWS
20- heroic = RunCommandInShell (
21- "start \" \" \" heroic://launch?appName=Sugar&runner=legendary&arg=-rlbot&arg=RLBot_ControllerURL%3D127.0.0.1%3A23233&arg=RLBot_PacketSendRate%3D240&arg=-nomovie\" "
22- ) ;
27+ heroic = RunCommandInShell ( $ "start \" \" \" { heroicUrl } \" ") ;
2328#else
24- heroic = RunCommandInShell (
25- "xdg-open 'heroic://launch?appName=Sugar&runner=legendary&arg=-rlbot&arg=RLBot_ControllerURL%3D127.0.0.1%3A23233&arg=RLBot_PacketSendRate%3D240&arg=-nomovie'"
26- ) ;
29+ heroic = RunCommandInShell ( $ "xdg-open '{ heroicUrl } '") ;
2730#endif
2831
2932 heroic . Start ( ) ;
3033 }
3134
32- private static void LaunchCustomLauncher ( string extraArg )
35+ private static void LaunchCustomLauncher ( string extraArg , int gamePort )
3336 {
3437 if ( extraArg . Equals ( "legendary" , StringComparison . OrdinalIgnoreCase ) )
3538 {
36- LaunchGameViaLegendary ( ) ;
39+ LaunchGameViaLegendary ( gamePort ) ;
3740 }
3841 else if ( extraArg . Equals ( "heroic" , StringComparison . OrdinalIgnoreCase ) )
3942 {
40- LaunchGameViaHeroic ( ) ;
43+ LaunchGameViaHeroic ( gamePort ) ;
4144 }
4245 else
4346 {
0 commit comments