Dynamic loading of modules (fixes #71)

This commit is contained in:
Timo Smit 2017-01-18 15:35:24 +01:00
parent 7a93c4bfc9
commit cd4bf52aea
84 changed files with 423 additions and 388 deletions

View file

@ -15,16 +15,16 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local db = require "luamods.wolfadmin.db.db"
local db = require (wolfa_getLuaPath()..".db.db")
local players = require "luamods.wolfadmin.players.players"
-- local stats = require "luamods.wolfadmin.players.stats"
local players = require (wolfa_getLuaPath()..".players.players")
-- local stats = require (wolfa_getLuaPath()..".players.stats")
local constants = require "luamods.wolfadmin.util.constants"
local events = require "luamods.wolfadmin.util.events"
local files = require "luamods.wolfadmin.util.files"
local settings = require "luamods.wolfadmin.util.settings"
local util = require "luamods.wolfadmin.util.util"
local constants = require (wolfa_getLuaPath()..".util.constants")
local events = require (wolfa_getLuaPath()..".util.events")
local files = require (wolfa_getLuaPath()..".util.files")
local settings = require (wolfa_getLuaPath()..".util.settings")
local util = require (wolfa_getLuaPath()..".util.util")
local admin = {}

View file

@ -15,17 +15,17 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local constants = require "luamods.wolfadmin.util.constants"
local util = require "luamods.wolfadmin.util.util"
local bits = require "luamods.wolfadmin.util.bits"
local tables = require "luamods.wolfadmin.util.tables"
local events = require "luamods.wolfadmin.util.events"
local timers = require "luamods.wolfadmin.util.timers"
local settings = require "luamods.wolfadmin.util.settings"
local constants = require (wolfa_getLuaPath()..".util.constants")
local util = require (wolfa_getLuaPath()..".util.util")
local bits = require (wolfa_getLuaPath()..".util.bits")
local tables = require (wolfa_getLuaPath()..".util.tables")
local events = require (wolfa_getLuaPath()..".util.events")
local timers = require (wolfa_getLuaPath()..".util.timers")
local settings = require (wolfa_getLuaPath()..".util.settings")
local admin = require "luamods.wolfadmin.admin.admin"
local admin = require (wolfa_getLuaPath()..".admin.admin")
local teams = require "luamods.wolfadmin.game.teams"
local teams = require (wolfa_getLuaPath()..".game.teams")
local balancer = {}

View file

@ -15,12 +15,12 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local db = require "luamods.wolfadmin.db.db"
local db = require (wolfa_getLuaPath()..".db.db")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local events = require "luamods.wolfadmin.util.events"
local settings = require "luamods.wolfadmin.util.settings"
local events = require (wolfa_getLuaPath()..".util.events")
local settings = require (wolfa_getLuaPath()..".util.settings")
local bans = {}

View file

@ -15,12 +15,12 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local db = require "luamods.wolfadmin.db.db"
local db = require (wolfa_getLuaPath()..".db.db")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local events = require "luamods.wolfadmin.util.events"
local settings = require "luamods.wolfadmin.util.settings"
local events = require (wolfa_getLuaPath()..".util.events")
local settings = require (wolfa_getLuaPath()..".util.settings")
local history = {}

View file

@ -15,12 +15,12 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local db = require "luamods.wolfadmin.db.db"
local db = require (wolfa_getLuaPath()..".db.db")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local events = require "luamods.wolfadmin.util.events"
local timers = require "luamods.wolfadmin.util.timers"
local events = require (wolfa_getLuaPath()..".util.events")
local timers = require (wolfa_getLuaPath()..".util.timers")
local mutes = {}

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local events = require "luamods.wolfadmin.util.events"
local files = require "luamods.wolfadmin.util.files"
local settings = require "luamods.wolfadmin.util.settings"
local events = require (wolfa_getLuaPath()..".util.events")
local files = require (wolfa_getLuaPath()..".util.files")
local settings = require (wolfa_getLuaPath()..".util.settings")
local rules = {}

View file

@ -15,15 +15,15 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local db = require "luamods.wolfadmin.db.db"
local db = require (wolfa_getLuaPath()..".db.db")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local events = require "luamods.wolfadmin.util.events"
local files = require "luamods.wolfadmin.util.files"
local tables = require "luamods.wolfadmin.util.tables"
local events = require (wolfa_getLuaPath()..".util.events")
local files = require (wolfa_getLuaPath()..".util.files")
local tables = require (wolfa_getLuaPath()..".util.tables")
local acl = {}

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local events = require "luamods.wolfadmin.util.events"
local files = require "luamods.wolfadmin.util.files"
local settings = require "luamods.wolfadmin.util.settings"
local events = require (wolfa_getLuaPath()..".util.events")
local files = require (wolfa_getLuaPath()..".util.files")
local settings = require (wolfa_getLuaPath()..".util.settings")
local auth = {}
@ -114,9 +114,9 @@ auth.PERM_IMMUNE = "immune"
-- this, but it will suffice.
function auth.oninit()
if settings.get("g_standalone") == 1 then
srv = require "luamods.wolfadmin.auth.acl"
srv = require (wolfa_getLuaPath()..".auth.acl")
else
srv = require "luamods.wolfadmin.auth.shrubbot"
srv = require (wolfa_getLuaPath()..".auth.shrubbot")
end
if settings.get("g_standalone") == 1 and et.trap_Cvar_Get("g_shrubbot") ~= "" then

View file

@ -15,10 +15,10 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local events = require "luamods.wolfadmin.util.events"
local files = require "luamods.wolfadmin.util.files"
local events = require (wolfa_getLuaPath()..".util.events")
local files = require (wolfa_getLuaPath()..".util.files")
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local shrubbot = {}

View file

@ -15,13 +15,13 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local settings = require "luamods.wolfadmin.util.settings"
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandAdminTest(clientId, cmdArguments)
local level = auth.getlevel(clientId)

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local commands = require "luamods.wolfadmin.commands.commands"
local auth = require "luamods.wolfadmin.auth.auth"
local balancer = require "luamods.wolfadmin.admin.balancer"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local auth = require (wolfa_getLuaPath()..".auth.auth")
local balancer = require (wolfa_getLuaPath()..".admin.balancer")
function commandBalance(clientId, cmdArguments)
if cmdArguments[1] == "enable" then

View file

@ -15,15 +15,15 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local bans = require "luamods.wolfadmin.admin.bans"
local history = require "luamods.wolfadmin.admin.history"
local bans = require (wolfa_getLuaPath()..".admin.bans")
local history = require (wolfa_getLuaPath()..".admin.history")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local util = require "luamods.wolfadmin.util.util"
local settings = require "luamods.wolfadmin.util.settings"
local util = require (wolfa_getLuaPath()..".util.util")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandBan(clientId, cmdArguments)
if cmdArguments[1] == nil then

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local commands = require "luamods.wolfadmin.commands.commands"
local auth = require "luamods.wolfadmin.auth.auth"
local voting = require "luamods.wolfadmin.game.voting"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local auth = require (wolfa_getLuaPath()..".auth.auth")
local voting = require (wolfa_getLuaPath()..".game.voting")
function commandEnableVote(clientId, cmdArguments)
et.trap_SendConsoleCommand(et.EXEC_APPEND, "chat \"^denablevote: ^9next map voting has been enabled.\";")

View file

@ -15,14 +15,14 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local settings = require "luamods.wolfadmin.util.settings"
local util = require "luamods.wolfadmin.util.util"
local settings = require (wolfa_getLuaPath()..".util.settings")
local util = require (wolfa_getLuaPath()..".util.util")
function commandFinger(clientId, cmdArguments)
if cmdArguments[1] == nil then

View file

@ -15,13 +15,13 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local settings = require "luamods.wolfadmin.util.settings"
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandGib(clientId, cmdArguments)
if cmdArguments[1] == nil then

View file

@ -15,11 +15,11 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local util = require "luamods.wolfadmin.util.util"
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local settings = require "luamods.wolfadmin.util.settings"
local greetings = require "luamods.wolfadmin.players.greetings"
local util = require (wolfa_getLuaPath()..".util.util")
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local settings = require (wolfa_getLuaPath()..".util.settings")
local greetings = require (wolfa_getLuaPath()..".players.greetings")
function commandGreeting(clientId, cmdArguments)
local greeting = greetings.get(clientId)

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local settings = require "luamods.wolfadmin.util.settings"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandHelp(clientId, cmdArguments)
local cmds = commands.getadmin()

View file

@ -15,11 +15,11 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
function commandIncognito(clientId, cmdArguments)
local fileName = et.trap_Cvar_Get("g_shrubbot")

View file

@ -15,14 +15,14 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local admin = require "luamods.wolfadmin.admin.admin"
local history = require "luamods.wolfadmin.admin.history"
local admin = require (wolfa_getLuaPath()..".admin.admin")
local history = require (wolfa_getLuaPath()..".admin.history")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local settings = require "luamods.wolfadmin.util.settings"
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandKick(clientId, cmdArguments)
if cmdArguments[1] == nil then

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local bots = require "luamods.wolfadmin.game.bots"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local bots = require (wolfa_getLuaPath()..".game.bots")
function commandBotsOff(clientId, cmdArguments)
bots.enable(false)

View file

@ -15,17 +15,17 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local db = require "luamods.wolfadmin.db.db"
local db = require (wolfa_getLuaPath()..".db.db")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local pagination = require "luamods.wolfadmin.util.pagination"
local settings = require "luamods.wolfadmin.util.settings"
local util = require "luamods.wolfadmin.util.util"
local pagination = require (wolfa_getLuaPath()..".util.pagination")
local settings = require (wolfa_getLuaPath()..".util.settings")
local util = require (wolfa_getLuaPath()..".util.util")
function commandListAliases(clientId, cmdArguments)
if not db.isconnected() then

View file

@ -15,17 +15,17 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local db = require "luamods.wolfadmin.db.db"
local db = require (wolfa_getLuaPath()..".db.db")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local pagination = require "luamods.wolfadmin.util.pagination"
local settings = require "luamods.wolfadmin.util.settings"
local util = require "luamods.wolfadmin.util.util"
local pagination = require (wolfa_getLuaPath()..".util.pagination")
local settings = require (wolfa_getLuaPath()..".util.settings")
local util = require (wolfa_getLuaPath()..".util.util")
function commandListLevels(clientId, cmdArguments)
if cmdArguments[1] == nil then

View file

@ -15,10 +15,10 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local util = require "luamods.wolfadmin.util.util"
local commands = require "luamods.wolfadmin.commands.commands"
local game = require "luamods.wolfadmin.game.game"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local util = require (wolfa_getLuaPath()..".util.util")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local game = require (wolfa_getLuaPath()..".game.game")
function commandListMaps(clientId, cmdArguments)
local output = ""

View file

@ -15,18 +15,18 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local game = require "luamods.wolfadmin.game.game"
local fireteams = require "luamods.wolfadmin.game.fireteams"
local game = require (wolfa_getLuaPath()..".game.game")
local fireteams = require (wolfa_getLuaPath()..".game.fireteams")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local constants = require "luamods.wolfadmin.util.constants"
local settings = require "luamods.wolfadmin.util.settings"
local util = require "luamods.wolfadmin.util.util"
local constants = require (wolfa_getLuaPath()..".util.constants")
local settings = require (wolfa_getLuaPath()..".util.settings")
local util = require (wolfa_getLuaPath()..".util.util")
function commandListPlayers(clientId, cmdArguments)
local playersOnline = {}

View file

@ -15,15 +15,15 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local teams = require "luamods.wolfadmin.game.teams"
local teams = require (wolfa_getLuaPath()..".game.teams")
local util = require "luamods.wolfadmin.util.util"
local constants = require "luamods.wolfadmin.util.constants"
local settings = require "luamods.wolfadmin.util.settings"
local util = require (wolfa_getLuaPath()..".util.util")
local constants = require (wolfa_getLuaPath()..".util.constants")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandLock(clientId, cmdArguments)
if cmdArguments[1] == nil or (cmdArguments[1] ~= constants.TEAM_AXIS_SC and cmdArguments[1] ~= constants.TEAM_ALLIES_SC and cmdArguments[1] ~= constants.TEAM_SPECTATORS_SC and cmdArguments[1] ~= "all") then

View file

@ -15,18 +15,18 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local admin = require "luamods.wolfadmin.admin.admin"
local history = require "luamods.wolfadmin.admin.history"
local mutes = require "luamods.wolfadmin.admin.mutes"
local admin = require (wolfa_getLuaPath()..".admin.admin")
local history = require (wolfa_getLuaPath()..".admin.history")
local mutes = require (wolfa_getLuaPath()..".admin.mutes")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local util = require "luamods.wolfadmin.util.util"
local settings = require "luamods.wolfadmin.util.settings"
local util = require (wolfa_getLuaPath()..".util.util")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandMute(clientId, cmdArguments)
if cmdArguments[1] == nil then

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local bots = require "luamods.wolfadmin.game.bots"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local bots = require (wolfa_getLuaPath()..".game.bots")
function commandBotsOn(clientId, cmdArguments)
bots.enable(true)

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local settings = require "luamods.wolfadmin.util.settings"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandNextMap(clientId, cmdArguments)
et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dnextmap: ^9next map was loaded.\";")

