You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Cleanup console.lua code + small fixes
* Push tokenized commands to hook
* Change tokenized commands to hash table + clean up tokenization function
* Switch back to sequential + small optimization
* What is this symbol for?
* Change text a bit
---@returntable whitelist # Whitelist for specific commands, if empty, disregard whitelist and allow everything
40
50
localfunctiongetWhitelist(ply, cvar)
41
-
localwhitelist=(ply:GetInfo(cvar) or""):Trim()
51
+
localwhitelist={}
42
52
43
-
localwhitelistTbl= {}
44
-
45
-
fork, vinpairs(string.Split(whitelist, ",")) do
46
-
ifv~="" then
47
-
whitelistTbl[v] =true
53
+
for_, vinipairs(string.Split(string.Trim(ply:GetInfo(cvar)), ",")) do
54
+
ifv~="" then
55
+
whitelist[v] =true
48
56
end
49
57
end
50
58
51
-
returnwhitelistTbl
59
+
returnwhitelist
52
60
end
53
61
54
62
localfunctioncheckConCmd(self, cmd)
@@ -61,17 +69,18 @@ local function checkConCmd(self, cmd)
61
69
ifply:GetInfoNum("wire_expression2_concmd", 0) ==0thenreturnself:throw("Concmd is disabled through wire_expression2_concmd", false) end
62
70
ifIsConCommandBlocked(cmd) thenreturnself:throw("This concmd is blacklisted by gmod, see https://wiki.facepunch.com/gmod/Blocked_ConCommands", false) end
0 commit comments