mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2025-02-26 21:41:35 +00:00
Added possibility to disable database system
This commit is contained in:
parent
7484421845
commit
218dce31b8
1 changed files with 16 additions and 10 deletions
|
@ -23,10 +23,15 @@ local db = {}
|
||||||
|
|
||||||
local con
|
local con
|
||||||
|
|
||||||
|
function db.isconnected()
|
||||||
|
return (con ~= nil)
|
||||||
|
end
|
||||||
|
|
||||||
-- as this module serves as a wrapper/super class, we load the selected database
|
-- as this module serves as a wrapper/super class, we load the selected database
|
||||||
-- system in this function. might have to think of a better way to implement
|
-- system in this function. might have to think of a better way to implement
|
||||||
-- this, but it will suffice.
|
-- this, but it will suffice.
|
||||||
function db.oninit()
|
function db.oninit()
|
||||||
|
if settings.get("db_type") ~= "none" then
|
||||||
if settings.get("db_type") == "mysql" then
|
if settings.get("db_type") == "mysql" then
|
||||||
con = require "luascripts.wolfadmin.db.mysql"
|
con = require "luascripts.wolfadmin.db.mysql"
|
||||||
elseif settings.get("db_type") == "sqlite3" then
|
elseif settings.get("db_type") == "sqlite3" then
|
||||||
|
@ -39,6 +44,7 @@ function db.oninit()
|
||||||
|
|
||||||
db.start()
|
db.start()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
events.handle("onGameInit", db.oninit)
|
events.handle("onGameInit", db.oninit)
|
||||||
|
|
||||||
function db.onshutdown(restartMap)
|
function db.onshutdown(restartMap)
|
||||||
|
|
Loading…
Reference in a new issue