View file

@ -15,10 +15,10 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local game = require "luamods.wolfadmin.game.game"
local settings = require "luamods.wolfadmin.util.settings"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local game = require (wolfa_getLuaPath()..".game.game")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandPause(clientId, cmdArguments)
et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dpause: ^9map paused.\";")

View file

@ -15,13 +15,13 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local util = require "luamods.wolfadmin.util.util"
local util = require (wolfa_getLuaPath()..".util.util")
function commandPlayerLock(clientId, cmdArguments)
if cmdArguments[1] == nil then

View file

@ -15,13 +15,13 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local util = require "luamods.wolfadmin.util.util"
local util = require (wolfa_getLuaPath()..".util.util")
function commandPlayerUnlock(clientId, cmdArguments)
if cmdArguments[1] == nil then

View file

@ -15,11 +15,11 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local admin = require "luamods.wolfadmin.admin.admin"
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local constants = require "luamods.wolfadmin.util.constants"
local util = require "luamods.wolfadmin.util.util"
local admin = require (wolfa_getLuaPath()..".admin.admin")
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local constants = require (wolfa_getLuaPath()..".util.constants")
local util = require (wolfa_getLuaPath()..".util.util")
function commandPlayerLock(clientId, cmdArguments)
if cmdArguments[2] == nil or (cmdArguments[2] ~= constants.TEAM_AXIS_SC and cmdArguments[2] ~= constants.TEAM_ALLIES_SC and cmdArguments[2] ~= constants.TEAM_SPECTATORS_SC) then

