Skip to content

Commit 22fb905

Browse files
committed
Fix C&S for LAN matches
1 parent 44a78e4 commit 22fb905

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

RLBotCS/Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
if (args.Length > 0 && args[0] == "--version")
1010
{
11-
Console.WriteLine("RLBotServer v5.beta.6.6");
11+
Console.WriteLine("RLBotServer v5.beta.6.7");
1212
Environment.Exit(0);
1313
}
1414

RLBotCS/Server/BridgeHandler.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ private async Task HandleServer()
8585
var mapJustLoaded = MessageHandler.ReceivedMatchInfo(messageClump);
8686
if (mapJustLoaded)
8787
{
88+
if (_context.GameState.MatchPhase != MatchPhase.Paused)
89+
{
90+
// LAN matches don't set the MatchPhase to paused, which breaks Continue & Spawn
91+
// thankfully, we can just manually set the match phase to paused
92+
_context.GameState.MatchPhase = MatchPhase.Paused;
93+
}
94+
8895
if (_context.MatchConfig is { AutoSaveReplay: true })
8996
{
9097
_context.MatchCommandQueue.AddConsoleCommand(
@@ -97,6 +104,10 @@ private async Task HandleServer()
97104
_context.GetPlayerSpawner()
98105
);
99106
_context.Writer.TryWrite(new DistributeFieldInfo(_context.GameState));
107+
108+
// wait for the next tick,
109+
// this ensures we don't start the match too soon
110+
continue;
100111
}
101112

102113
if (_context.GameState.MatchEnded)

0 commit comments

Comments
 (0)