Skip to content

Commit 7afa29a

Browse files
committed
Remove the @ps command
1 parent e6bd348 commit 7afa29a

4 files changed

Lines changed: 0 additions & 166 deletions

File tree

src/mux/commands/command.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,6 @@ NameTable pose_sw[] = {{"default", 1, CA_PUBLIC, 0},
175175
{"nospace", 1, CA_PUBLIC, SAY_NOSPACE},
176176
{nullptr, 0, 0, 0}};
177177

178-
NameTable ps_sw[] = {{"all", 1, CA_PUBLIC, PS_ALL | SW_MULTIPLE},
179-
{"brief", 1, CA_PUBLIC, PS_BRIEF},
180-
{"long", 1, CA_PUBLIC, PS_LONG},
181-
{"summary", 1, CA_PUBLIC, PS_SUMM},
182-
{nullptr, 0, 0, 0}};
183-
184178
NameTable set_sw[] = {{"quiet", 1, CA_PUBLIC, SET_QUIET}, {nullptr, 0, 0, 0}};
185179

186180
NameTable stats_sw[] = {{"all", 1, CA_PUBLIC, STAT_ALL},
@@ -506,7 +500,6 @@ CMDENT command_table[] = {
506500
CS_TWO_ARG | CS_UNPARSE,
507501
{.invoke = do_pemit}},
508502
{"@power", nullptr, CA_WIZARD, 0, CS_TWO_ARG, {.invoke = do_power}},
509-
{"@ps", ps_sw, CA_WIZARD, 0, CS_ONE_ARG | CS_INTERP, {.invoke = do_ps}},
510503
{"@readcache", nullptr, CA_WIZARD, 0, CS_NO_ARGS, {.invoke = do_readcache}},
511504
{"@robot",
512505
nullptr,

src/mux/commands/command.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ void do_password(CommandInvocation *invocation); /* Change my password */
9797
void do_pcreate(CommandInvocation *invocation);
9898
void do_pemit(CommandInvocation *invocation); /* Message a specific object. */
9999
void do_power(CommandInvocation *invocation); /* Sets powers */
100-
void do_ps(CommandInvocation *invocation); /* List contents of queue */
101100
void do_kick(CommandInvocation *invocation); /* Force queue processing */
102101
void do_quit(CommandInvocation *invocation); /* Disconnect this session */
103102
void do_readcache(CommandInvocation *invocation); /* Reread text file cache */

src/mux/commands/command_queue.c

Lines changed: 0 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -988,160 +988,6 @@ int do_top(CommandQueue *queue, int ncmds) {
988988
return count;
989989
}
990990

991-
/*
992-
* ---------------------------------------------------------------------------
993-
* * do_ps: tell player what commands they have pending in the queue
994-
*/
995-
996-
static void show_que(EvaluationContext *evaluation, DbRef player, int key,
997-
BQUE *queue, RuntimeClock *clock, int *qent,
998-
const char *header) {
999-
BQUE *tmp;
1000-
char *bp, *bufp;
1001-
int i;
1002-
1003-
for (tmp = queue; tmp; tmp = tmp->next) {
1004-
(*qent)++;
1005-
if (key == PS_SUMM)
1006-
continue;
1007-
if (*qent == 1)
1008-
notify_printf(evaluation, player, "----- %s Queue -----", header);
1009-
1010-
bufp = unparse_object(evaluation->world->database, evaluation, player,
1011-
tmp->player, 0);
1012-
if (!(key & PS_ALL))
1013-
if ((player !=
1014-
game_object_owner(evaluation->world->database, tmp->player)))
1015-
continue;
1016-
if ((tmp->waittime > 0) &&
1017-
is_good_obj(evaluation->world->database, tmp->sem))
1018-
notify_printf(evaluation, player, "[#%ld/%ld]%s:%s", tmp->sem,
1019-
tmp->waittime - clock->now, bufp, tmp->comm);
1020-
else if (tmp->waittime > 0)
1021-
notify_printf(evaluation, player, "[%ld]%s:%s",
1022-
tmp->waittime - clock->now, bufp, tmp->comm);
1023-
else if (is_good_obj(evaluation->world->database, tmp->sem))
1024-
notify_printf(evaluation, player, "[#%ld]%s:%s", tmp->sem, bufp,
1025-
tmp->comm);
1026-
else
1027-
notify_printf(evaluation, player, "%s:%s", bufp, tmp->comm);
1028-
1029-
bp = bufp;
1030-
if (key == PS_LONG) {
1031-
for (i = 0; i < (tmp->nargs); i++) {
1032-
if (tmp->env[i] != nullptr) {
1033-
safe_str("; Arg", bufp, &bp);
1034-
safe_chr((char)(i + '0'), bufp, &bp);
1035-
safe_str("='", bufp, &bp);
1036-
safe_str(tmp->env[i], bufp, &bp);
1037-
safe_chr('\'', bufp, &bp);
1038-
}
1039-
}
1040-
*bp = '\0';
1041-
bp = unparse_object(evaluation->world->database, evaluation, player,
1042-
tmp->cause, 0);
1043-
notify_printf(evaluation, player, " Enactor: %s%s", bp, bufp);
1044-
free_lbuf(bp);
1045-
}
1046-
free_lbuf(bufp);
1047-
}
1048-
return;
1049-
}
1050-
1051-
void do_ps(CommandInvocation *invocation) {
1052-
EvaluationContext *evaluation = &invocation->context->evaluation;
1053-
DbRef player = invocation->player;
1054-
int key = invocation->key;
1055-
char *target = invocation->first;
1056-
CommandQueue *queue = invocation->context->runtime->commands;
1057-
DbRef player_targ, obj_targ;
1058-
int pqent, pqtot, wqent, wqtot, sqent, sqtot;
1059-
OBJQE *objq;
1060-
int tempkey;
1061-
1062-
/*
1063-
* Figure out what to list the queue for
1064-
*/
1065-
1066-
if ((key & PS_ALL) && !is_wizard(queue->world->database, player)) {
1067-
notify(evaluation, player, "Permission denied.");
1068-
return;
1069-
}
1070-
if (!target || !*target) {
1071-
obj_targ = NOTHING;
1072-
if (key & PS_ALL) {
1073-
player_targ = NOTHING;
1074-
} else {
1075-
player_targ = game_object_owner(queue->world->database, player);
1076-
if (typeof_obj(queue->world->database, player) != TYPE_PLAYER)
1077-
obj_targ = player;
1078-
}
1079-
} else {
1080-
player_targ = game_object_owner(queue->world->database, player);
1081-
obj_targ = match_controlled(&invocation->context->match, player, target);
1082-
if (obj_targ == NOTHING)
1083-
return;
1084-
if (key & PS_ALL) {
1085-
notify(evaluation, player, "Can't specify a target and /all");
1086-
return;
1087-
}
1088-
if (typeof_obj(queue->world->database, obj_targ) == TYPE_PLAYER) {
1089-
player_targ = obj_targ;
1090-
obj_targ = NOTHING;
1091-
}
1092-
}
1093-
tempkey = key;
1094-
key = key & ~PS_ALL;
1095-
switch (key) {
1096-
case PS_BRIEF:
1097-
case PS_SUMM:
1098-
case PS_LONG:
1099-
break;
1100-
default:
1101-
notify(evaluation, player, "Illegal combination of switches.");
1102-
return;
1103-
}
1104-
1105-
/*
1106-
* Go do it
1107-
*/
1108-
pqent = 0;
1109-
pqtot = 0;
1110-
if (player_targ == NOTHING) {
1111-
objq = queue->head;
1112-
while (objq && (objq = objq->next) != nullptr) {
1113-
pqent = 0;
1114-
show_que(evaluation, player, tempkey, objq->cque, queue->clock, &pqent,
1115-
"PLAYAH");
1116-
pqtot += pqent;
1117-
}
1118-
} else {
1119-
pqent = 0;
1120-
objq = cque_find(queue, player_targ);
1121-
if (objq) {
1122-
show_que(evaluation, player, tempkey, objq->cque, queue->clock, &pqent,
1123-
"PLAYAH");
1124-
}
1125-
}
1126-
1127-
wqent = 0;
1128-
sqent = 0;
1129-
wqtot = 0;
1130-
sqtot = 0;
1131-
show_que(evaluation, player, tempkey, queue->wait, queue->clock, &wqent,
1132-
"Wait");
1133-
show_que(evaluation, player, tempkey, queue->semaphore_first, queue->clock,
1134-
&sqent, "Semaphore");
1135-
1136-
/*
1137-
* Display stats
1138-
*/
1139-
1140-
notify_printf(evaluation, player,
1141-
"Totals: Player...%d/%d Wait...%d/%d Semaphore...%d/%d",
1142-
pqent, pqtot, wqent, wqtot, sqent, sqtot);
1143-
}
1144-
1145991
/*
1146992
* ---------------------------------------------------------------------------
1147993
* * do_kick: Queue management

src/mux/server/server_api.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,6 @@ constexpr int PEMIT_CONTENTS = 8; /* Send to contents (additive) */
199199
constexpr int PEMIT_HERE = 16; /* Send to location (@femit, additive) */
200200
constexpr int PEMIT_ROOM = 32; /* Send to containing rm (@femit, additive) */
201201
constexpr int PEMIT_LIST = 64; /* Send to a list */
202-
constexpr int PS_BRIEF = 0; /* Short PS report */
203-
constexpr int PS_LONG = 1; /* Long PS report */
204-
constexpr int PS_SUMM = 2; /* Queue counts only */
205-
constexpr int PS_ALL = 4; /* List entire queue */
206202
constexpr int SAY_SAY = 1; /* say in current room */
207203
constexpr int SAY_NOSPACE = 1; /* OR with xx_EMIT to get nospace form */
208204
constexpr int SAY_POSE = 2; /* pose in current room */

0 commit comments

Comments
 (0)