extern void do_page(dbref player, const char *arg1, const char *arg2,
dbref cause, int noeval, int multipage, int override,
int has_eq);
-extern void do_page_port(dbref player, const char *arg1, const char *arg2);
+extern void do_page_port(dbref player, const char *arg1, const char *arg2, bool noeval_msg);
extern void do_think(dbref player, const char *message);
#define PEMIT_SILENT 0x1
#define PEMIT_LIST 0x2
* \param message message to send.
*/
void
-do_page_port(dbref player, const char *pc, const char *message)
+do_page_port(dbref player, const char *pc, const char *message, bool eval_msg)
{
int p, key;
DESC *d;
const char *gap;
+ char mbuf[BUFFER_LEN], *mbp = mbuf;
char tbuf[BUFFER_LEN], *tbp = tbuf;
dbref target = NOTHING;
notify(player, T("Permission denied."));
return;
}
- p = atoi(pc);
+
+ process_expression(tbuf, &tbp, &pc, player, cause, cause, PE_DEFAULT, PT_DEFAULT, NULL);
+ *tbp = '\0';
+ p = atoi(tbuf);
+ tbp = tbuf;
+
if (p <= 0) {
notify(player, T("That's not a port number."));
return;
}
- if (!message || !*message) {
+ if (!message) {
notify(player, T("What do you want to page with?"));
return;
}
+ if (eval_msg) {
+ process_expression(mbuf, &mbp, &message, player, cause, cause, PE_DEFAULT, PT_DEFAULT, NULL);
+ *mbp = '\0';
+ message = mbuf;
+ }
+
+ if (!*message) {
+ notify(player, T("What do you want to page with?"));
+ return;
+ }
+
gap = " ";
switch (*message) {
case SEMI_POSE_TOKEN:
COMMAND (cmd_page) {
if (SW_ISSET(sw, SWITCH_PORT))
- do_page_port(player, arg_left, arg_right);
+ do_page_port(player, cause, arg_left, arg_right, !SW_ISSET(sw, SWITCH_NOEVAL));
else
do_page(player, arg_left, arg_right, cause, SW_ISSET(sw, SWITCH_NOEVAL),
!(SW_ISSET(sw, SWITCH_BLIND) ||