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.
This commit is contained in:
Markus Armbruster 2006-08-13 07:13:37 +00:00
parent 2742a2db62
commit f7233ff841
2 changed files with 7 additions and 3 deletions

View file

@ -398,14 +398,18 @@ xdump(void)
meta = 1; meta = 1;
p = getstarg(player->argp[2], "Table name? ", buf); p = getstarg(player->argp[2], "Table name? ", buf);
} }
if (!p) if (!p || !*p)
return RET_SYN; return RET_SYN;
type = isdigit(p[0]) ? atoi(p) : ef_byname(p); type = isdigit(p[0]) ? atoi(p) : ef_byname(p);
if (type >= 0 && type < EF_MAX) { if (type >= 0 && type < EF_MAX) {
if (meta) if (meta)
return xdmeta(type); 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]); return xditem(type, player->argp[2]);
} else if (!strncmp(p, "ver", strlen(p))) { } else if (!strncmp(p, "ver", strlen(p))) {
return xdver(meta); return xdver(meta);

View file

@ -277,7 +277,7 @@ struct cmndstr player_coms[] = {
{"wipe <SECTS>", 1, wipe, C_MOD, NORM}, {"wipe <SECTS>", 1, wipe, C_MOD, NORM},
{"wire [yes|no|<days>]", 0, rea, C_MOD, VIS}, {"wire [yes|no|<days>]", 0, rea, C_MOD, VIS},
{"work <LAND UNITS> <AMOUNT>", 1, work, C_MOD, NORM + MONEY + CAP}, {"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}, {"zdone <y|n|c>", 0, zdon, C_MOD, NORM},
{0, 0, 0, 0, 0} {0, 0, 0, 0, 0}
}; };