forked from github/server
- nunits/no_units vereinigt
This commit is contained in:
parent
0f28866c0d
commit
71cda9aa27
|
@ -1197,7 +1197,7 @@ quit(void)
|
||||||
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->nunits, f->number, f->money);
|
f->no_units, f->number, f->money);
|
||||||
fprintf(sqlstream,
|
fprintf(sqlstream,
|
||||||
"UPDATE subscriptions SET lastturn=%d, password='%s', info='%s' "
|
"UPDATE subscriptions SET lastturn=%d, password='%s', info='%s' "
|
||||||
"WHERE game=%d AND faction='%s';\n",
|
"WHERE game=%d AND faction='%s';\n",
|
||||||
|
|
|
@ -3082,7 +3082,6 @@ make_summary(boolean count_new)
|
||||||
}
|
}
|
||||||
++plang->number;
|
++plang->number;
|
||||||
f->nregions = 0;
|
f->nregions = 0;
|
||||||
f->nunits = 0;
|
|
||||||
f->number = 0;
|
f->number = 0;
|
||||||
f->money = 0;
|
f->money = 0;
|
||||||
if (count_new == true || f->age > 0) s->factions++;
|
if (count_new == true || f->age > 0) s->factions++;
|
||||||
|
@ -3168,7 +3167,6 @@ make_summary(boolean count_new)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
f->nunits++;
|
|
||||||
f->number += u->number;
|
f->number += u->number;
|
||||||
f->money += get_money(u);
|
f->money += get_money(u);
|
||||||
s->poprace[old_race(u->race)] += u->number;
|
s->poprace[old_race(u->race)] += u->number;
|
||||||
|
@ -3389,7 +3387,7 @@ out_faction(FILE *file, faction *f)
|
||||||
{
|
{
|
||||||
fprintf(file, "%s (%.3s/%.3s), %d Einh., %d Pers., $%d, %d %s\n",
|
fprintf(file, "%s (%.3s/%.3s), %d Einh., %d Pers., $%d, %d %s\n",
|
||||||
factionname(f), LOC(default_locale, rc_name(f->race, 0)),
|
factionname(f), LOC(default_locale, rc_name(f->race, 0)),
|
||||||
neue_gebiete[f->magiegebiet], f->nunits, f->number, f->money,
|
neue_gebiete[f->magiegebiet], f->no_units, f->number, f->money,
|
||||||
turn - f->lastorders, turn - f->lastorders != 1 ? "NMRs" : "NMR ");
|
turn - f->lastorders, turn - f->lastorders != 1 ? "NMRs" : "NMR ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3579,14 +3577,17 @@ report_summary(summary * s, summary * o, boolean full)
|
||||||
if (!F) return;
|
if (!F) return;
|
||||||
printf("Schreibe Spielerliste (players)...\n");
|
printf("Schreibe Spielerliste (players)...\n");
|
||||||
r = findregion(0, 0);
|
r = findregion(0, 0);
|
||||||
if (r) for (f=factions;f;f=f->next) {
|
|
||||||
fputs("id;name;email;info;age;x;y;nmr;score;race;magic;units;people;money", F);
|
fputs("id;name;email;info;age;x;y;nmr;score;race;magic;units;people;money", F);
|
||||||
|
if (r) {
|
||||||
|
fputs("id;name;email;info;age;x;y;nmr;score;race;magic;units;people;money", F);
|
||||||
|
for (f=factions;f;f=f->next) {
|
||||||
fprintf(F, "%s;\"%s\";\"%s\";\"%s\";\"%s\";%d;%d;%d;%d;%d;"
|
fprintf(F, "%s;\"%s\";\"%s\";\"%s\";\"%s\";%d;%d;%d;%d;%d;"
|
||||||
"\"%s\";\"%s\";"
|
"\"%s\";\"%s\";"
|
||||||
"%d;%d;%d\n",
|
"%d;%d;%d\n",
|
||||||
factionid(f), f->name, f->email, f->banner, f->passw, f->age, region_x(r, f), region_y(r, f), turn-f->lastorders, f->score,
|
factionid(f), f->name, f->email, f->banner, f->passw, f->age, region_x(r, f), region_y(r, f), turn-f->lastorders, f->score,
|
||||||
f->race->name[0], neue_gebiete[f->magiegebiet],
|
f->race->name[0], neue_gebiete[f->magiegebiet],
|
||||||
f->nunits, f->number, f->money);
|
f->no_units, f->number, f->money);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fclose(F);
|
fclose(F);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -52,7 +52,6 @@ typedef struct faction {
|
||||||
struct strlist *mistakes; /* enno: das muß irgendwann noch ganz raus */
|
struct strlist *mistakes; /* enno: das muß irgendwann noch ganz raus */
|
||||||
boolean alive; /* enno: sollte ein flag werden */
|
boolean alive; /* enno: sollte ein flag werden */
|
||||||
int nregions;
|
int nregions;
|
||||||
int nunits; /* enno: unterschied zu no_units ? */
|
|
||||||
int number; /* enno: unterschied zu num_people ? */
|
int number; /* enno: unterschied zu num_people ? */
|
||||||
int money;
|
int money;
|
||||||
int score;
|
int score;
|
||||||
|
|
|
@ -208,6 +208,32 @@ getgarbage(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
writefactiondata(void)
|
||||||
|
{
|
||||||
|
FILE *F;
|
||||||
|
char zText[128];
|
||||||
|
|
||||||
|
sprintf(zText, "%s/faction-data.xml", basepath());
|
||||||
|
F = cfopen(zText, "w");
|
||||||
|
if(F) {
|
||||||
|
faction *f;
|
||||||
|
for(f = factions; f; f=f->next) {
|
||||||
|
fprintf(F,"<faction>\n");
|
||||||
|
fprintf(F,"\t<id>%s</id>\n",itoa36(f->no));
|
||||||
|
fprintf(F,"\t<name>%s</name>\n",f->name);
|
||||||
|
fprintf(F,"\t<email>%s</email>\n",f->email);
|
||||||
|
fprintf(F,"\t<password>%s</password>\n",f->passw);
|
||||||
|
fprintf(F,"\t<race>%s</race>\n",rc_name(f->race,1));
|
||||||
|
fprintf(F,"\t<magic>%s</magic>\n",neue_gebiete[f->magiegebiet]);
|
||||||
|
fprintf(F,"\t<nmrs>%d</nmrs>\n",turn-f->lastorders);
|
||||||
|
fprintf(F,"\t<score>%d</score>\n",f->score);
|
||||||
|
fprintf(F,"</faction>\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fclose(F);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
writepasswd(void)
|
writepasswd(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -445,17 +445,17 @@ create_region_menu(menulist ** menu, region * r)
|
||||||
addmenulist(menu, buf, 0);
|
addmenulist(menu, buf, 0);
|
||||||
} else {
|
} else {
|
||||||
for (f = factions; f; f = f->next)
|
for (f = factions; f; f = f->next)
|
||||||
f->num_people = f->nunits = 0;
|
f->num_people = f->no_units = 0;
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
u->faction->nunits++;
|
u->faction->no_units++;
|
||||||
u->faction->num_people += u->number;
|
u->faction->num_people += u->number;
|
||||||
}
|
}
|
||||||
addmenulist(menu, buf, 0);
|
addmenulist(menu, buf, 0);
|
||||||
|
|
||||||
for (f = factions; f; f = f->next) {
|
for (f = factions; f; f = f->next) {
|
||||||
if (f->nunits) {
|
if (f->no_units) {
|
||||||
sprintf(buf, " %s: ", factionname(f));
|
sprintf(buf, " %s: ", factionname(f));
|
||||||
sprintf(str, "Einheiten: %d; Leute: %d", f->nunits, f->num_people);
|
sprintf(str, "Einheiten: %d; Leute: %d", f->no_units, f->num_people);
|
||||||
sncat(buf, str, BUFSIZE);
|
sncat(buf, str, BUFSIZE);
|
||||||
addmenulist(menu, buf, 0);
|
addmenulist(menu, buf, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -506,7 +506,7 @@ ModifyPartei(faction * f)
|
||||||
wmove(win, 1, 2);
|
wmove(win, 1, 2);
|
||||||
wprintw(win, (NCURSES_CONST char*)"Rasse: %s", f->race->_name[1]);
|
wprintw(win, (NCURSES_CONST char*)"Rasse: %s", f->race->_name[1]);
|
||||||
wmove(win, 2, 2);
|
wmove(win, 2, 2);
|
||||||
wprintw(win, (NCURSES_CONST char*)"Einheiten: %d", f->nunits);
|
wprintw(win, (NCURSES_CONST char*)"Einheiten: %d", f->no_units);
|
||||||
wmove(win, 3, 2);
|
wmove(win, 3, 2);
|
||||||
wprintw(win, (NCURSES_CONST char*)"Personen: %d", f->num_people);
|
wprintw(win, (NCURSES_CONST char*)"Personen: %d", f->num_people);
|
||||||
wmove(win, 4, 2);
|
wmove(win, 4, 2);
|
||||||
|
|
|
@ -355,20 +355,20 @@ showregion(region * r, char full)
|
||||||
adddbllist(®list, buf);
|
adddbllist(®list, buf);
|
||||||
|
|
||||||
for (f = factions; f; f = f->next)
|
for (f = factions; f; f = f->next)
|
||||||
f->num_people = f->nunits = 0;
|
f->num_people = f->no_units = 0;
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
if (u->faction) {
|
if (u->faction) {
|
||||||
u->faction->nunits++;
|
u->faction->no_units++;
|
||||||
u->faction->num_people += u->number;
|
u->faction->num_people += u->number;
|
||||||
} else
|
} else
|
||||||
fprintf(stderr,"Unit %s hat keine faction!\n",unitid(u));
|
fprintf(stderr,"Unit %s hat keine faction!\n",unitid(u));
|
||||||
}
|
}
|
||||||
for (f = factions; f; f = f->next)
|
for (f = factions; f; f = f->next)
|
||||||
if (f->nunits) {
|
if (f->no_units) {
|
||||||
sprintf(buf, " %-29.29s (%s)", f->name, factionid(f));
|
sprintf(buf, " %-29.29s (%s)", f->name, factionid(f));
|
||||||
adddbllist(®list, buf);
|
adddbllist(®list, buf);
|
||||||
sprintf(buf, " Einheiten: %d; Leute: %d %c",
|
sprintf(buf, " Einheiten: %d; Leute: %d %c",
|
||||||
f->nunits, f->num_people, Tchar[old_race(f->race)]);
|
f->no_units, f->num_people, Tchar[old_race(f->race)]);
|
||||||
adddbllist(®list, buf);
|
adddbllist(®list, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue