Fixed suspicious globals (fixes #75)

This commit is contained in:
Timo Smit 2017-02-21 10:44:14 +01:00
parent a72f15b058
commit 2c32671304
18 changed files with 36 additions and 0 deletions

View file

@ -26,6 +26,8 @@ local util = require (wolfa_getLuaPath()..".util.util")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandBan(clientId, command, victim, ...)
local cmdClient
if victim == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dban usage: "..commands.getadmin("ban")["syntax"].."\";")

View file

@ -24,6 +24,8 @@ local players = require (wolfa_getLuaPath()..".players.players")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandFinger(clientId, command, victim)
local cmdClient
if victim == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dfinger usage: "..commands.getadmin("finger")["syntax"].."\";")

View file

@ -24,6 +24,8 @@ local players = require (wolfa_getLuaPath()..".players.players")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandGib(clientId, command, victim)
local cmdClient
if victim == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dgib usage: "..commands.getadmin("gib")["syntax"].."\";")

View file

@ -25,6 +25,8 @@ local commands = require (wolfa_getLuaPath()..".commands.commands")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandKick(clientId, command, victim, ...)
local cmdClient
if victim == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dkick usage: "..commands.getadmin("kick")["syntax"].."\";")

View file

@ -27,6 +27,8 @@ local pagination = require (wolfa_getLuaPath()..".util.pagination")
local util = require (wolfa_getLuaPath()..".util.util")
function commandListAliases(clientId, command, victim, offset)
local cmdClient
if not db.isconnected() then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dlistaliases: ^9alias history is disabled.\";")

View file

@ -28,6 +28,8 @@ local settings = require (wolfa_getLuaPath()..".util.settings")
local util = require (wolfa_getLuaPath()..".util.util")
function commandListLevels(clientId, command, victim, offset)
local cmdClient
if victim == nil then
if settings.get("g_standalone") ~= 0 then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dlistlevels usage: "..commands.getadmin("listlevels")["syntax"].."\";")

View file

@ -28,6 +28,8 @@ local util = require (wolfa_getLuaPath()..".util.util")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandMute(clientId, command, victim, ...)
local cmdClient
if victim == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dmute usage: "..commands.getadmin("mute")["syntax"].."\";")

View file

@ -22,6 +22,8 @@ local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require (wolfa_getLuaPath()..".players.players")
function commandPlayerLock(clientId, command, victim)
local cmdClient
if victim == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dplock usage: "..commands.getadmin("plock")["syntax"].."\";")

View file

@ -22,6 +22,8 @@ local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require (wolfa_getLuaPath()..".players.players")
function commandPlayerUnlock(clientId, command, victim)
local cmdClient
if victim == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dpunlock usage: "..commands.getadmin("punlock")["syntax"].."\";")

View file

@ -26,6 +26,8 @@ local constants = require (wolfa_getLuaPath()..".util.constants")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandPlayerLock(clientId, command, victim, team)
local cmdClient
if victim == nil or team == nil or (team ~= constants.TEAM_AXIS_SC and team ~= constants.TEAM_ALLIES_SC and team ~= constants.TEAM_SPECTATORS_SC) then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dput usage: "..commands.getadmin("put")["syntax"].."\";")

View file

@ -26,6 +26,8 @@ local commands = require (wolfa_getLuaPath()..".commands.commands")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandSetLevel(clientId, command, victim, level)
local cmdClient
if not victim or not level then
return false
elseif tonumber(victim) == nil or tonumber(victim) < 0 or tonumber(victim) > tonumber(et.trap_Cvar_Get("sv_maxclients")) then

View file

@ -28,6 +28,8 @@ local pagination = require (wolfa_getLuaPath()..".util.pagination")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandListHistory(clientId, command, victim, offset)
local cmdClient
if not db.isconnected() or settings.get("g_playerHistory") == 0 then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dshowhistory: ^9player history is disabled.\";")

View file

@ -24,6 +24,8 @@ local players = require (wolfa_getLuaPath()..".players.players")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandSlap(clientId, command, victim)
local cmdClient
if victim == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dslap usage: "..commands.getadmin("slap")["syntax"].."\";")

View file

@ -22,6 +22,8 @@ local commands = require (wolfa_getLuaPath()..".commands.commands")
local util = require (wolfa_getLuaPath()..".util.util")
function commandShowStats(clientId, command, victim)
local cmdClient
if victim == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dstats usage: "..commands.getadmin("stats")["syntax"].."\";")

View file

@ -26,6 +26,8 @@ local players = require (wolfa_getLuaPath()..".players.players")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandUnmute(clientId, command, victim)
local cmdClient
if victim == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dunmute usage: "..commands.getadmin("unmute")["syntax"].."\";")

View file

@ -27,6 +27,8 @@ local players = require (wolfa_getLuaPath()..".players.players")
local util = require (wolfa_getLuaPath()..".util.util")
function commandVoiceMute(clientId, command, victim, ...)
local cmdClient
if victim == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dvmute usage: "..commands.getadmin("vmute")["syntax"].."\";")

View file

@ -22,6 +22,8 @@ local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require (wolfa_getLuaPath()..".players.players")
function commandVoiceUnmute(clientId, command, victim)
local cmdClient
if victim == nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dvunmute usage: "..commands.getadmin("vunmute")["syntax"].."\";")

View file

@ -28,6 +28,8 @@ local players = require (wolfa_getLuaPath()..".players.players")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandWarn(clientId, command, victim, ...)
local cmdClient
if not db.isconnected() or settings.get("g_playerHistory") == 0 then
return false
elseif not victim or not ... then