Merge branch 'master' of github.com:TShock/TShock

Conflicts:
	TShockAPI/TShock.cs
This commit is contained in:
high 2011-06-05 19:11:39 -04:00
commit 18a3265ab3
3 changed files with 12 additions and 5 deletions

View file

@ -194,7 +194,10 @@ namespace TShockAPI
{ {
for (int player = 0; player < Main.maxPlayers; player++) 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(); WorldGen.saveWorld();
Netplay.disconnect = true; Netplay.disconnect = true;

View file

@ -454,13 +454,16 @@ namespace TShockAPI
{ {
if (Main.netMode != 2) { return; } 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"); Tools.Kick(ply, "Server is full");
return; return;
} }
string ip = Tools.GetRealIP(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint.ToString());
var ban = Bans.GetBanByIp(ip); var ban = Bans.GetBanByIp(ip);
if (ban != null) if (ban != null)
{ {

View file

@ -12,9 +12,10 @@
#maintenance cfg causeevents spawnboss tp #maintenance cfg causeevents spawnboss tp
#spawnmob cheat kill pvpfun #spawnmob cheat kill pvpfun
#immunetoban immunetokick editspawn #immunetoban immunetokick editspawn
#ignoregriefdetection #ignoregriefdetection reservedslot
default null default null
newadmin default kick editspawn vip null reservedslot
newadmin default kick editspawn reservedslot
admin newadmin ban causeevents spawnboss spawnmob tp immunetokick kill admin newadmin ban causeevents spawnboss spawnmob tp immunetokick kill
trustedadmin admin ignorecheatdetection maintenance cfg cheat pvpfun ignorecheatdetection immunetoban ignoregriefdetection trustedadmin admin ignorecheatdetection maintenance cfg cheat pvpfun ignorecheatdetection immunetoban ignoregriefdetection