Running a Server

KF Max Players. Mutator maximum players

KFMaxPlayers.uc

Gas-masked squad holding a corner as a Bloat leads a horde A squad holds a corner while a Bloat leads the horde toward them.

Class KFMaxPlayers extends Info
    Config(KFMaxPlayers);
var() globalconfig int ForcedMaxPlayers;
function Tick( float Delta )
{
    Log("Forcing server max players from"@Level.Game.MaxPlayers@"to"@ForcedMaxPlayers,Class.Outer.Name);
    Level.Game.MaxPlayers = ForcedMaxPlayers;
    Destroy();
}
defaultproperties
{
     ForcedMaxPlayers=16
}
ServerActors=KFMaxPlayers.KFMaxPlayers

If the server still refuses more than 6 players

  • Where to put the line. In the killingfloor.ru forum "Problem with setting the maximum number of players" thread (2012), the server reported a limit of 16 but said it was full once 6 players had connected. The fix was to find the ServerActors=UWeb.WebServer line in KillingFloor.ini and add ServerActors=KFMaxPlayers.KFMaxPlayers directly below it (advice from Сеня).
  • Conflict with bots. In the "Error adding mutators on the server" thread (2012), KFMaxPlayers did not raise the limit above 6 while the KFBots mutator was installed. Flame explained that KFBots ignores KFMaxPlayers and spawns as many bots as its ini specifies, and that running KFFakedPlayers, KFMaxPlayers and KFBots together is a dubious idea. The limit worked once the bots were disabled.

Without a mutator: through the WebAdmin console

The dedicated server guide on the killingfloor.ru forum ("Creating a dedicated server for Windows" thread, 2011) raised the limit without a mutator, by sending a command to the WebAdmin console through this address in a browser:

http://SERVER_IP:8075/ServerAdmin/current_console?SendText=set Engine.GameInfo MaxPlayers 12

In the "Changing the number of players on a dedicated server" thread (killingfloor.ru forum), alexgreen re-sent the same command in a loop with curl from a batch file (timeout 10 is the pause between repeats in seconds; 30-40 was recommended):

:curl
curl -d "SendText=set Engine.GameInfo MaxPlayers 20" http://login:password@SERVER_IP:8075/ServerAdmin/current_console > nul
timeout 10
goto curl

Later in the same thread players reported that the set Engine.GameInfo MaxPlayers command had been fixed and no longer works, so the mutator above is the more reliable option.