Griefing != Cheating

This commit is contained in:
Maverick Motherfucker 2011-06-02 22:24:43 -07:00
parent 818348a445
commit f5a76dd154
3 changed files with 35 additions and 8 deletions

View file

@ -15,8 +15,10 @@ namespace TShockAPI
public bool EnableWhitelist = false;
public bool InfiniteInvasion = false;
public bool AlwaysPvP = false;
public bool KickSaveEditors = true;
public bool BanSaveEditors = true;
public bool KickCheaters = true;
public bool BanCheaters = true;
public bool KickGriefers = true;
public bool BanGriefers = true;
public bool BanKillTileAbusers = false;
public bool KickKillTileAbusers = false;
}

View file

@ -23,6 +23,8 @@ namespace TShockAPI
public static bool startedInvasion = false;
public static bool kickCheater = true;
public static bool banCheater = true;
public static bool kickGriefer = true;
public static bool banGriefer = true;
public static bool banTnt = false;
public static bool kickTnt = false;
public enum NPCList : int
@ -45,8 +47,10 @@ namespace TShockAPI
enableWhitelist = cfg.EnableWhitelist;
infiniteInvasion = cfg.InfiniteInvasion;
permaPvp = cfg.AlwaysPvP;
kickCheater = cfg.KickSaveEditors;
banCheater = cfg.BanSaveEditors;
kickCheater = cfg.KickCheaters;
banCheater = cfg.BanCheaters;
kickGriefer = cfg.KickGriefers;
banGriefer = cfg.BanGriefers;
banTnt = cfg.BanKillTileAbusers;
kickTnt = cfg.KickKillTileAbusers;
}
@ -70,8 +74,10 @@ namespace TShockAPI
cfg.EnableWhitelist = false;
cfg.InfiniteInvasion = false;
cfg.AlwaysPvP = false;
cfg.KickSaveEditors = false;
cfg.BanSaveEditors = false;
cfg.KickCheaters = kickCheater;
cfg.BanCheaters = banCheater;
cfg.KickGriefers = kickGriefer;
cfg.BanGriefers = banGriefer;
cfg.BanKillTileAbusers = true;
cfg.KickKillTileAbusers = true;

View file

@ -219,7 +219,7 @@ namespace TShockAPI
}
/// <summary>
/// Determines what to do with someone listed in cheaters.txt
/// Adds someone to cheaters.txt
/// </summary>
/// <param name="ply">int player</param>
public static void HandleCheater(int ply)
@ -229,7 +229,6 @@ namespace TShockAPI
string cheater = Tools.FindPlayer(ply);
string ip = Tools.GetRealIP(Convert.ToString(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint));
FileTools.WriteGrief(ply);
FileTools.WriteCheater(ply);
if (!ConfigurationManager.kickCheater) { return; }
Netplay.serverSock[ply].kill = true;
@ -238,6 +237,26 @@ namespace TShockAPI
Tools.Broadcast(cheater + " was " + (ConfigurationManager.banCheater ? "banned " : "kicked ") + "for cheating.");
}
}
/// <summary>
/// Adds someone to greifers.txt
/// </summary>
/// <param name="ply">int player</param>
public static void HandleGreifer(int ply)
{
if (!TShock.players[ply].IsAdmin())
{
string cheater = Tools.FindPlayer(ply);
string ip = Tools.GetRealIP(Convert.ToString(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint));
FileTools.WriteGrief(ply);
if (!ConfigurationManager.kickGriefer) { return; }
Netplay.serverSock[ply].kill = true;
Netplay.serverSock[ply].Reset();
NetMessage.syncPlayers();
Tools.Broadcast(cheater + " was " + (ConfigurationManager.banCheater ? "banned " : "kicked ") + "for greifing.");
}
}
/// <summary>
/// Shows a MOTD to the player
/// </summary>