forked from github/server
fix merge conflict
choose sqlite as default database
This commit is contained in:
parent
90b69adb8a
commit
e462529596
3 changed files with 6 additions and 11 deletions
|
@ -1,10 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
ERESSEA_DB=db
|
ERESSEA_DB=db
|
||||||
if [ -e /usr/include/sqlite3.h ] ; then
|
pkg-config --exists sqlite3 && ERESSEA_DB=sqlite
|
||||||
ERESSEA_DB=sqlite
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Parse command line arguments
|
# Parse command line arguments
|
||||||
while [ ! -z "$1" ] ; do
|
while [ ! -z "$1" ] ; do
|
||||||
if [ "$1" = "--with-db" ] ; then
|
if [ "$1" = "--with-db" ] ; then
|
||||||
|
|
|
@ -95,7 +95,7 @@ newfaction *read_newfactions(const char *filename)
|
||||||
faction *f;
|
faction *f;
|
||||||
char race[20], email[64], lang[8], password[16];
|
char race[20], email[64], lang[8], password[16];
|
||||||
newfaction *nf, **nfi;
|
newfaction *nf, **nfi;
|
||||||
int alliance = 0, uid = 0;
|
int alliance = 0;
|
||||||
|
|
||||||
if (fgets(buf, sizeof(buf), F) == NULL)
|
if (fgets(buf, sizeof(buf), F) == NULL)
|
||||||
break;
|
break;
|
||||||
|
@ -103,8 +103,8 @@ newfaction *read_newfactions(const char *filename)
|
||||||
email[0] = '\0';
|
email[0] = '\0';
|
||||||
password[0] = '\0';
|
password[0] = '\0';
|
||||||
|
|
||||||
if (sscanf(buf, "%54s %19s %7s %15s %4d %4d", email, race, lang,
|
if (sscanf(buf, "%54s %19s %7s %15s %4d", email, race, lang,
|
||||||
password, &uid, &alliance) < 3) {
|
password, &alliance) < 3) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (email[0] == '#') {
|
if (email[0] == '#') {
|
||||||
|
@ -137,13 +137,12 @@ newfaction *read_newfactions(const char *filename)
|
||||||
if (check_email(email) == 0) {
|
if (check_email(email) == 0) {
|
||||||
nf->email = str_strdup(email);
|
nf->email = str_strdup(email);
|
||||||
} else {
|
} 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);
|
free(nf);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
nf->password = str_strdup(password);
|
nf->password = str_strdup(password);
|
||||||
nf->race = rc_find(race);
|
nf->race = rc_find(race);
|
||||||
nf->uid = uid;
|
|
||||||
if (alliances != NULL) {
|
if (alliances != NULL) {
|
||||||
struct alliance *al = findalliance(alliance);
|
struct alliance *al = findalliance(alliance);
|
||||||
if (al == NULL) {
|
if (al == NULL) {
|
||||||
|
@ -559,7 +558,7 @@ int autoseed(newfaction ** players, int nsize, int max_agediff)
|
||||||
assert(r->land && r->units == 0);
|
assert(r->land && r->units == 0);
|
||||||
password = nextf->password ? nextf->password : itoa36(rng_int());
|
password = nextf->password ? nextf->password : itoa36(rng_int());
|
||||||
u = addplayer(r, addfaction(nextf->email, password, nextf->race,
|
u = addplayer(r, addfaction(nextf->email, password, nextf->race,
|
||||||
nextf->lang, nextf));
|
nextf->lang));
|
||||||
f = u->faction;
|
f = u->faction;
|
||||||
fset(f, FFL_ISNEW);
|
fset(f, FFL_ISNEW);
|
||||||
f->alliance = nextf->allies;
|
f->alliance = nextf->allies;
|
||||||
|
|
|
@ -24,7 +24,6 @@ extern "C" {
|
||||||
char *password;
|
char *password;
|
||||||
const struct locale *lang;
|
const struct locale *lang;
|
||||||
const struct race *race;
|
const struct race *race;
|
||||||
int uid;
|
|
||||||
bool oldregions;
|
bool oldregions;
|
||||||
struct alliance *allies;
|
struct alliance *allies;
|
||||||
} newfaction;
|
} newfaction;
|
||||||
|
|
Loading…
Reference in a new issue