Hack: Changed the ChooseFreePlayerIndex (hack on its own..) to loop till 256 instead of 8 (ie increasing max player support to 256)

This commit is contained in:
geckosoft
2010-11-01 05:13:42 +01:00
committed by Chris Forbes
parent 6276e659cd
commit 5164c3cd7d

View File

@@ -191,14 +191,16 @@ namespace OpenRA.Server
* for manual spawnpoint choosing.
* - pick sensible non-conflicting colors for bots.
*/
/// <summary>
/// @todo The 256 is a big hack, need to look @ amount of available slots instead?
/// </summary>
static int ChooseFreePlayerIndex()
{
for (var i = 0; i < 8; i++)
for (var i = 0; i < 256; i++) // 256 was 8, but thats bit low
if (conns.All(c => c.PlayerIndex != i))
return i;
throw new InvalidOperationException("Already got 8 players");
throw new InvalidOperationException("Already got 256 players");
}
static int ChooseFreeSlot()