See also @emit, @oemit, @remit, NOSPOOF, and SPOOFING.
& @poll
- @poll [<poll question>]
-
- This command requiring the poll power sets the "poll", the Doing
- question on the WHO, the poll questoin can also be reset to the
- string "Doing" by simply typing the command with no argument attached.
+ @poll
+ @poll <poll question>
+ @poll/clear
+
+ This command manipulates the message at the top of WHO/DOING. By itself,
+ it displays the current poll. Those with sufficient power can set
+ or clear the message by using the second or third forms, respectively.
+ Clearing the message sets it to the default, 'Doing'.
See also: @doing, WHO, DOING
& @poor
extern void hide_player(dbref player, int hide);
enum motd_type { MOTD_MOTD, MOTD_DOWN, MOTD_FULL, MOTD_LIST };
extern void do_motd(dbref player, enum motd_type key, const char *message);
-extern void do_poll(dbref player, const char *message);
+extern void do_poll(dbref player, const char *message, int clear);
/* From cque.c */
extern int do_wait
(dbref player, dbref cause, char *arg1, char *cmd, int until, char finvoc);
* \endverbatim
* \param player the enactor.
* \param message the message to set.
+ * \param clear true if the poll should be reset to the default 'Doing'
*/
void
-do_poll(dbref player, const char *message)
+do_poll(dbref player, const char *message, int clear)
{
int i;
+ if ((!message || !*message) && !clear) {
+ /* Just display the poll. */
+ notify_format(player, T("The current poll is: %s"), poll_msg);
+ return;
+ }
+
if (!Change_Poll(player)) {
notify(player, T("Who do you think you are, Gallup?"));
return;
}
+
+ if (clear) {
+ strcpy(poll_msg, "Doing");
+ notify(player, T("Poll reset."));
+ return;
+ }
+
strncpy(poll_msg, remove_markup(message, NULL), DOING_LEN - 1);
for (i = 0; i < DOING_LEN; i++) {
if ((poll_msg[i] == '\r') || (poll_msg[i] == '\n') ||
if (strlen(message) >= DOING_LEN) {
poll_msg[DOING_LEN - 1] = 0;
notify_format(player,
- T("Poll set. %zu characters lost."),
+ T("Poll set to '%s'. %zu characters lost."), poll_msg,
strlen(message) - (DOING_LEN - 1));
} else
- notify(player, T("Poll set."));
+ notify_format(player, T("Poll set to: %s"), poll_msg);
do_log(LT_WIZ, player, NOTHING, T("Poll Set to '%s'."), poll_msg);
}
COMMAND (cmd_doing) {
if (SW_ISSET(sw, SWITCH_HEADER))
- do_poll(player, arg_left);
+ do_poll(player, arg_left, 0);
else
do_doing(player, arg_left);
}
}
COMMAND (cmd_poll) {
- do_poll(player, arg_left);
+ do_poll(player, arg_left, SW_ISSET(sw, SWITCH_CLEAR));
}
COMMAND (cmd_poor) {
{"@PEMIT", "LIST CONTENTS SILENT NOISY NOEVAL SPOOF", cmd_pemit,
CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, NULL},
- {"@POLL", NULL, cmd_poll, CMD_T_ANY, NULL},
+ {"@POLL", "CLEAR", cmd_poll, CMD_T_ANY, NULL},
{"@POOR", NULL, cmd_poor, CMD_T_ANY, NULL},
{"@POWER", "ALIAS LIST ADD DELETE", cmd_power, CMD_T_ANY | CMD_T_EQSPLIT , NULL},
{"@POWERGROUP", "AUTO MAX ADD DELETE LIST RAW", cmd_powergroup, CMD_T_ANY | CMD_T_EQSPLIT, NULL},