diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 94bcf89c..16775975 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -194,7 +194,10 @@ namespace TShockAPI { for (int player = 0; player < Main.maxPlayers; player++) { - Tools.Kick(player, "server shutting down"); + if (Main.player[player].active) + { + Tools.Kick(player, "Server shutting down!"); + } } WorldGen.saveWorld(); Netplay.disconnect = true; diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 1211ff5d..2d00bd4c 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -454,13 +454,16 @@ namespace TShockAPI { if (Main.netMode != 2) { return; } - if (Tools.activePlayers() + 1 > ConfigurationManager.maxSlots) + string ip = Tools.GetPlayerIP(ply); ; + players[ply] = new TSPlayer(ply); + players[ply].group = Tools.GetGroupForIP(ip); + + if (Tools.activePlayers() + 1 > ConfigurationManager.maxSlots && !players[ply].group.HasPermission("reservedslot")) { Tools.Kick(ply, "Server is full"); return; } - string ip = Tools.GetRealIP(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint.ToString()); var ban = Bans.GetBanByIp(ip); if (ban != null) { diff --git a/TShockAPI/config/groups.txt b/TShockAPI/config/groups.txt index d6b3cbd8..b23e8df8 100644 --- a/TShockAPI/config/groups.txt +++ b/TShockAPI/config/groups.txt @@ -12,9 +12,10 @@ #maintenance cfg causeevents spawnboss tp #spawnmob cheat kill pvpfun #immunetoban immunetokick editspawn -#ignoregriefdetection +#ignoregriefdetection reservedslot default null -newadmin default kick editspawn +vip null reservedslot +newadmin default kick editspawn reservedslot admin newadmin ban causeevents spawnboss spawnmob tp immunetokick kill trustedadmin admin ignorecheatdetection maintenance cfg cheat pvpfun ignorecheatdetection immunetoban ignoregriefdetection \ No newline at end of file