From e462529596f8065119cbd038a952087c45bebf3a Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 26 Sep 2018 20:36:27 +0200 Subject: [PATCH] fix merge conflict choose sqlite as default database --- s/cmake-init | 5 +---- src/modules/autoseed.c | 11 +++++------ src/modules/autoseed.h | 1 - 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/s/cmake-init b/s/cmake-init index 337490f07..781db1ea7 100755 --- a/s/cmake-init +++ b/s/cmake-init @@ -1,10 +1,7 @@ #!/bin/sh ERESSEA_DB=db -if [ -e /usr/include/sqlite3.h ] ; then -ERESSEA_DB=sqlite -fi - +pkg-config --exists sqlite3 && ERESSEA_DB=sqlite # Parse command line arguments while [ ! -z "$1" ] ; do if [ "$1" = "--with-db" ] ; then diff --git a/src/modules/autoseed.c b/src/modules/autoseed.c index 2380e9bdd..88240d0b3 100644 --- a/src/modules/autoseed.c +++ b/src/modules/autoseed.c @@ -95,7 +95,7 @@ newfaction *read_newfactions(const char *filename) faction *f; char race[20], email[64], lang[8], password[16]; newfaction *nf, **nfi; - int alliance = 0, uid = 0; + int alliance = 0; if (fgets(buf, sizeof(buf), F) == NULL) break; @@ -103,8 +103,8 @@ newfaction *read_newfactions(const char *filename) email[0] = '\0'; password[0] = '\0'; - if (sscanf(buf, "%54s %19s %7s %15s %4d %4d", email, race, lang, - password, &uid, &alliance) < 3) { + if (sscanf(buf, "%54s %19s %7s %15s %4d", email, race, lang, + password, &alliance) < 3) { break; } if (email[0] == '#') { @@ -137,13 +137,12 @@ newfaction *read_newfactions(const char *filename) if (check_email(email) == 0) { nf->email = str_strdup(email); } else { - log_error("Invalid email address for subscription %s: %s\n", itoa36(uid), email); + log_error("Invalid email address for new faction: %s\n", email); free(nf); continue; } nf->password = str_strdup(password); nf->race = rc_find(race); - nf->uid = uid; if (alliances != NULL) { struct alliance *al = findalliance(alliance); if (al == NULL) { @@ -559,7 +558,7 @@ int autoseed(newfaction ** players, int nsize, int max_agediff) assert(r->land && r->units == 0); password = nextf->password ? nextf->password : itoa36(rng_int()); u = addplayer(r, addfaction(nextf->email, password, nextf->race, - nextf->lang, nextf)); + nextf->lang)); f = u->faction; fset(f, FFL_ISNEW); f->alliance = nextf->allies; diff --git a/src/modules/autoseed.h b/src/modules/autoseed.h index 74c7409ad..b78a2df55 100644 --- a/src/modules/autoseed.h +++ b/src/modules/autoseed.h @@ -24,7 +24,6 @@ extern "C" { char *password; const struct locale *lang; const struct race *race; - int uid; bool oldregions; struct alliance *allies; } newfaction;