]> git.pond.sub.org Git - empserver/commitdiff
Remove the demand update feature veto. It's virtually unused, flawed
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 14 Jul 2007 13:09:33 +0000 (13:09 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 14 Jul 2007 13:09:33 +0000 (13:09 +0000)
by design (by voting last players can tactically vote no and thus
build up veto rights), and its implementation is buggy:
(update_missed): Remove.
(zdone): Don't show it.
(demand_check): Remove veto check.
(natstr, cou_ca): Remove member nat_missed and its selector.
(zdone): Don't clear and don't show it.
(update_removewants): Don't increment it.  This was buggy anyway; it
incremented even on non-demand updates.
(prnat): Don't show it, remove key 'U'.
(docountry): Don't change it, deprecate the now useless key 'U'.

include/econfig-spec.h
include/nat.h
src/lib/commands/edit.c
src/lib/commands/zdon.c
src/lib/common/wantupd.c
src/lib/global/constants.c
src/lib/global/nsc.c
src/lib/update/removewants.c

index 855e22567b808823550dcefbaacc340caea5f120..328831a9f124bf41f86a6d95c6ef0ecbf683cc22 100644 (file)
@@ -124,8 +124,6 @@ EMPCF_COMMENT("# 0 - No demand updates\n"
     "#     in addition to (non-demand) scheduled updates\n")
 EMPCFBOTH("update_wantmin", update_wantmin, int, NSC_INT, 0,
     "Number of votes required for a demand update")
-EMPCFBOTH("update_missed", update_missed, int, NSC_INT, 0,
-    "A country vetoes further demand updates after missing that many votes")
 EMPCFBOTH("update_demandtimes", update_demandtimes, char *, NSC_STRING, 0,
     "Times when unscheduled demand updates can occur, separated by space.")
 EMPCF_COMMENT("# Give time ranges as HOUR:MINUTE-HOUR:MINUTE, e.g. 20:00-24:00\n"
index c761ea8e2403003de181f90a3d21acb8103ef22c..370e422fe0a41f301aa765e9113d30d1ca280492 100644 (file)
@@ -91,7 +91,6 @@ struct natstr {
     coord nat_xorg, nat_yorg;  /* origin location in abs coords */
     signed char nat_dayno;     /* day of the year mod 128 */
     signed char nat_update;    /* Want an update or not. */
-    unsigned char nat_missed;  /* How many updates missed */
     unsigned short nat_tgms;   /* # of telegrams to be announced */
     unsigned short nat_ann;    /* # of annos pending */
     unsigned short nat_minused;        /* number of minutes used today */
index 9ad3fbc47a123222b2544b4f09fc6dc9dbfe7591..4fbcb88f4731ee3897bfe366b777d40d9bcf5538 100644 (file)
@@ -299,7 +299,6 @@ prnat(struct natstr *np)
     pr("Happiness <H>: %.2f\n", np->nat_level[NAT_HLEV]);
     pr("Money <M>: $%6ld\n", np->nat_money);
     pr("Telegrams <t>: %6d\n", np->nat_tgms);
-    pr("Updates missed <U>: %d\n", np->nat_missed);
     if (opt_HIDDEN) {
        pr("Countries contacted: ");
        for (i = 0; i < MAXNOC; i++) {
@@ -745,7 +744,7 @@ docountry(char op, int arg, char *p, struct natstr *np)
        np->nat_level[NAT_HLEV] = farg;
        break;
     case 'U':
-       np->nat_missed = arg;
+       warn_deprecated(op);
        break;
     default:
        pr("huh? (%c)\n", op);
index 0eede00f77ab3ff03fc4747b7e5e2e8f214e59c6..ec3f9b735fcb021dad65d586d616869fac58cef4 100644 (file)
@@ -111,7 +111,6 @@ zdon(void)
                pr("Unable to request an update as the country is in flux\n");
                return RET_FAIL;
            }
-           natp->nat_missed = 0;
            pr("You (%d) now want an update.\n", whichcnum);
        } else {
            pr("You (%d) now DON'T want an update.\n", whichcnum);
@@ -126,10 +125,6 @@ zdon(void)
            pr("You want an update.\n");
        } else
            pr("You DON'T want an update, yet.\n");
-       pr("You have missed the vote on a demand update %d times.\n",
-          natp->nat_missed);
-       pr("It takes %d misses to veto a demand update.\n",
-          update_missed);
     }
 
     pr("%d of a total of %d lunatics want an update.\n", totwant, totpop);
index 377f07dfc96803915a1e87ea93ed1420b18f512d..f58fedec8c85d9f68bbaeee7d86851437f78baad 100644 (file)
@@ -91,8 +91,7 @@ demand_update_want(int *want, int *pop, int which)
 int
 demand_check(void)
 {
-    struct natstr *natp;
-    int want, pop, cn, veto;
+    int want, pop;
 
     demand_update_want(&want, &pop, 0);
     if (want < update_wantmin) {
@@ -101,20 +100,6 @@ demand_check(void)
        return 0;
     }
 
-    veto = 0;
-    for (cn = 1; 0 != (natp = getnatp(cn)); cn++) {
-       if (natp->nat_stat == STAT_ACTIVE) {
-           if (natp->nat_missed >= update_missed)
-               veto = cn;
-       }
-    }
-
-    if (veto) {
-       logerror("no demand update, %d has missed more than %d updates",
-                veto, update_missed);
-       return 0;
-    }
-
     return 1;
 }
 
index 7930dd85cb35fddfdd9c0c627ffcb4fd5f694f4b..ba3c1db209a50c8907c9675fd728fc37d09123fa 100644 (file)
@@ -58,7 +58,6 @@ int s_p_etu = 10;             /* seconds per Empire Time Unit */
 int etu_per_update = 60;       /* # of etu's per update */
 int update_window = 0;         /* update window adjustment, in seconds */
 int update_demand = UPD_DEMAND_NONE;
-int update_missed = 999;       /* demand updates missed before veto */
 int update_wantmin = 1;                /* votes required for demand update */
 char *update_demandtimes = ""; /* demand update time ranges */
 char *game_days = "";          /* days game is running */
index 86bbbc3704fbcbd5a54256070005266bb45c60c0..9382d571b5d26daa61a28e90e49a6df5594175f7 100644 (file)
@@ -501,7 +501,6 @@ struct castr cou_ca[] = {
      "yorg", EF_BAD},
     {NSC_CHAR, 0, 0, fldoff(natstr, nat_dayno), "dayno", EF_BAD},
     {NSC_CHAR, 0, 0, fldoff(natstr, nat_update), "update", EF_BAD},
-    {NSC_UCHAR, 0, 0, fldoff(natstr, nat_missed), "missed", EF_BAD},
     {NSC_USHORT, 0, 0, fldoff(natstr, nat_tgms), "tgms", EF_BAD},
     {NSC_USHORT, 0, 0, fldoff(natstr, nat_ann), "ann", EF_BAD},
     {NSC_USHORT, 0, 0, fldoff(natstr, nat_minused), "minused", EF_BAD},
index eecd4dcb3602e7a72cef618532b231dd849f2203..88cb89a60e77e2a3dc4f1ce707b0d61c5a30bb70 100644 (file)
@@ -41,10 +41,7 @@ update_removewants(void)
     natid cn;
     struct natstr *natp;
 
-    for (cn = 0; NULL != (natp = getnatp(cn)); cn++) {
-       if (natp->nat_stat != STAT_UNUSED && !natp->nat_update)
-           natp->nat_missed++;
+    for (cn = 0; NULL != (natp = getnatp(cn)); cn++)
        natp->nat_update = 0;
-    }
     return 0;
 }