From f7233ff841d459499d851c8d6f711a1dc9ce7e69 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 13 Aug 2006 07:13:37 +0000 Subject: [PATCH] Allow xdump before break; partial solution for #1417871: (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 | 8 ++++++-- src/lib/player/empmod.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/commands/xdump.c b/src/lib/commands/xdump.c index 0052323b..9122eae6 100644 --- a/src/lib/commands/xdump.c +++ b/src/lib/commands/xdump.c @@ -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); diff --git a/src/lib/player/empmod.c b/src/lib/player/empmod.c index 3b084cdf..e3676b72 100644 --- a/src/lib/player/empmod.c +++ b/src/lib/player/empmod.c @@ -277,7 +277,7 @@ struct cmndstr player_coms[] = { {"wipe ", 1, wipe, C_MOD, NORM}, {"wire [yes|no|]", 0, rea, C_MOD, VIS}, {"work ", 1, work, C_MOD, NORM + MONEY + CAP}, - {"xdump [\"meta\"] []", 0, xdump, 0, NORM}, + {"xdump [\"meta\"] []", 0, xdump, 0, VIS}, {"zdone ", 0, zdon, C_MOD, NORM}, {0, 0, 0, 0, 0} };