Bug 1805: re-enable NMR warnings

https://bugs.eressea.de/view.php?id=1805
move warnings to the top of the list of errors in the NR
This commit is contained in:
Enno Rehling 2015-07-03 15:31:57 +02:00
parent b2d981e577
commit 979f3460d6
6 changed files with 50 additions and 61 deletions

View File

@ -2212,12 +2212,6 @@
<text locale="de">Schaden</text> <text locale="de">Schaden</text>
</string> </string>
<!--report newbie info -->
<string name="nr_nmr">
<text locale="de">Deine Partei hat letzte Runde keinen Zug
abgegeben!</text>
</string>
<namespace name="race"> <namespace name="race">
<string name="snowman"> <string name="snowman">
<text locale="de">Schneemann</text> <text locale="de">Schneemann</text>

View File

@ -1660,10 +1660,6 @@
</string> </string>
</namespace> </namespace>
<string name="nr_nmr">
<text locale="en">No orders were received for your faction!</text>
</string>
<!-- resources --> <!-- resources -->
<string name="mistletoe"> <string name="mistletoe">
<text locale="de">Mistelzweig</text> <text locale="de">Mistelzweig</text>

View File

@ -2051,7 +2051,4 @@
<text locale="fr">côte ouest</text> <text locale="fr">côte ouest</text>
</string> </string>
</namespace> </namespace>
<string name="nr_nmr">
<text locale="fr">Aucun ordre reçu pour votre faction !</text>
</string>
</strings> </strings>

View File

@ -7100,9 +7100,16 @@
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - Your faction must be at least $int($turns) weeks old to give something to another faction."</text> <text locale="en">"$unit($unit) in $region($region): '$order($command)' - Your faction must be at least $int($turns) weeks old to give something to another faction."</text>
</message> </message>
<message name="turnreminder" section="errors"> <message name="nmr_warning" section="errors">
<type> <type/>
</type> <text locale="de">Deine Partei hat letzte Runde keinen Zug
abgegeben!</text>
<text locale="en">No orders were received for your faction!</text>
<text locale="fr">Aucun ordre reçu pour votre faction !</text>
</message>
<message name="nmr_warning_final" section="errors">
<type/>
<text locale="de">"Bitte sende die Befehle nächste Runde ein, wenn du weiterspielen möchtest."</text> <text locale="de">"Bitte sende die Befehle nächste Runde ein, wenn du weiterspielen möchtest."</text>
<text locale="en">"Please send in orders for the next turn if you want to continue playing."</text> <text locale="en">"Please send in orders for the next turn if you want to continue playing."</text>
</message> </message>

View File

@ -125,16 +125,6 @@ static int RemoveNMRNewbie(void)
return value; return value;
} }
static void checkorders(void)
{
faction *f;
log_info(" - Warne spaete Spieler...");
for (f = factions; f; f = f->next)
if (!is_monsters(f) && turn - f->lastorders == NMRTimeout() - 1)
ADDMSG(&f->msgs, msg_message("turnreminder", ""));
}
static void age_unit(region * r, unit * u) static void age_unit(region * r, unit * u)
{ {
if (u_race(u) == get_race(RC_SPELL)) { if (u_race(u) == get_race(RC_SPELL)) {
@ -735,6 +725,45 @@ void immigration(void)
} }
} }
static void nmr_warnings(void)
{
faction *f, *fa;
#define FRIEND (HELP_GUARD|HELP_MONEY)
for (f = factions; f; f = f->next) {
if (!fval(f, FFL_NOIDLEOUT) && turn > f->lastorders) {
ADDMSG(&f->msgs, msg_message("nmr_warning", ""));
if (turn - f->lastorders == NMRTimeout() - 1) {
ADDMSG(&f->msgs, msg_message("nmr_warning_final", ""));
}
if ((turn - f->lastorders) >= 2) {
message *msg = NULL;
for (fa = factions; fa; fa = fa->next) {
int warn = 0;
if (get_param_int(global.parameters, "rules.alliances", 0) != 0) {
if (f->alliance && f->alliance == fa->alliance) {
warn = 1;
}
}
else if (alliedfaction(NULL, f, fa, FRIEND)
&& alliedfaction(NULL, fa, f, FRIEND)) {
warn = 1;
}
if (warn) {
if (msg == NULL) {
msg =
msg_message("warn_dropout", "faction turns", f,
turn - f->lastorders);
}
add_message(&fa->msgs, msg);
}
}
if (msg != NULL)
msg_release(msg);
}
}
}
}
void demographics(void) void demographics(void)
{ {
region *r; region *r;
@ -810,7 +839,6 @@ void demographics(void)
remove_empty_units(); remove_empty_units();
immigration(); immigration();
checkorders();
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
@ -4367,6 +4395,7 @@ void init_processor(void)
} }
p = 10; p = 10;
add_proc_global(p, nmr_warnings, "NMR Warnings");
add_proc_global(p, new_units, "Neue Einheiten erschaffen"); add_proc_global(p, new_units, "Neue Einheiten erschaffen");
p += 10; p += 10;

View File

@ -1834,39 +1834,6 @@ int write_reports(faction * f, time_t ltime)
return 0; return 0;
} }
static void nmr_warnings(void)
{
faction *f, *fa;
#define FRIEND (HELP_GUARD|HELP_MONEY)
for (f = factions; f; f = f->next) {
if (!fval(f, FFL_NOIDLEOUT) && (turn - f->lastorders) >= 2) {
message *msg = NULL;
for (fa = factions; fa; fa = fa->next) {
int warn = 0;
if (get_param_int(global.parameters, "rules.alliances", 0) != 0) {
if (f->alliance && f->alliance == fa->alliance) {
warn = 1;
}
}
else if (alliedfaction(NULL, f, fa, FRIEND)
&& alliedfaction(NULL, fa, f, FRIEND)) {
warn = 1;
}
if (warn) {
if (msg == NULL) {
msg =
msg_message("warn_dropout", "faction turns", f,
turn - f->lastorders);
}
add_message(&fa->msgs, msg);
}
}
if (msg != NULL)
msg_release(msg);
}
}
}
static void report_donations(void) static void report_donations(void)
{ {
region *r; region *r;
@ -1945,7 +1912,6 @@ int reports(void)
if (verbosity >= 1) { if (verbosity >= 1) {
log_printf(stdout, "Writing reports for turn %d:", turn); log_printf(stdout, "Writing reports for turn %d:", turn);
} }
nmr_warnings();
report_donations(); report_donations();
remove_empty_units(); remove_empty_units();