implemented correctly by asynchronous clients --- unless a client
waits for a prompt after sending the execute command and its argument,
it is prone to send more input before the C_EXECUTE arrives. That
input overtakes the contents of the script file. This is almost
certain to happen when the execute is in a script file. Disabling
that is probably more useful and certainly less painful than
documenting this mess. The client rejects nested execute since
servcmd.c rev. 1.42.
(EXEC): new.
(player_coms): Require it for execute.
(player_set_nstat): Set it in nstat.
(execute): Clear it in nstat.
#define SANCT (bit(1) | VIS)
#define NORM (bit(2) | VIS)
#define GOD (bit(3) | NORM | VIS)
#define SANCT (bit(1) | VIS)
#define NORM (bit(2) | VIS)
#define GOD (bit(3) | NORM | VIS)
#define CAP bit(6)
#define MONEY bit(7)
#define CAP bit(6)
#define MONEY bit(7)
0, edit, C_MOD, GOD},
{"enable", 0, enab, C_MOD, GOD},
{"enlist <SECTS> <NUM>", 2, enli, C_MOD, NORM + MONEY + CAP},
0, edit, C_MOD, GOD},
{"enable", 0, enab, C_MOD, GOD},
{"enlist <SECTS> <NUM>", 2, enli, C_MOD, NORM + MONEY + CAP},
- {"execute <INPUT FILE>", 0, execute, 0, VIS},
+ {"execute <INPUT FILE>", 0, execute, 0, VIS + EXEC },
{"explore <c|m> <SECT> <NUM> <PATH|DESTINATION>",
1, explore, C_MOD, NORM + MONEY + CAP},
{"financial", 0, fina, 0, NORM},
{"explore <c|m> <SECT> <NUM> <PATH|DESTINATION>",
1, explore, C_MOD, NORM + MONEY + CAP},
{"financial", 0, fina, 0, NORM},
pl->nstat |= MONEY;
if (np->nat_stat == STAT_ACTIVE && !influx(np))
pl->nstat |= CAP;
pl->nstat |= MONEY;
if (np->nat_stat == STAT_ACTIVE && !influx(np))
pl->nstat |= CAP;
prexec(p);
while (!failed && status()) {
prexec(p);
while (!failed && status()) {
+ player->nstat &= ~EXEC;
if (recvclient(buf, sizeof(buf)) < 0)
break;
if (parse(buf, scanspace, player->argp, player->comtail,
if (recvclient(buf, sizeof(buf)) < 0)
break;
if (parse(buf, scanspace, player->argp, player->comtail,
if (failed) {
while (recvclient(buf, sizeof(buf)) >= 0) ;
}
if (failed) {
while (recvclient(buf, sizeof(buf)) >= 0) ;
}
pr("Execute : %s\n", failed ? "aborted" : "terminated");
player->eof = 0;
return RET_OK;
pr("Execute : %s\n", failed ? "aborted" : "terminated");
player->eof = 0;
return RET_OK;