Added autodetection of standalone mode (refs #61)

This commit is contained in:
Timo Smit 2018-02-16 12:49:00 +01:00
parent de27a4172b
commit 27986cbf7a
2 changed files with 15 additions and 1 deletions

View file

@ -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]

View file

@ -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()