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
master
mckaygerhard 2024-04-01 00:14:38 -04:00
parent 6ffe2386e6
commit 5aba5f1f5b
1 changed files with 6 additions and 2 deletions

View File

@ -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