Skip to content

Commit

Permalink
Fixed suspicious globals (fixes #75)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timo Smit committed Feb 21, 2017
1 parent a72f15b commit 2c32671
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/ban.lua
Expand Up @@ -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"].."\";")

Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/finger.lua
Expand Up @@ -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"].."\";")

Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/gib.lua
Expand Up @@ -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"].."\";")

Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/kick.lua
Expand Up @@ -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"].."\";")

Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/listaliases.lua
Expand Up @@ -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.\";")

Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/listlevels.lua
Expand Up @@ -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"].."\";")
Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/mute.lua
Expand Up @@ -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"].."\";")

Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/plock.lua
Expand Up @@ -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"].."\";")

Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/punlock.lua
Expand Up @@ -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"].."\";")

Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/put.lua
Expand Up @@ -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"].."\";")

Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/setlevel.lua
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/showhistory.lua
Expand Up @@ -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.\";")

Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/slap.lua
Expand Up @@ -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"].."\";")

Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/stats.lua
Expand Up @@ -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"].."\";")

Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/unmute.lua
Expand Up @@ -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"].."\";")

Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/vmute.lua
Expand Up @@ -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"].."\";")

Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/vunmute.lua
Expand Up @@ -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"].."\";")

Expand Down
2 changes: 2 additions & 0 deletions luamods/wolfadmin/commands/admin/warn.lua
Expand Up @@ -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
Expand Down

0 comments on commit 2c32671

Please sign in to comment.