Skip to content

Commit 677a98a

Browse files
authored
Add -noeac arg for heroic/legendary (#174)
Add game port parameter to custom launchers
1 parent 0ddf876 commit 677a98a

2 files changed

Lines changed: 18 additions & 15 deletions

File tree

RLBotCS/ManagerTools/LaunchManager/CustomLaunchers.cs

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,43 @@ namespace RLBotCS.ManagerTools;
44

55
public 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
{

RLBotCS/ManagerTools/LaunchManager/RocketLeagueLauncher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int gamePort
3434
LaunchGameViaEpic(gamePort);
3535
break;
3636
case RLBot.Flat.Launcher.Custom:
37-
LaunchCustomLauncher(extraArg);
37+
LaunchCustomLauncher(extraArg, gamePort);
3838
break;
3939
case RLBot.Flat.Launcher.NoLaunch:
4040
break;

0 commit comments

Comments
 (0)