/* doesn't really belong here, but I couldn't figure out where else */ void do_page(dbref player, const char *arg1, const char *arg2) { int ignored; char buf[BUFFER_LEN], buf2[BUFFER_LEN]; dbref target; if (!payfor(player, tp_lookup_cost)) { anotify_fmt(player, CFAIL "You don't have enough %s.", tp_pennies); return; } if ( strcmp(arg1, "me") ) { if ((target = lookup_player(arg1)) == NOTHING) { anotify(player, CINFO WHO_MESG); return; } } else target = player; if(Guest(player)) { if(!Mage(target)) { anotify(player, CINFO "Guests can only page " NAMEWIZ "s, type 'wizzes'."); return; } } if (FLAGS(target) & HAVEN) { anotify(player, CFAIL "That player is haven."); return; } ignored = ignoring(target, player); if(ignored == 1) { anotify(player, CFAIL "That player is ignoring you."); return; } else if(ignored == 2) { anotify(player, CINFO "That player is ignoring you."); } do_parse_mesg(player, player, arg2, "(page)", buf, MPI_ISPRIVATE); tct(buf,buf2); if (!*buf2) { sprintf(buf, CGREEN "You sense that %s is looking for you in %s.", PNAME(player), NAME(DBFETCH(player)->location)); } else { if(buf2[0] == ':' || buf2[0] == ';') { sprintf(buf, CGREEN "%s pages \"" CYELLOW "%s %.3900s" CGREEN "\"", PNAME(player), PNAME(player), buf2); } else { sprintf(buf, CGREEN "%s pages \"" CYELLOW "%.3900s" CGREEN "\"", PNAME(player), buf2); } } if (anotify_from(player, target, buf)) anotify(player, CSUCC "Your message has been sent."); else { sprintf(buf, CINFO "%s is not connected.", PNAME(target)); anotify(player, buf); } }
/* doesn't really belong here, but I couldn't figure out where else */ void do_page(int descr, dbref player, const char *arg1, const char *arg2) { char buf[BUFFER_LEN], buf2[BUFFER_LEN]; dbref target; if (!payfor(player, tp_lookup_cost)) { anotify_fmt(player, CFAIL "You don't have enough %s.", tp_pennies); return; } if (strcmp(arg1, "me")) { if ((target = lookup_player(arg1)) == NOTHING) { anotify_nolisten2(player, CINFO "Who?"); return; } } else target = player; if (Guest(player)) { if (!Mage(target)) { anotify_nolisten2(player, CINFO "Guests can only page wizards, type 'wizzes'."); return; } } if (FLAGS(target) & HAVEN) { anotify_nolisten2(player, CFAIL "That player is haven."); return; } if (Meeper(OWNER(player))) { do_parse_mesg(descr, player, player, arg2, "(page)", buf, MPI_ISPRIVATE); tct(buf, buf2); } else { tct(arg2, buf2); } if (!*buf2) { sprintf(buf, CSUCC "You sense that %s is looking for you in %s.", PNAME(player), NAME(DBFETCH(player)->location)); } else { if (buf2[0] == ':' || buf2[0] == ';') { sprintf(buf, SYSGREEN "%s pages \"" SYSYELLOW "%s %s" SYSGREEN "\"", PNAME(player), PNAME(player), buf2); } else { sprintf(buf, SYSGREEN "%s pages \"" SYSYELLOW "%s" SYSGREEN "\"", PNAME(player), buf2); } } if (anotify_from(player, target, buf)) anotify_nolisten2(player, CSUCC "Your message has been sent."); else { sprintf(buf, CSUCC "%s is not connected.", PNAME(target)); anotify_nolisten2(player, buf); } }
void do_whisper(int descr, dbref player, const char *arg1, const char *arg2) { dbref who; char buf[BUFFER_LEN], buf2[BUFFER_LEN]; struct match_data md; if (Guest(player)) { anotify_fmt(player, CFAIL "%s", tp_noguest_mesg); return; } init_match(descr, player, arg1, TYPE_PLAYER, &md); match_neighbor(&md); match_me(&md); if (Mage(player) && Typeof(player) == TYPE_PLAYER) { match_absolute(&md); match_player(&md); } switch (who = match_result(&md)) { case NOTHING: anotify_nolisten2(player, CINFO "Who?"); break; case AMBIGUOUS: anotify_nolisten2(player, CINFO "I don't know who you mean!"); break; default: if (Meeper(OWNER(player))) { do_parse_mesg(descr, player, player, arg2, "(whisper)", buf, MPI_ISPRIVATE); tct(buf, buf2); } else { tct(arg2, buf2); } if (buf2[0] == ':' || buf2[0] == ';') { sprintf(buf, SYSBLUE "%s whispers, \"" SYSPURPLE "%s %s" SYSBLUE "\"", PNAME(player), PNAME(player), buf2 + 1); if (!anotify_from(player, who, buf)) { sprintf(buf, SYSBLUE "%s is not connected.", PNAME(who)); anotify_nolisten2(player, buf); break; } sprintf(buf, SYSBLUE "You whisper, \"" SYSPURPLE "%s %s" SYSBLUE "\" to %s.", PNAME(player), buf2 + 1, PNAME(who)); anotify(player, buf); break; } else { sprintf(buf, SYSBLUE "%s whispers, \"" SYSPURPLE "%s" SYSBLUE "\"", PNAME(player), buf2); if (!anotify_from(player, who, buf)) { sprintf(buf, SYSBLUE "%s is not connected.", PNAME(who)); anotify_nolisten2(player, buf); break; } sprintf(buf, SYSBLUE "You whisper, \"" SYSPURPLE "%s" SYSBLUE "\" to %s.", buf2, PNAME(who)); anotify(player, buf); break; } } }
void do_whisper(dbref player, const char *arg1, const char *arg2) { int ignored; dbref who; char buf[BUFFER_LEN], buf2[BUFFER_LEN]; struct match_data md; if(Guest(player)) { anotify(player, CFAIL NOGUEST_MESG); return; } init_match(player, arg1, TYPE_PLAYER, &md); match_neighbor(&md); match_me(&md); if (Mage(player) && Typeof(player) == TYPE_PLAYER) { match_absolute(&md); match_player(&md); } switch (who = match_result(&md)) { case NOTHING: case AMBIGUOUS: anotify(player, CINFO WHO_MESG); break; default: ignored = ignoring(who, player); if(ignored == 1) { anotify(player, CFAIL "That player is ignoring you."); return; } else if(ignored == 2) { anotify(player, CINFO "That player is ignoring you."); } do_parse_mesg(player, player, arg2, "(whisper)", buf, MPI_ISPRIVATE); tct(buf,buf2); if (buf2[0] == ':' || buf2[0] == ';') { sprintf(buf, CBLUE "%s whispers, \"" CPURPLE "%s %.3900s" CBLUE "\"", PNAME(player), PNAME(player), buf2+1); if (!anotify_from(player, who, buf)) { sprintf(buf, CBLUE "%s is not connected.", PNAME(who)); anotify(player, buf); break; } sprintf(buf, CBLUE "You whisper, \"" CPURPLE "%s %.3900s" CBLUE "\" to %s.", PNAME(player), buf2+1, PNAME(who)); anotify(player, buf); break; } else { sprintf(buf, CBLUE "%s whispers, \"" CPURPLE "%.3900s" CBLUE "\"", PNAME(player), buf2); if (!anotify_from(player, who, buf)) { sprintf(buf, CBLUE "%s is not connected.", PNAME(who)); anotify(player, buf); break; } sprintf(buf, CBLUE "You whisper, \"" CPURPLE "%.3900s" CBLUE "\" to %s.", buf2, PNAME(who)); anotify(player, buf); break; } } }