Skip to content

Commit

Permalink
Prevent c1k's mod from deleting us
Browse files Browse the repository at this point in the history
This is necessary because the way c1k's mod handles a newer version being installed alongside the one that is embedded is incompatible with the advice the error message the server provides upon a protocol mismatch. This is a problem because the error message is very general and is the preferred way to activate a version that is newer than the bundled one, so it should be correct for all mods.

We can either choose to not support mods that don't conform, or conform to these mods ourselves...
  • Loading branch information
LBPHacker committed Jul 17, 2022
1 parent c2a022b commit 7ad75ca
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tptmp/client/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@ local function run()
return
end

-- * Prevent c1k's mod from deleting us.
if tpt.version.modid == 6 then
local protect_from_malware = {
[ "scripts/downloaded/2 LBPHacker-TPTMulti.lua" ] = true,
[ "scripts/downloaded/219 Maticzpl-Notifications.lua" ] = true,
}

local real_remove = os.remove
function os.remove(path)
if path and protect_from_malware[path] then
return nil, "malware :/"
end
return real_remove(path)
end
end

local hooks_enabled = false
local window_status = "hidden"
local window_hide_mode = "hidden"
Expand Down

0 comments on commit 7ad75ca

Please sign in to comment.