Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ZkLobbyServer/ServerBattle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class ServerBattle : Battle
public const int MapVoteTime = 25;
public const int NumberOfMapChoices = 4;
public const int MinimumAutostartPlayers = 6;
public const int MinimumGameSizeToPrioritiseNewPlayers = 13; // TODO: !commandable per host
public const int PrevBattleQueueOffset = 100000;
public static int BattleCounter;
public int QueueCounter = 0;
Expand Down Expand Up @@ -1143,7 +1144,14 @@ protected virtual async Task OnDedicatedExited(SpringBattleContext springBattleC
if (ubs.QueueOrder > QueueCounter + PrevBattleQueueOffset/2) ubs.QueueOrder -= PrevBattleQueueOffset;
}
}
previousGamePlayers = springBattleContext.ActualPlayers.Where(x => !x.IsSpectator).Select(x => x.Name).ToList();
var players = springBattleContext.ActualPlayers.Where(x => !x.IsSpectator).Select(x => x.Name).ToList();
if (players.Count >= MinimumGameSizeToPrioritiseNewPlayers) {
previousGamePlayers = players;
}
else
{
previousGamePlayers = new List<string>();
}
foreach (var n in previousGamePlayers)
{
UserBattleStatus ubs;
Expand Down
Loading