]> git.pond.sub.org Git - empserver/commitdiff
Allow xdump before break; partial solution for #1417871:
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 13 Aug 2006 07:13:37 +0000 (07:13 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 13 Aug 2006 07:13:37 +0000 (07:13 +0000)
(player_coms): Set xdump's c_permit to VIS.
(xdump): Deny countries that couldn't run xdump before access to game
state.

src/lib/commands/xdump.c
src/lib/player/empmod.c

index 0052323beab87d25ae07a494359dd56b71775683..9122eae6a02e86488033ad0f307df04d9ed082c0 100644 (file)
@@ -398,14 +398,18 @@ xdump(void)
        meta = 1;
        p = getstarg(player->argp[2], "Table name? ", buf);
     }
-    if (!p)
+    if (!p || !*p)
        return RET_SYN;
 
     type = isdigit(p[0]) ? atoi(p) : ef_byname(p);
     if (type >= 0 && type < EF_MAX) {
        if (meta)
            return xdmeta(type);
-       else
+       else if (EF_IS_GAME_STATE(type)
+                && (player->ncomstat & NORM) != NORM) {
+           pr("Access to table %s denied\n", ef_nameof(type));
+           return RET_FAIL;
+       } else
            return xditem(type, player->argp[2]);
     } else if (!strncmp(p, "ver", strlen(p))) {
        return xdver(meta);
index 3b084cdfa8c039ab0e2b95f0ec235bcebb13b0f3..e3676b72a3bf5016c688eabbcab8438dfc21f578 100644 (file)
@@ -277,7 +277,7 @@ struct cmndstr player_coms[] = {
     {"wipe <SECTS>", 1, wipe, C_MOD, NORM},
     {"wire [yes|no|<days>]", 0, rea, C_MOD, VIS},
     {"work <LAND UNITS> <AMOUNT>", 1, work, C_MOD, NORM + MONEY + CAP},
-    {"xdump [\"meta\"] <TYPE|\"ver\"> [<RECORDS>]", 0, xdump, 0, NORM},
+    {"xdump [\"meta\"] <TYPE|\"ver\"> [<RECORDS>]", 0, xdump, 0, VIS},
     {"zdone <y|n|c>", 0, zdon, C_MOD, NORM},
     {0, 0, 0, 0, 0}
 };