Skip to content

Commit e9469d6

Browse files
authored
Merge pull request #3018 from ZeroK-RTS/master
Make hosts only apply previous game deprioritisation if the game was larger than 6v6.
2 parents 0a74d10 + d038d39 commit e9469d6

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

ZkLobbyServer/ServerBattle.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class ServerBattle : Battle
2929
public const int MapVoteTime = 25;
3030
public const int NumberOfMapChoices = 4;
3131
public const int MinimumAutostartPlayers = 6;
32+
public const int MinimumGameSizeToPrioritiseNewPlayers = 13; // TODO: !commandable per host
3233
public const int PrevBattleQueueOffset = 100000;
3334
public static int BattleCounter;
3435
public int QueueCounter = 0;
@@ -1143,7 +1144,14 @@ protected virtual async Task OnDedicatedExited(SpringBattleContext springBattleC
11431144
if (ubs.QueueOrder > QueueCounter + PrevBattleQueueOffset/2) ubs.QueueOrder -= PrevBattleQueueOffset;
11441145
}
11451146
}
1146-
previousGamePlayers = springBattleContext.ActualPlayers.Where(x => !x.IsSpectator).Select(x => x.Name).ToList();
1147+
var players = springBattleContext.ActualPlayers.Where(x => !x.IsSpectator).Select(x => x.Name).ToList();
1148+
if (players.Count >= MinimumGameSizeToPrioritiseNewPlayers) {
1149+
previousGamePlayers = players;
1150+
}
1151+
else
1152+
{
1153+
previousGamePlayers = new List<string>();
1154+
}
11471155
foreach (var n in previousGamePlayers)
11481156
{
11491157
UserBattleStatus ubs;

0 commit comments

Comments
 (0)