forked from github/server
HSE: globaler CR
This commit is contained in:
parent
648fea3d1d
commit
f0296f612a
|
@ -2547,6 +2547,34 @@ view_regatta(region * r, faction * f)
|
|||
recurse_regatta(r, r, f, skill/2);
|
||||
}
|
||||
|
||||
static void
|
||||
global_report(const char * filename)
|
||||
{
|
||||
FILE * F = fopen(filename, "w");
|
||||
region * r;
|
||||
faction * f;
|
||||
faction * monsters = findfaction(MONSTER_FACTION);
|
||||
faction_list * addresses = NULL;
|
||||
|
||||
if (!monsters) return;
|
||||
if (!F) return;
|
||||
|
||||
seen_init();
|
||||
for (r = regions; r; r = r->next) {
|
||||
add_seen(r, see_unit, true);
|
||||
}
|
||||
|
||||
for (f=factions;f;f=f->next) {
|
||||
faction_list * flist = calloc(1, sizeof(faction_list));
|
||||
flist->data = f;
|
||||
flist->next = addresses;
|
||||
addresses = flist;
|
||||
}
|
||||
|
||||
report_computer(F, monsters, addresses, time(NULL));
|
||||
fclose(F);
|
||||
}
|
||||
|
||||
static void
|
||||
prepare_report(faction * f)
|
||||
{
|
||||
|
@ -2641,6 +2669,7 @@ reports(void)
|
|||
wants_compressed, wants_bzip2;
|
||||
time_t ltime = time(NULL);
|
||||
char pzTime[64];
|
||||
const char * str;
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
strftime(pzTime, 64, "%A, %-e. %B %Y, %-k:%M", localtime(<ime));
|
||||
|
@ -2830,10 +2859,16 @@ reports(void)
|
|||
printf("\n");
|
||||
freelist(addresses);
|
||||
}
|
||||
|
||||
str = get_param(global.parameters, "globalreport");
|
||||
if (str!=NULL) {
|
||||
sprintf(buf, "%s/%s.%u.cr", reportpath(), str, turn);
|
||||
global_report(buf);
|
||||
}
|
||||
/* schliesst BAT und verschickt Zeitungen und Kommentare */
|
||||
closebatch(BAT);
|
||||
current_faction = NULL;
|
||||
seen_done();
|
||||
closebatch(BAT);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
<param name="GiveRestriction" value="3"/>
|
||||
<param name="hunger.long" value="1"/>
|
||||
<param name="database.gameid" value="3"/>
|
||||
<param name="globalreport" value="3"/>
|
||||
<param name="rules.check_overload" value="1"/>
|
||||
<param name="report.mailit" value="/usr/sbin:$HOME/eressea/bin:/bin:/usr/bin:/usr/local/bin"/>
|
||||
</game>
|
||||
|
|
Loading…
Reference in New Issue