View file

@ -15,12 +15,12 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local constants = require "luamods.wolfadmin.util.constants"
local util = require "luamods.wolfadmin.util.util"
local balancer = require "luamods.wolfadmin.admin.balancer"
local commands = require "luamods.wolfadmin.commands.commands"
local bots = require "luamods.wolfadmin.game.bots"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local constants = require (wolfa_getLuaPath()..".util.constants")
local util = require (wolfa_getLuaPath()..".util.util")
local balancer = require (wolfa_getLuaPath()..".admin.balancer")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local bots = require (wolfa_getLuaPath()..".game.bots")
function commandPutBots(clientId, cmdArguments)
if cmdArguments[1] == nil and cmdArguments[1] ~= constants.TEAM_AXIS_SC and cmdArguments[1] ~= constants.TEAM_ALLIES_SC and cmdArguments[1] ~= constants.TEAM_SPECTATORS_SC then

View file

@ -15,11 +15,11 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local settings = require "luamods.wolfadmin.util.settings"
local commands = require "luamods.wolfadmin.commands.commands"
local rules = require "luamods.wolfadmin.admin.rules"
local greetings = require "luamods.wolfadmin.players.greetings"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local settings = require (wolfa_getLuaPath()..".util.settings")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local rules = require (wolfa_getLuaPath()..".admin.rules")
local greetings = require (wolfa_getLuaPath()..".players.greetings")
function commandReadconfig(clientId, cmdArguments)
settings.load()

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local settings = require "luamods.wolfadmin.util.settings"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandReset(clientId, cmdArguments)
et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dreset: ^9match reset.\";")

