Skip to content

Commit

Permalink
Added autodetection of standalone mode (refs #61)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timo Smit committed Feb 16, 2018
1 parent de27a41 commit 27986cb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/wolfadmin.toml
Expand Up @@ -4,8 +4,9 @@
# http://dev.timosmit.com/wolfadmin/configuration.html

[main]
# uncomment if you need to override these settings
# os = "unix"
standalone = 1
# standalone = 1
debug = 0

[db]
Expand Down
13 changes: 13 additions & 0 deletions luamods/wolfadmin/util/settings.lua
Expand Up @@ -174,6 +174,19 @@ function settings.load()
if not (platform == "unix" or platform == "windows") then
settings.set("sv_os", settings.determineOS())
end

local mod = et.trap_Cvar_Get("fs_game")
local shrubbot = et.trap_Cvar_Get("g_shrubbot") -- etpub, nq
local dbDir = et.trap_Cvar_Get("g_dbDirectory") -- silent
if mod == "legacy" or mod == "etpro" then
settings.set("g_standalone", 1)
elseif (not shrubbot or shrubbot == "") and (not dbDir or dbDir == "") then
settings.set("g_standalone", 1)
else
settings.set("g_standalone", 0)
end

outputDebug("WolfAdmin running in "..(settings.get("g_standalone") == 1 and "standalone" or "add-on").." mode.")
end

function settings.determineOS()
Expand Down

0 comments on commit 27986cb

Please sign in to comment.