Changed hack detection to allow future permissions overrides, now prevents hack clients modding max hp while online.
This commit is contained in:
parent
456a7eb4bc
commit
34efba9c1f
16 changed files with 16 additions and 37 deletions
|
|
@ -16,7 +16,6 @@ You should have received a copy of the GNU General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using MySql.Data.MySqlClient;
|
||||
|
|
|
|||
|
|
@ -18,9 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
using System;
|
||||
using System.Data;
|
||||
|
||||
using MySql.Data.MySqlClient;
|
||||
using Terraria;
|
||||
|
||||
namespace TShockAPI.DB
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,13 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
using MySql.Data.MySqlClient;
|
||||
using Terraria;
|
||||
|
||||
namespace TShockAPI.DB
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using MySql.Data.MySqlClient;
|
||||
|
||||
namespace TShockAPI.DB
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System.Data;
|
||||
using MySql.Data.MySqlClient;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TShockAPI.DB
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace TShockAPI
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace TShockAPI.Extensions
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace TShockAPI
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
|
@ -25,7 +24,6 @@ using Terraria;
|
|||
|
||||
using TShockAPI.Net;
|
||||
using System.IO.Streams;
|
||||
using System.Net;
|
||||
|
||||
namespace TShockAPI
|
||||
{
|
||||
|
|
@ -159,9 +157,12 @@ namespace TShockAPI
|
|||
int cur = args.Data.ReadInt16();
|
||||
int max = args.Data.ReadInt16();
|
||||
|
||||
if (cur > 500 || max > 500)
|
||||
if (args.Player.FirstMaxHP == 0)
|
||||
args.Player.FirstMaxHP = max;
|
||||
|
||||
if (max > 400 && max > args.Player.FirstMaxHP)
|
||||
{
|
||||
TShock.Utils.ForceKick(args.Player, "You have Hacked Health/Mana, Please use a different character.");
|
||||
TShock.Utils.ForceKick(args.Player, "Hacked Client Detected.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -179,9 +180,13 @@ namespace TShockAPI
|
|||
int cur = args.Data.ReadInt16();
|
||||
int max = args.Data.ReadInt16();
|
||||
|
||||
if (cur > 500 || max > 500)
|
||||
if (args.Player.FirstMaxMP == 0)
|
||||
args.Player.FirstMaxMP = max;
|
||||
|
||||
if (max > 400 && max > args.Player.FirstMaxMP)
|
||||
{
|
||||
TShock.Utils.ForceKick(args.Player, "You have Hacked Health/Mana, Please use a different character.");
|
||||
TShock.Utils.ForceKick(args.Player, "Hacked Client Detected.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
@ -334,7 +339,7 @@ namespace TShockAPI
|
|||
if (TShock.Utils.ActivePlayers() + 1 > TShock.Config.MaxSlots && !args.Player.Group.HasPermission(Permissions.reservedslot))
|
||||
{
|
||||
TShock.Utils.ForceKick(args.Player, TShock.Config.ServerFullReason);
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
NetMessage.SendData((int)PacketTypes.TimeSet, -1, -1, "", 0, 0, Main.sunModY, Main.moonModY);
|
||||
|
|
@ -352,6 +357,8 @@ namespace TShockAPI
|
|||
|
||||
if (TShock.Config.DisplayIPToAdmins)
|
||||
TShock.Utils.SendLogs(string.Format("{0} has joined. IP: {1}", args.Player.Name, args.Player.IP), Color.Blue);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool HandleSendTileSquare(GetDataHandlerArgs args)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO.Streams;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace TShockAPI.Net
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using HttpServer;
|
||||
using Rests;
|
||||
using Terraria;
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using HttpServer;
|
||||
using TShockAPI;
|
||||
|
||||
namespace Rests
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Terraria;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ namespace TShockAPI
|
|||
public int ProjectileThreshold { get; set; }
|
||||
public Dictionary<Vector2, Tile> TilesDestroyed { get; protected set; }
|
||||
public Dictionary<Vector2, Tile> TilesCreated { get; protected set; }
|
||||
public bool SyncHP { get; set; }
|
||||
public bool SyncMP { get; set; }
|
||||
public int FirstMaxHP { get; set; }
|
||||
public int FirstMaxMP { get; set; }
|
||||
public Group Group { get; set; }
|
||||
public bool ReceivedInfo { get; set; }
|
||||
public int Index { get; protected set; }
|
||||
|
|
|
|||
|
|
@ -32,12 +32,10 @@ using System.Diagnostics;
|
|||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using Mono.Data.Sqlite;
|
||||
using Hooks;
|
||||
using MySql.Data.MySqlClient;
|
||||
using Newtonsoft.Json;
|
||||
using Rests;
|
||||
using Terraria;
|
||||
using TShockAPI.DB;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue