mirror of
https://github.com/paxed/dgamelaunch.git
synced 2025-07-31 01:24:43 +02:00
Allow defining the login db in config file also when using sqlite.
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@628 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
a6ab367469
commit
bb5507b983
@ -2164,7 +2164,7 @@ userexist (char *cname, int isnew)
|
|||||||
|
|
||||||
qbuf = sqlite3_mprintf("select * from dglusers where username like '%q' limit 1", tmpbuf);
|
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) {
|
if (ret) {
|
||||||
sqlite3_close(db);
|
sqlite3_close(db);
|
||||||
debug_write("sqlite3_open failed");
|
debug_write("sqlite3_open failed");
|
||||||
@ -2352,7 +2352,7 @@ writefile (int requirenew)
|
|||||||
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);
|
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) {
|
if (ret) {
|
||||||
sqlite3_close(db);
|
sqlite3_close(db);
|
||||||
debug_write("writefile sqlite3_open failed");
|
debug_write("writefile sqlite3_open failed");
|
||||||
|
@ -807,7 +807,11 @@ create_config ()
|
|||||||
if (!globalconfig.dglroot) globalconfig.dglroot = "/dgldir/";
|
if (!globalconfig.dglroot) globalconfig.dglroot = "/dgldir/";
|
||||||
if (!globalconfig.banner) globalconfig.banner = "/dgl-banner";
|
if (!globalconfig.banner) globalconfig.banner = "/dgl-banner";
|
||||||
|
|
||||||
|
#ifndef USE_SQLITE3
|
||||||
if (!globalconfig.passwd) globalconfig.passwd = "/dgl-login";
|
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.lockfile) globalconfig.lockfile = "/dgl-lock";
|
||||||
if (!globalconfig.shed_user && globalconfig.shed_uid == (uid_t)-1)
|
if (!globalconfig.shed_user && globalconfig.shed_uid == (uid_t)-1)
|
||||||
{
|
{
|
||||||
|
@ -96,13 +96,13 @@ locale = "en_US.UTF-8"
|
|||||||
# For setting game idle time, use max_idle_time in the game DEFINE.
|
# For setting game idle time, use max_idle_time in the game DEFINE.
|
||||||
# menu_max_idle_time = 1024
|
# menu_max_idle_time = 1024
|
||||||
|
|
||||||
# The defaults are usually just fine for this. passwd refers to the file
|
# Passwd refers to the file that stores the user database.
|
||||||
# that stores the user database, and lockfile is only used internally by
|
# The default passwd file is "/dgl-login" for flat-text database, and for
|
||||||
# dgamelaunch.
|
# sqlite, whatever value was defined for the sqlite database at compile time.
|
||||||
# passwd doesn't matter if dgl was compiled with SQLite, as the name of
|
#passwd = "/dgl-login"
|
||||||
# the sqlite database will be defined at compile time.
|
|
||||||
passwd = "/dgl-login"
|
# Lockfile is used only when dgl was compiled without sqlite.
|
||||||
lockfile = "/dgl-lock"
|
#lockfile = "/dgl-lock"
|
||||||
|
|
||||||
#
|
#
|
||||||
# define some commands that are run when something happens. format is
|
# define some commands that are run when something happens. format is
|
||||||
|
Loading…
x
Reference in New Issue
Block a user