View file

@ -15,11 +15,11 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local db = require "luamods.wolfadmin.db.db"
local commands = require "luamods.wolfadmin.commands.commands"
local game = require "luamods.wolfadmin.game.game"
local sprees = require "luamods.wolfadmin.game.sprees"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local db = require (wolfa_getLuaPath()..".db.db")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local game = require (wolfa_getLuaPath()..".game.game")
local sprees = require (wolfa_getLuaPath()..".game.sprees")
function commandResetSprees(clientId, cmdArguments)
if not db.isconnected() then

View file

@ -15,10 +15,10 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local game = require "luamods.wolfadmin.game.game"
local settings = require "luamods.wolfadmin.util.settings"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local game = require (wolfa_getLuaPath()..".game.game")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandRestart(clientId, cmdArguments)
et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^drestart: ^9map restarted.\";")

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local rules = require "luamods.wolfadmin.admin.rules"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local rules = require (wolfa_getLuaPath()..".admin.rules")
function commandRules(clientId, cmdArguments)
if #cmdArguments == 0 then

View file

@ -15,11 +15,11 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local settings = require "luamods.wolfadmin.util.settings"
local db = require "luamods.wolfadmin.db.db"
local commands = require "luamods.wolfadmin.commands.commands"
local admin = require "luamods.wolfadmin.admin.admin"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local settings = require (wolfa_getLuaPath()..".util.settings")
local db = require (wolfa_getLuaPath()..".db.db")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local admin = require (wolfa_getLuaPath()..".admin.admin")
function commandSetLevel(clientId, cmdArguments)
if #cmdArguments < 2 then

View file

@ -15,17 +15,17 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local bans = require "luamods.wolfadmin.admin.bans"
local bans = require (wolfa_getLuaPath()..".admin.bans")
local db = require "luamods.wolfadmin.db.db"
local db = require (wolfa_getLuaPath()..".db.db")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local pagination = require "luamods.wolfadmin.util.pagination"
local settings = require "luamods.wolfadmin.util.settings"
local util = require "luamods.wolfadmin.util.util"
local pagination = require (wolfa_getLuaPath()..".util.pagination")
local settings = require (wolfa_getLuaPath()..".util.settings")
local util = require (wolfa_getLuaPath()..".util.util")
function commandShowBans(clientId, cmdArguments)
if not db.isconnected() then

View file

@ -15,17 +15,17 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local history = require "luamods.wolfadmin.admin.history"
local history = require (wolfa_getLuaPath()..".admin.history")
local db = require "luamods.wolfadmin.db.db"
local db = require (wolfa_getLuaPath()..".db.db")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local util = require "luamods.wolfadmin.util.util"
local pagination = require "luamods.wolfadmin.util.pagination"
local settings = require "luamods.wolfadmin.util.settings"
local util = require (wolfa_getLuaPath()..".util.util")
local pagination = require (wolfa_getLuaPath()..".util.pagination")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandListHistory(clientId, cmdArguments)
if settings.get("g_standalone") == 0 or not db.isconnected() then

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local settings = require "luamods.wolfadmin.util.settings"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandShuffle(clientId, cmdArguments)
et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dshuffle: ^9teams were shuffled.\";")

View file

@ -15,13 +15,13 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local settings = require "luamods.wolfadmin.util.settings"
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandSlap(clientId, cmdArguments)
if cmdArguments[1] == nil then

View file

@ -15,10 +15,10 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local db = require "luamods.wolfadmin.db.db"
local sprees = require "luamods.wolfadmin.game.sprees"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local db = require (wolfa_getLuaPath()..".db.db")
local sprees = require (wolfa_getLuaPath()..".game.sprees")
function commandShowSprees(clientId, cmdArguments)
if not db.isconnected() then

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local util = require "luamods.wolfadmin.util.util"
local commands = require "luamods.wolfadmin.commands.commands"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local util = require (wolfa_getLuaPath()..".util.util")
local commands = require (wolfa_getLuaPath()..".commands.commands")
function commandShowStats(clientId, cmdArguments)
if cmdArguments[1] == nil then

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local settings = require "luamods.wolfadmin.util.settings"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandSwap(clientId, cmdArguments)
et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dswap: ^9teams swapped.\";")

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local settings = require "luamods.wolfadmin.util.settings"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandTime(clientId, cmdArguments)
et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dtime: ^9current time is ^7"..os.date("%H:%M:%S").."^9.\";")

View file

@ -15,15 +15,15 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local bans = require "luamods.wolfadmin.admin.bans"
local bans = require (wolfa_getLuaPath()..".admin.bans")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local db = require "luamods.wolfadmin.db.db"
local db = require (wolfa_getLuaPath()..".db.db")
local settings = require "luamods.wolfadmin.util.settings"
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandRemoveBan(clientId, cmdArguments)
if settings.get("g_standalone") == 0 or not db.isconnected() then

