Fix slots bug
This commit is contained in:
parent
3350418f5d
commit
8521241ab7
2 changed files with 5 additions and 2 deletions
|
|
@ -132,6 +132,9 @@ namespace TShockAPI
|
||||||
[Description("String that is used when kicking people when the server is full.")]
|
[Description("String that is used when kicking people when the server is full.")]
|
||||||
public string ServerFullReason = "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.")]
|
[Description("This will save the world if Terraria crashes from an unhandled exception.")]
|
||||||
public bool SaveWorldOnCrash = true;
|
public bool SaveWorldOnCrash = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -549,9 +549,9 @@ namespace TShockAPI
|
||||||
player.Group = Users.GetGroupForIP(player.IP);
|
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;
|
handler.Handled = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue