SQL fallback to users.ini

This commit is contained in:
David Anderson 2004-09-08 18:34:48 +00:00
parent 39cb15cc56
commit 08682ab378

View File

@ -113,7 +113,6 @@ public plugin_cfg() {
server_cmd("exec %s",configFile) server_cmd("exec %s",configFile)
} }
#if !defined USING_SQL
loadSettings(szFilename[]) { loadSettings(szFilename[]) {
if (!file_exists(szFilename)) return 0 if (!file_exists(szFilename)) return 0
@ -138,7 +137,6 @@ loadSettings(szFilename[]) {
return 1 return 1
} }
#endif
#if defined USING_SQL #if defined USING_SQL
public adminSql() { public adminSql() {
@ -152,6 +150,13 @@ public adminSql() {
new Sql:sql = dbi_connect(host,user,pass,db,error,127) new Sql:sql = dbi_connect(host,user,pass,db,error,127)
if (sql <= SQL_FAILED) { if (sql <= SQL_FAILED) {
server_print("[AMXX] %L",LANG_SERVER,"SQL_CANT_CON",error) server_print("[AMXX] %L",LANG_SERVER,"SQL_CANT_CON",error)
//backup to users.ini
new configsDir[64]
get_configsdir(configsDir, 63)
format(configsDir, 63, "%s/users.ini", configsDir)
loadSettings(configsDir) // Load admins accounts
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }