Fix slots bug

This commit is contained in:
Zidonuke 2011-12-28 23:12:05 -05:00
parent 3350418f5d
commit 8521241ab7
2 changed files with 5 additions and 2 deletions

View file

@ -132,6 +132,9 @@ namespace TShockAPI
[Description("String that is used when kicking people when the server is full.")]
public string ServerFullReason = "Server is full";
[Description("String that is used when kicking people when the server is full with no reserved slots.")]
public string ServerFullNoReservedReason = "Server is full. No reserved slots open.";
[Description("This will save the world if Terraria crashes from an unhandled exception.")]
public bool SaveWorldOnCrash = true;

View file

@ -549,9 +549,9 @@ namespace TShockAPI
player.Group = Users.GetGroupForIP(player.IP);
}
if (TShock.Utils.ActivePlayers() + 20 > Config.MaxSlots)
if (TShock.Utils.ActivePlayers() + 1 > Config.MaxSlots + 20)
{
TShock.Utils.ForceKick(player, Config.ServerFullReason);
TShock.Utils.ForceKick(player, Config.ServerFullNoReservedReason);
handler.Handled = true;
return;
}