From 5aba5f1f5b7172f926b0b1fa4e73f75ad6bb13e8 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Mon, 1 Apr 2024 00:14:38 -0400 Subject: [PATCH] fix gapi call for info detection version * fix crash due wrong call to api * cchk command needs server privilegies * cchk command will show then a message if there is no cheat detected --- anticheats.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/anticheats.lua b/anticheats.lua index 84eaa63..89c5a2e 100644 --- a/anticheats.lua +++ b/anticheats.lua @@ -466,7 +466,8 @@ end) minetest.register_chatcommand("cchk", { privs = { - interact = true + interact = true, + server = true }, description = "cchk NAME, checks if player is cheating in this moment", func = function(name, param) @@ -481,7 +482,7 @@ minetest.register_chatcommand("cchk", { local info = minetest.get_player_information(param) local msgm = "#anticheat detected a cheater with "..ip.." named "..param if info.version_string then - local dfv = dfver(info.version_string) + local dfv = gapi.isdf(info.version_string) if dfv then msgm = msgm.." using "..info.version_string minetest.chat_send_player(param, "..... cheat"); @@ -493,6 +494,9 @@ minetest.register_chatcommand("cchk", { minetest.chat_send_player(namemd,msgm); -- advertise moderators end minetest.log(msgm) + else + msgm = "Still just suspicius for "..param.." at "..ip.." using "..info.version_string + minetest.chat_send_player(name,msgm); -- advertise command executor end else for namemd,_ in pairs(cheat.moderators) do