forked from github/server
remove the fallback password.
This commit is contained in:
parent
3660c47afb
commit
6412d3bbf8
|
@ -1446,26 +1446,20 @@ static void remove_idle_players(void)
|
||||||
destroyfaction(f);
|
destroyfaction(f);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (fval(f, FFL_OVERRIDE)) {
|
|
||||||
free(f->override);
|
|
||||||
f->override = _strdup(itoa36(rng_int()));
|
|
||||||
freset(f, FFL_OVERRIDE);
|
|
||||||
}
|
|
||||||
if (turn != f->lastorders) {
|
if (turn != f->lastorders) {
|
||||||
char info[256];
|
char info[256];
|
||||||
sprintf(info, "%d Einheiten, %d Personen, %d Silber",
|
sprintf(info, "%d Einheiten, %d Personen, %d Silber",
|
||||||
f->no_units, f->num_total, f->money);
|
f->no_units, f->num_total, f->money);
|
||||||
if (f->subscription) {
|
if (f->subscription) {
|
||||||
sql_print(
|
sql_print(
|
||||||
("UPDATE subscriptions SET lastturn=%d, password='%s', info='%s' WHERE id=%u;\n",
|
("UPDATE subscriptions SET lastturn=%d, info='%s' WHERE id=%u;\n",
|
||||||
f->lastorders, f->override, info, f->subscription));
|
f->lastorders, info, f->subscription));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (f->subscription) {
|
if (f->subscription) {
|
||||||
sql_print(
|
sql_print(
|
||||||
("UPDATE subscriptions SET status='ACTIVE', lastturn=%d, firstturn=greatest(firstturn,%d), password='%s' WHERE id=%u;\n",
|
("UPDATE subscriptions SET status='ACTIVE', lastturn=%d, firstturn=greatest(firstturn,%d) WHERE id=%u;\n",
|
||||||
f->lastorders, f->lastorders - f->age, f->override,
|
f->lastorders, f->lastorders - f->age, f->subscription));
|
||||||
f->subscription));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2408,7 +2402,6 @@ int password_cmd(unit * u, struct order *ord)
|
||||||
} else {
|
} else {
|
||||||
u->faction->passw = _strdup(pwbuf);
|
u->faction->passw = _strdup(pwbuf);
|
||||||
}
|
}
|
||||||
fset(u->faction, FFL_OVERRIDE);
|
|
||||||
ADDMSG(&u->faction->msgs, msg_message("changepasswd",
|
ADDMSG(&u->faction->msgs, msg_message("changepasswd",
|
||||||
"value", u->faction->passw));
|
"value", u->faction->passw));
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -4675,8 +4668,8 @@ int writepasswd(void)
|
||||||
log_info("writing passwords...");
|
log_info("writing passwords...");
|
||||||
|
|
||||||
for (f = factions; f; f = f->next) {
|
for (f = factions; f; f = f->next) {
|
||||||
fprintf(F, "%s:%s:%s:%s:%u\n",
|
fprintf(F, "%s:%s:%s:%u\n",
|
||||||
factionid(f), f->email, f->passw, f->override, f->subscription);
|
factionid(f), f->email, f->passw, f->subscription);
|
||||||
}
|
}
|
||||||
fclose(F);
|
fclose(F);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -4711,9 +4704,8 @@ void update_subscriptions(void)
|
||||||
sprintf(zText, "subscriptions.%u", turn);
|
sprintf(zText, "subscriptions.%u", turn);
|
||||||
F = fopen(zText, "w");
|
F = fopen(zText, "w");
|
||||||
for (f = factions; f != NULL; f = f->next) {
|
for (f = factions; f != NULL; f = f->next) {
|
||||||
fprintf(F, "%s:%u:%s:%s:%s:%u:\n",
|
fprintf(F, "%s:%u:%s:%s:%u:\n",
|
||||||
itoa36(f->no), f->subscription, f->email, f->override,
|
itoa36(f->no), f->subscription, f->email, dbrace(f->race), f->lastorders);
|
||||||
dbrace(f->race), f->lastorders);
|
|
||||||
}
|
}
|
||||||
fclose(F);
|
fclose(F);
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,6 @@ void free_faction(faction * f)
|
||||||
free(f->email);
|
free(f->email);
|
||||||
free(f->banner);
|
free(f->banner);
|
||||||
free(f->passw);
|
free(f->passw);
|
||||||
free(f->override);
|
|
||||||
free(f->name);
|
free(f->name);
|
||||||
|
|
||||||
while (f->attribs) {
|
while (f->attribs) {
|
||||||
|
@ -204,7 +203,6 @@ faction *addfaction(const char *email, const char *password,
|
||||||
log_error("Invalid email address for faction %s: %s\n", itoa36(f->no), email);
|
log_error("Invalid email address for faction %s: %s\n", itoa36(f->no), email);
|
||||||
}
|
}
|
||||||
|
|
||||||
f->override = _strdup(itoa36(rng_int()));
|
|
||||||
faction_setpassword(f, password);
|
faction_setpassword(f, password);
|
||||||
|
|
||||||
f->alliance_joindate = turn;
|
f->alliance_joindate = turn;
|
||||||
|
@ -264,8 +262,6 @@ bool checkpasswd(const faction * f, const char *passwd, bool shortp)
|
||||||
{
|
{
|
||||||
if (unicode_utf8_strcasecmp(f->passw, passwd) == 0)
|
if (unicode_utf8_strcasecmp(f->passw, passwd) == 0)
|
||||||
return true;
|
return true;
|
||||||
if (unicode_utf8_strcasecmp(f->override, passwd) == 0)
|
|
||||||
return true;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,6 @@ extern "C" {
|
||||||
* (FFL_SELECT muss man vorher initialisieren,
|
* (FFL_SELECT muss man vorher initialisieren,
|
||||||
* FL_MARK hinterher löschen) */
|
* FL_MARK hinterher löschen) */
|
||||||
#define FFL_NOIDLEOUT (1<<24) /* Partei stirbt nicht an NMRs */
|
#define FFL_NOIDLEOUT (1<<24) /* Partei stirbt nicht an NMRs */
|
||||||
#define FFL_OVERRIDE (1<<27) /* Override-Passwort wurde benutzt */
|
|
||||||
#define FFL_DBENTRY (1<<28) /* Partei ist in Datenbank eingetragen */
|
#define FFL_DBENTRY (1<<28) /* Partei ist in Datenbank eingetragen */
|
||||||
#define FFL_NOTIMEOUT (1<<29) /* ignore MaxAge() */
|
#define FFL_NOTIMEOUT (1<<29) /* ignore MaxAge() */
|
||||||
#define FFL_GM (1<<30) /* eine Partei mit Sonderrechten */
|
#define FFL_GM (1<<30) /* eine Partei mit Sonderrechten */
|
||||||
|
@ -71,7 +70,6 @@ extern "C" {
|
||||||
char *banner;
|
char *banner;
|
||||||
char *email;
|
char *email;
|
||||||
char *passw;
|
char *passw;
|
||||||
char *override;
|
|
||||||
int max_spelllevel;
|
int max_spelllevel;
|
||||||
struct spellbook *spellbook;
|
struct spellbook *spellbook;
|
||||||
const struct locale *locale;
|
const struct locale *locale;
|
||||||
|
|
|
@ -1247,11 +1247,8 @@ faction *readfaction(struct gamedata * data)
|
||||||
|
|
||||||
READ_STR(data->store, name, sizeof(name));
|
READ_STR(data->store, name, sizeof(name));
|
||||||
f->passw = _strdup(name);
|
f->passw = _strdup(name);
|
||||||
if (data->version >= OVERRIDE_VERSION) {
|
if (data->version < NOOVERRIDE_VERSION && data->version >= OVERRIDE_VERSION) {
|
||||||
READ_STR(data->store, name, sizeof(name));
|
READ_STR(data->store, 0, 0);
|
||||||
f->override = _strdup(name);
|
|
||||||
} else {
|
|
||||||
f->override = _strdup(itoa36(rng_int()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
READ_STR(data->store, name, sizeof(name));
|
READ_STR(data->store, name, sizeof(name));
|
||||||
|
@ -1362,7 +1359,6 @@ void writefaction(struct gamedata *data, const faction * f)
|
||||||
WRITE_STR(data->store, (const char *)f->banner);
|
WRITE_STR(data->store, (const char *)f->banner);
|
||||||
WRITE_STR(data->store, f->email);
|
WRITE_STR(data->store, f->email);
|
||||||
WRITE_TOK(data->store, (const char *)f->passw);
|
WRITE_TOK(data->store, (const char *)f->passw);
|
||||||
WRITE_TOK(data->store, (const char *)f->override);
|
|
||||||
WRITE_TOK(data->store, locale_name(f->locale));
|
WRITE_TOK(data->store, locale_name(f->locale));
|
||||||
WRITE_INT(data->store, f->lastorders);
|
WRITE_INT(data->store, f->lastorders);
|
||||||
WRITE_INT(data->store, f->age);
|
WRITE_INT(data->store, f->age);
|
||||||
|
|
|
@ -69,8 +69,9 @@
|
||||||
#define FIX_WATCHERS_VERSION 338 /* fixed storage of watchers */
|
#define FIX_WATCHERS_VERSION 338 /* fixed storage of watchers */
|
||||||
#define UNIQUE_SPELLS_VERSION 339 /* turn 775, spell names are now unique globally, not just per school */
|
#define UNIQUE_SPELLS_VERSION 339 /* turn 775, spell names are now unique globally, not just per school */
|
||||||
#define SPELLBOOK_VERSION 340 /* turn 775, full spellbooks are stored for factions */
|
#define SPELLBOOK_VERSION 340 /* turn 775, full spellbooks are stored for factions */
|
||||||
|
#define NOOVERRIDE_VERSION 341 /* turn 775, full spellbooks are stored for factions */
|
||||||
|
|
||||||
#define MIN_VERSION CURSETYPE_VERSION /* minimal datafile we support */
|
#define MIN_VERSION CURSETYPE_VERSION /* minimal datafile we support */
|
||||||
#define RELEASE_VERSION SPELLBOOK_VERSION /* current datafile */
|
#define RELEASE_VERSION NOOVERRIDE_VERSION /* current datafile */
|
||||||
|
|
||||||
#define STREAM_VERSION 2 /* internal encoding of binary files */
|
#define STREAM_VERSION 2 /* internal encoding of binary files */
|
||||||
|
|
|
@ -341,7 +341,6 @@ static void guardian_faction(plane * pl, int id)
|
||||||
f = calloc(1, sizeof(faction));
|
f = calloc(1, sizeof(faction));
|
||||||
f->banner = _strdup("Sie dienen dem großen Wyrm");
|
f->banner = _strdup("Sie dienen dem großen Wyrm");
|
||||||
f->passw = _strdup(itoa36(rng_int()));
|
f->passw = _strdup(itoa36(rng_int()));
|
||||||
f->override = _strdup(itoa36(rng_int()));
|
|
||||||
set_email(&f->email, "igjarjuk@eressea.de");
|
set_email(&f->email, "igjarjuk@eressea.de");
|
||||||
f->name = _strdup("Igjarjuks Kundschafter");
|
f->name = _strdup("Igjarjuks Kundschafter");
|
||||||
f->race = new_race[RC_ILLUSION];
|
f->race = new_race[RC_ILLUSION];
|
||||||
|
|
|
@ -689,9 +689,8 @@ int autoseed(newfaction ** players, int nsize, int max_agediff)
|
||||||
f->email, regionname(r, NULL));
|
f->email, regionname(r, NULL));
|
||||||
if (f->subscription) {
|
if (f->subscription) {
|
||||||
sql_print(
|
sql_print(
|
||||||
("UPDATE subscriptions SET status='ACTIVE', faction='%s', firstturn=%d, lastturn=%d, password='%s' WHERE id=%u;\n",
|
("UPDATE subscriptions SET status='ACTIVE', faction='%s', firstturn=%d, lastturn=%d WHERE id=%u;\n",
|
||||||
factionid(f), f->lastorders, f->lastorders, f->override,
|
factionid(f), f->lastorders, f->lastorders, f->subscription));
|
||||||
f->subscription));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove duplicate email addresses */
|
/* remove duplicate email addresses */
|
||||||
|
|
|
@ -666,7 +666,6 @@ faction *gm_addfaction(const char *email, plane * p, region * r)
|
||||||
f->banner = _strdup("quest faction");
|
f->banner = _strdup("quest faction");
|
||||||
f->name = _strdup("quest faction");
|
f->name = _strdup("quest faction");
|
||||||
f->passw = _strdup(itoa36(rng_int()));
|
f->passw = _strdup(itoa36(rng_int()));
|
||||||
f->override = _strdup(itoa36(rng_int()));
|
|
||||||
if (set_email(&f->email, email) != 0) {
|
if (set_email(&f->email, email) != 0) {
|
||||||
log_error("Invalid email address for faction %s: %s\n", itoa36(f->no), email);
|
log_error("Invalid email address for faction %s: %s\n", itoa36(f->no), email);
|
||||||
}
|
}
|
||||||
|
|
2
storage
2
storage
|
@ -1 +1 @@
|
||||||
Subproject commit af834a24aa87cdd51b1a68381a5a55140e1b1281
|
Subproject commit ce14333daa6f53d11b725dc347d734e3d513f793
|
Loading…
Reference in New Issue