Seems like a pretty fragile system, just have the “cheater” log the triggers and it has all the code or simply register the trigger resourceName:get and it has all the source code.
Anything that leaves the server by nature can be “logged,” so it doesn’t make too much sense as a “security” system.
Don’t take this comment as an insult but as constructive critique, i simply want you to see where the problems might be
When the player is connected, the code will run only once and one-time validations cannot send a request to the trigger again and validate the code because user[src] = true. so what you said is impossible, i thought it is impossible, don’t worry and he needs to make a special module to see the codes.
local user = {}
RegisterServerEvent(name..":send", function()
local src = source
if not user[src] then
TriggerClientEvent(name..":get", src, write)
user[src] = true
else
print('CONNECT TRIGGER OR BANNING SCRIPT DOES NOT LOAD')
end
end)
and
RegisterNetEvent(name..":get")
AddEventHandler(name..":get", function(scripts)
if start then return end
TriggerEvent("esx:showNotification", "~g~Client side loaded")
for k,v in pairs(scripts) do
local loaded, err = load(v)
if loaded then
loaded()
else
print("Derleme Hatası:", err)
end
Citizen.Wait(10)
end
start = true
end)
If you noticed that if start is true at first, if a request is made to the trigger, it returns and cannot see the code.
in your code there is a timespan of 700ms to inject and log the event, enough to steal the whole thing, and anyway in many injectors there is a function to log trigger parameters, consequently read the whole code
Example of a code that can grab the script code
RegisterNetEvent(name..":get", function(scripts)
for k,v in pairs(scripts) do
print(k, v)
end
end)
All it takes is these little lines and good timing, and with any injector you can manage to “dump” the whole thing
never cant hide anything but this is an easy code logger good way I’m thinking of using network timer to send it to the server and server cipher that uses something like xor and with that time as a key and decipher using that so the still data hidden maybe I will make PR on this so normally no one cant find tame timer in that time or network and we still have better way like can automate whole prosses
I understand that there are simple ways to do this, I will look into it. It is possible to return the print loop or prohibit using it, so that the person cannot see the code, it is entirely up to the person to protect it like test = print, but I have no tricks. I can’t test it, if anyone wants to update it, I will update it on github