View file

@ -15,15 +15,15 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local teams = require "luamods.wolfadmin.game.teams"
local teams = require (wolfa_getLuaPath()..".game.teams")
local util = require "luamods.wolfadmin.util.util"
local constants = require "luamods.wolfadmin.util.constants"
local settings = require "luamods.wolfadmin.util.settings"
local util = require (wolfa_getLuaPath()..".util.util")
local constants = require (wolfa_getLuaPath()..".util.constants")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandUnlock(clientId, cmdArguments)
if cmdArguments[1] == nil or (cmdArguments[1] ~= constants.TEAM_AXIS_SC and cmdArguments[1] ~= constants.TEAM_ALLIES_SC and cmdArguments[1] ~= constants.TEAM_SPECTATORS_SC and cmdArguments[1] ~= "all") then

View file

@ -15,15 +15,15 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local mutes = require "luamods.wolfadmin.admin.mutes"
local mutes = require (wolfa_getLuaPath()..".admin.mutes")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local settings = require "luamods.wolfadmin.util.settings"
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandUnmute(clientId, cmdArguments)
if cmdArguments[1] == nil then

View file

@ -15,10 +15,10 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local game = require "luamods.wolfadmin.game.game"
local settings = require "luamods.wolfadmin.util.settings"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
local game = require (wolfa_getLuaPath()..".game.game")
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandUnpause(clientId, cmdArguments)
et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dpause: ^9map unpaused.\";")

View file

@ -15,16 +15,16 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local history = require "luamods.wolfadmin.admin.history"
local mutes = require "luamods.wolfadmin.admin.mutes"
local history = require (wolfa_getLuaPath()..".admin.history")
local mutes = require (wolfa_getLuaPath()..".admin.mutes")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local util = require "luamods.wolfadmin.util.util"
local util = require (wolfa_getLuaPath()..".util.util")
function commandVoiceMute(clientId, cmdArguments)
if cmdArguments[1] == nil then

View file

@ -15,11 +15,11 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
function commandVoiceUnmute(clientId, cmdArguments)
if cmdArguments[1] == nil then

View file

@ -15,18 +15,18 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local admin = require "luamods.wolfadmin.admin.admin"
local history = require "luamods.wolfadmin.admin.history"
local admin = require (wolfa_getLuaPath()..".admin.admin")
local history = require (wolfa_getLuaPath()..".admin.history")
local db = require "luamods.wolfadmin.db.db"
local db = require (wolfa_getLuaPath()..".db.db")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local settings = require "luamods.wolfadmin.util.settings"
local settings = require (wolfa_getLuaPath()..".util.settings")
function commandWarn(clientId, cmdArguments)
if settings.get("g_warnHistory") == 0 or not db.isconnected() then

View file

@ -15,11 +15,11 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
function commandAdminChat(clientId, cmdArguments)
if #cmdArguments == 0 then

View file

@ -15,11 +15,11 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
function commandPersonalMessage(clientId, cmdArguments)
if #cmdArguments > 1 then

View file

@ -15,11 +15,11 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require "luamods.wolfadmin.commands.commands"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
function commandR(clientId, cmdArguments)
if #cmdArguments == 0 then

View file

@ -15,8 +15,8 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local commands = require "luamods.wolfadmin.commands.commands"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local commands = require (wolfa_getLuaPath()..".commands.commands")
function commandWolfAdmin(clientId, cmdArguments)
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^3This server is running ^7Wolf^1Admin ^7"..wolfa_getVersion().." ^3("..wolfa_getRelease().."^3)\";")

View file

@ -15,19 +15,19 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
require "luamods.wolfadmin.util.debug"
require (wolfa_getLuaPath()..".util.debug")
local admin = require "luamods.wolfadmin.admin.admin"
local admin = require (wolfa_getLuaPath()..".admin.admin")
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local teams = require "luamods.wolfadmin.game.teams"
local teams = require (wolfa_getLuaPath()..".game.teams")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local util = require "luamods.wolfadmin.util.util"
local events = require "luamods.wolfadmin.util.events"
local files = require "luamods.wolfadmin.util.files"
local util = require (wolfa_getLuaPath()..".util.util")
local events = require (wolfa_getLuaPath()..".util.events")
local files = require (wolfa_getLuaPath()..".util.files")
local commands = {}
@ -91,7 +91,7 @@ function commands.loadfiles(dir)
for _, file in pairs(files) do
if string.match(string.lower(file), "^[a-z]+%.lua$") then
require ("luamods.wolfadmin.commands."..dir.."."..string.sub(file, 1, string.len(file) - 4))
require (wolfa_getLuaPath()..".commands."..dir.."."..string.sub(file, 1, string.len(file) - 4))
amount = amount + 1
end

View file

@ -15,8 +15,8 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local commands = require "luamods.wolfadmin.commands.commands"
local util = require "luamods.wolfadmin.util.util"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local util = require (wolfa_getLuaPath()..".util.util")
function commandClientAnnounce(clientId, cmdArguments)
local clientId = tonumber(cmdArguments[1])

View file

