cezarica Posted January 19, 2019 Share Posted January 19, 2019 Hi, can someone shed some light on a custom command to unban someone on a Linux dedicated server without having to stop the server and remove the line from blocklist.txt file? Link to comment https://forums.kleientertainment.com/forums/topic/101961-unban-command/ Share on other sites More sharing options...
Philip. Posted August 26, 2022 Share Posted August 26, 2022 -- customcommands.lua -- Returns a boolean depending on success of the operation. function c_unban(userid) if type(userid) ~= "string" then print("[Error] Missing #1 argument (userid).") return false end local blacklist = TheNet:GetBlacklist() for i, record in ipairs(blacklist) do if not record.empty and (record.userid == userid or record.netid == userid) then table.remove(blacklist, i) TheNet:SetBlacklist(blacklist) print(userid.." was removed from the blacklist.") return true end end print("[Error] "..userid.." not found.") return false end Here you go. A complete c_unban custom command. Works for both, Klei ID's and Steam ID's. Returns a boolean depending on success of the operation, so this can be used in some fancy automation scripts. No server restart is needed. The banned player can join immediately after this command is executed. blocklist.txt is updated as well. Use with care Link to comment https://forums.kleientertainment.com/forums/topic/101961-unban-command/#findComment-1595875 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now