qbuf = sqlite3_mprintf("select * from dglusers where username like '%q' limit 1", tmpbuf);
- ret = sqlite3_open(USE_SQLITE_DB, &db); /* FIXME: use globalconfig->passwd? */
+ ret = sqlite3_open(globalconfig.passwd, &db);
if (ret) {
sqlite3_close(db);
debug_write("sqlite3_open failed");
qbuf = sqlite3_mprintf("update dglusers set username='%q', email='%q', env='%q', password='%q', flags=%li where id=%i", me->username, me->email, me->env, me->password, me->flags, me->id);
}
- ret = sqlite3_open(USE_SQLITE_DB, &db); /* FIXME: use globalconfig->passwd? */
+ ret = sqlite3_open(globalconfig.passwd, &db);
if (ret) {
sqlite3_close(db);
debug_write("writefile sqlite3_open failed");
if (!globalconfig.dglroot) globalconfig.dglroot = "/dgldir/";
if (!globalconfig.banner) globalconfig.banner = "/dgl-banner";
+#ifndef USE_SQLITE3
if (!globalconfig.passwd) globalconfig.passwd = "/dgl-login";
+#else
+ if (!globalconfig.passwd) globalconfig.passwd = USE_SQLITE_DB;
+#endif
if (!globalconfig.lockfile) globalconfig.lockfile = "/dgl-lock";
if (!globalconfig.shed_user && globalconfig.shed_uid == (uid_t)-1)
{
# For setting game idle time, use max_idle_time in the game DEFINE.
# menu_max_idle_time = 1024
-# The defaults are usually just fine for this. passwd refers to the file
-# that stores the user database, and lockfile is only used internally by
-# dgamelaunch.
-# passwd doesn't matter if dgl was compiled with SQLite, as the name of
-# the sqlite database will be defined at compile time.
-passwd = "/dgl-login"
-lockfile = "/dgl-lock"
+# Passwd refers to the file that stores the user database.
+# The default passwd file is "/dgl-login" for flat-text database, and for
+# sqlite, whatever value was defined for the sqlite database at compile time.
+#passwd = "/dgl-login"
+
+# Lockfile is used only when dgl was compiled without sqlite.
+#lockfile = "/dgl-lock"
#
# define some commands that are run when something happens. format is