@ -15,8 +15,8 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local commands = require "luamods.wolfadmin.commands.commands"
local util = require "luamods.wolfadmin.util.util"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local util = require (wolfa_getLuaPath()..".util.util")
function commandClientChatPrint(clientId, cmdArguments)
local clientId = tonumber(cmdArguments[1])

View file

@ -15,8 +15,8 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local commands = require "luamods.wolfadmin.commands.commands"
local util = require "luamods.wolfadmin.util.util"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local util = require (wolfa_getLuaPath()..".util.util")
function commandClientCenterPrint(clientId, cmdArguments)
local clientId = tonumber(cmdArguments[1])

View file

@ -15,8 +15,8 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local commands = require "luamods.wolfadmin.commands.commands"
local util = require "luamods.wolfadmin.util.util"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local util = require (wolfa_getLuaPath()..".util.util")
function commandClientCPM(clientId, cmdArguments)
local clientId = tonumber(cmdArguments[1])

View file

@ -15,8 +15,8 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local commands = require "luamods.wolfadmin.commands.commands"
local util = require "luamods.wolfadmin.util.util"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local util = require (wolfa_getLuaPath()..".util.util")
function commandClientPlayMusic(clientId, cmdArguments)
local clientId = tonumber(cmdArguments[1])

View file

@ -15,8 +15,8 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local commands = require "luamods.wolfadmin.commands.commands"
local util = require "luamods.wolfadmin.util.util"
local commands = require (wolfa_getLuaPath()..".commands.commands")
local util = require (wolfa_getLuaPath()..".util.util")
function commandClientConsolePrint(clientId, cmdArguments)
local clientId = tonumber(cmdArguments[1])

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local util = require "luamods.wolfadmin.util.util"
local events = require "luamods.wolfadmin.util.events"
local settings = require "luamods.wolfadmin.util.settings"
local util = require (wolfa_getLuaPath()..".util.util")
local events = require (wolfa_getLuaPath()..".util.events")
local settings = require (wolfa_getLuaPath()..".util.settings")
local db = {}
@ -28,9 +28,9 @@ local con
-- this, but it will suffice.
function db.oninit()
if settings.get("db_type") == "mysql" then
con = require "luamods.wolfadmin.db.mysql"
con = require (wolfa_getLuaPath()..".db.mysql")
elseif settings.get("db_type") == "sqlite3" then
con = require "luamods.wolfadmin.db.sqlite3"
con = require (wolfa_getLuaPath()..".db.sqlite3")
else
error("invalid database system (choose mysql, sqlite3)")
end

View file

@ -15,12 +15,12 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local constants = require "luamods.wolfadmin.util.constants"
local util = require "luamods.wolfadmin.util.util"
local settings = require "luamods.wolfadmin.util.settings"
local tables = require "luamods.wolfadmin.util.tables"
local constants = require (wolfa_getLuaPath()..".util.constants")
local util = require (wolfa_getLuaPath()..".util.util")
local settings = require (wolfa_getLuaPath()..".util.settings")
local tables = require (wolfa_getLuaPath()..".util.tables")
local luasql = require "luasql.mysql"

View file

@ -15,12 +15,12 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local constants = require "luamods.wolfadmin.util.constants"
local util = require "luamods.wolfadmin.util.util"
local settings = require "luamods.wolfadmin.util.settings"
local tables = require "luamods.wolfadmin.util.tables"
local constants = require (wolfa_getLuaPath()..".util.constants")
local util = require (wolfa_getLuaPath()..".util.util")
local settings = require (wolfa_getLuaPath()..".util.settings")
local tables = require (wolfa_getLuaPath()..".util.tables")
local luasql = require "luasql.sqlite3"

View file

@ -15,11 +15,11 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local events = require "luamods.wolfadmin.util.events"
local settings = require "luamods.wolfadmin.util.settings"
local util = require "luamods.wolfadmin.util.util"
local events = require (wolfa_getLuaPath()..".util.events")
local settings = require (wolfa_getLuaPath()..".util.settings")
local util = require (wolfa_getLuaPath()..".util.util")
local bots = {}

View file

@ -15,11 +15,11 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local teams = require "luamods.wolfadmin.game.teams"
local teams = require (wolfa_getLuaPath()..".game.teams")
local bits = require "luamods.wolfadmin.util.bits"
local constants = require "luamods.wolfadmin.util.constants"
local events = require "luamods.wolfadmin.util.events"
local bits = require (wolfa_getLuaPath()..".util.bits")
local constants = require (wolfa_getLuaPath()..".util.constants")
local events = require (wolfa_getLuaPath()..".util.events")
local fireteams = {}

View file

@ -15,11 +15,11 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local events = require "luamods.wolfadmin.util.events"
local settings = require "luamods.wolfadmin.util.settings"
local util = require "luamods.wolfadmin.util.util"
local events = require (wolfa_getLuaPath()..".util.events")
local settings = require (wolfa_getLuaPath()..".util.settings")
local util = require (wolfa_getLuaPath()..".util.util")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local game = {}

View file

@ -15,17 +15,17 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local db = require "luamods.wolfadmin.db.db"
local db = require (wolfa_getLuaPath()..".db.db")
local game = require "luamods.wolfadmin.game.game"
local game = require (wolfa_getLuaPath()..".game.game")
local players = require "luamods.wolfadmin.players.players"
-- local stats = require "luamods.wolfadmin.players.stats"
local players = require (wolfa_getLuaPath()..".players.players")
-- local stats = require (wolfa_getLuaPath()..".players.stats")
local constants = require "luamods.wolfadmin.util.constants"
local events = require "luamods.wolfadmin.util.events"
local files = require "luamods.wolfadmin.util.files"
local settings = require "luamods.wolfadmin.util.settings"
local constants = require (wolfa_getLuaPath()..".util.constants")
local events = require (wolfa_getLuaPath()..".util.events")
local files = require (wolfa_getLuaPath()..".util.files")
local settings = require (wolfa_getLuaPath()..".util.settings")
local sprees = {}

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local constants = require "luamods.wolfadmin.util.constants"
local tables = require "luamods.wolfadmin.util.tables"
local events = require "luamods.wolfadmin.util.events"
local constants = require (wolfa_getLuaPath()..".util.constants")
local tables = require (wolfa_getLuaPath()..".util.tables")
local events = require (wolfa_getLuaPath()..".util.events")
local teams = {}

View file

@ -15,13 +15,13 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local constants = require "luamods.wolfadmin.util.constants"
local util = require "luamods.wolfadmin.util.util"
local events = require "luamods.wolfadmin.util.events"
local timers = require "luamods.wolfadmin.util.timers"
local settings = require "luamods.wolfadmin.util.settings"
local bots = require "luamods.wolfadmin.game.bots"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local constants = require (wolfa_getLuaPath()..".util.constants")
local util = require (wolfa_getLuaPath()..".util.util")
local events = require (wolfa_getLuaPath()..".util.events")
local timers = require (wolfa_getLuaPath()..".util.timers")
local settings = require (wolfa_getLuaPath()..".util.settings")
local bots = require (wolfa_getLuaPath()..".game.bots")
local voting = {}

View file

@ -15,40 +15,39 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
require "luamods.wolfadmin.util.debug"
local constants
local util
local events
local timers
local settings
local constants = require "luamods.wolfadmin.util.constants"
local util = require "luamods.wolfadmin.util.util"
local events = require "luamods.wolfadmin.util.events"
local timers = require "luamods.wolfadmin.util.timers"
local settings = require "luamods.wolfadmin.util.settings"
local db
local db = require "luamods.wolfadmin.db.db"
local admin
local balancer
local bans
local history
local mutes
local rules
local admin = require "luamods.wolfadmin.admin.admin"
local balancer = require "luamods.wolfadmin.admin.balancer"
local bans = require "luamods.wolfadmin.admin.bans"
local history = require "luamods.wolfadmin.admin.history"
local mutes = require "luamods.wolfadmin.admin.mutes"
local rules = require "luamods.wolfadmin.admin.rules"
local commands
local commands = require "luamods.wolfadmin.commands.commands"
local game
local bots
local sprees
local teams
local voting
local game = require "luamods.wolfadmin.game.game"
local bots = require "luamods.wolfadmin.game.bots"
local sprees = require "luamods.wolfadmin.game.sprees"
local teams = require "luamods.wolfadmin.game.teams"
local voting = require "luamods.wolfadmin.game.voting"
local greetings = require "luamods.wolfadmin.players.greetings"
local players = require "luamods.wolfadmin.players.players"
local stats = require "luamods.wolfadmin.players.stats"
local greetings
local players
local stats
local version = "1.2.0-dev"
local release = "TBD"
local basepath = nil
local homepath = nil
local luapath = nil
-- game related data
local currentLevelTime = nil
@ -74,15 +73,51 @@ function wolfa_getHomePath()
return homepath
end
function wolfa_getLuaPath()
return luapath
end
function et_InitGame(levelTime, randomSeed, restartMap)
et.RegisterModname("WolfAdmin "..wolfa_getVersion())
outputDebug("Module "..wolfa_getVersion().." ("..wolfa_getRelease()..") loaded successfully. Created by Timo 'Timothy' Smit.")
et.trap_SendConsoleCommand(et.EXEC_APPEND, "sets mod_wolfadmin "..wolfa_getVersion()..";")
-- set up paths
basepath = string.gsub(et.trap_Cvar_Get("fs_basepath"), "\\", "/").."/"..et.trap_Cvar_Get("fs_game").."/"
homepath = string.gsub(et.trap_Cvar_Get("fs_homepath"), "\\", "/").."/"..et.trap_Cvar_Get("fs_game").."/"
luapath = string.gsub(debug.getinfo(1).source, "[\\/]", "."):sub(0, -10)
-- load modules
require (wolfa_getLuaPath()..".util.debug")
constants = require (wolfa_getLuaPath()..".util.constants")
util = require (wolfa_getLuaPath()..".util.util")
events = require (wolfa_getLuaPath()..".util.events")
timers = require (wolfa_getLuaPath()..".util.timers")
settings = require (wolfa_getLuaPath()..".util.settings")
db = require (wolfa_getLuaPath()..".db.db")
admin = require (wolfa_getLuaPath()..".admin.admin")
balancer = require (wolfa_getLuaPath()..".admin.balancer")
bans = require (wolfa_getLuaPath()..".admin.bans")
history = require (wolfa_getLuaPath()..".admin.history")
mutes = require (wolfa_getLuaPath()..".admin.mutes")
rules = require (wolfa_getLuaPath()..".admin.rules")
commands = require (wolfa_getLuaPath()..".commands.commands")
game = require (wolfa_getLuaPath()..".game.game")
bots = require (wolfa_getLuaPath()..".game.bots")
sprees = require (wolfa_getLuaPath()..".game.sprees")
teams = require (wolfa_getLuaPath()..".game.teams")
voting = require (wolfa_getLuaPath()..".game.voting")
greetings = require (wolfa_getLuaPath()..".players.greetings")
players = require (wolfa_getLuaPath()..".players.players")
stats = require (wolfa_getLuaPath()..".players.stats")
-- register the module
et.RegisterModname("WolfAdmin "..wolfa_getVersion())
et.trap_SendConsoleCommand(et.EXEC_APPEND, "sets mod_wolfadmin "..wolfa_getVersion()..";")
outputDebug("Module "..wolfa_getVersion().." ("..wolfa_getRelease()..") loaded successfully. Created by Timo 'Timothy' Smit.")
currentLevelTime = levelTime

View file

@ -15,15 +15,15 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local auth = require "luamods.wolfadmin.auth.auth"
local auth = require (wolfa_getLuaPath()..".auth.auth")
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local constants = require "luamods.wolfadmin.util.constants"
local util = require "luamods.wolfadmin.util.util"
local events = require "luamods.wolfadmin.util.events"
local settings = require "luamods.wolfadmin.util.settings"
local files = require "luamods.wolfadmin.util.files"
local constants = require (wolfa_getLuaPath()..".util.constants")
local util = require (wolfa_getLuaPath()..".util.util")
local events = require (wolfa_getLuaPath()..".util.events")
local settings = require (wolfa_getLuaPath()..".util.settings")
local files = require (wolfa_getLuaPath()..".util.files")
local greetings = {}

View file

@ -15,10 +15,10 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local db = require "luamods.wolfadmin.db.db"
local db = require (wolfa_getLuaPath()..".db.db")
local bits = require "luamods.wolfadmin.util.bits"
local events = require "luamods.wolfadmin.util.events"
local bits = require (wolfa_getLuaPath()..".util.bits")
local events = require (wolfa_getLuaPath()..".util.events")
local players = {}

View file

@ -15,7 +15,7 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local players = require "luamods.wolfadmin.players.players"
local players = require (wolfa_getLuaPath()..".players.players")
local stats = {}

View file

@ -15,9 +15,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local constants = require "luamods.wolfadmin.util.constants"
local util = require "luamods.wolfadmin.util.util"
local settings = require "luamods.wolfadmin.util.settings"
local constants = require (wolfa_getLuaPath()..".util.constants")
local util = require (wolfa_getLuaPath()..".util.util")
local settings = require (wolfa_getLuaPath()..".util.settings")
local SEVERITY_LEVELS = {
[1] = "^_", -- termination

View file

@ -15,8 +15,8 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local constants = require "luamods.wolfadmin.util.constants"
local util = require "luamods.wolfadmin.util.util"
local constants = require (wolfa_getLuaPath()..".util.constants")
local util = require (wolfa_getLuaPath()..".util.util")
local events = {}

View file

@ -15,8 +15,8 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local util = require "luamods.wolfadmin.util.util"
local settings = require "luamods.wolfadmin.util.settings"
local util = require (wolfa_getLuaPath()..".util.util")
local settings = require (wolfa_getLuaPath()..".util.settings")
local files = {}
@ -25,9 +25,9 @@ function files.ls(directory)
local entries = {}
if platform == "unix" then
command = 'ls -1 "'..wolfa_getBasePath()..'luamods/wolfadmin/'..directory..'"'
command = 'ls -1 "'..wolfa_getBasePath()..wolfa_getLuaPath():gsub("%.", "/").."/"..directory..'"'
elseif platform == "windows" then
command = 'dir "'..wolfa_getBasePath()..'luamods/wolfadmin/'..directory..'" /b'
command = 'dir "'..wolfa_getBasePath()..wolfa_getLuaPath():gsub("%.", "/").."/"..directory..'" /b'
end
for filename in io.popen(command):lines() do

View file

@ -15,8 +15,8 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local util = require "luamods.wolfadmin.util.util"
local events = require "luamods.wolfadmin.util.events"
local util = require (wolfa_getLuaPath()..".util.util")
local events = require (wolfa_getLuaPath()..".util.events")
local settings = {}
@ -73,7 +73,7 @@ function settings.load()
end
end
local files = require "luamods.wolfadmin.util.files"
local files = require (wolfa_getLuaPath()..".util.files")
local amount, array = files.loadCFG("wolfadmin.cfg", "[a-z]+", true)
for blocksname, settings in pairs(array) do

View file

@ -15,10 +15,10 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local constants = require "luamods.wolfadmin.util.constants"
local util = require "luamods.wolfadmin.util.util"
local events = require "luamods.wolfadmin.util.events"
local tables = require "luamods.wolfadmin.util.tables"
local constants = require (wolfa_getLuaPath()..".util.constants")
local util = require (wolfa_getLuaPath()..".util.util")
local events = require (wolfa_getLuaPath()..".util.events")
local tables = require (wolfa_getLuaPath()..".util.tables")
local timers = {}

View file

@ -15,7 +15,7 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
local constants = require "luamods.wolfadmin.util.constants"
local constants = require (wolfa_getLuaPath()..".util.constants")
local util = {}