COMMAND(cmd_prompt)
{
dbref who;
- DESC *d;
char *prompt;
- char *tmp;
switch (who =
match_result(player, arg_left, NOTYPE,
} else
prompt = (char *) UNDEFINED_PROMPT;
- DESC_ITER_CONN(d) {
- if (d->player == who) {
- if (PromptConnection(d)) {
- if (ShowAnsiColor(d->player))
- tmp = tprintf("%s %c%c", prompt, IAC, GOAHEAD);
- else
- tmp =
- tprintf("%s %c%c", remove_markup(prompt, NULL), IAC,
- GOAHEAD);
- } else {
- if (ShowAnsiColor(d->player))
- tmp = tprintf("%s \r\n", prompt);
- else
- tmp = tprintf("%s \r\n", remove_markup(prompt, NULL));
- }
- queue_newwrite(d, (unsigned char *) tmp, strlen(tmp));
- }
- }
+ notify_anything(orator, na_one, &(who), NULL, NA_PROMPT, prompt);
+
}
}
FUNCTION(fun_prompt)
{
dbref who;
- DESC *d;
char *prompt;
- char *tmp;
- switch (who =
- match_result(executor, args[0], NOTYPE,
- MAT_OBJECTS | MAT_HERE | MAT_CONTAINER)) {
- case NOTHING:
+ who = match_result(executor, args[0], NOTYPE, MAT_OBJECTS | MAT_HERE | MAT_CONTAINER);
+
+ if(who == NOTHING)
safe_str(T(e_match), buff, bp);
- break;
- case AMBIGUOUS:
+ else if(who == AMBIGUOUS)
safe_str(T("#-2 AMBIGUOUS MATCH"), buff, bp);
- break;
- default:
+ else {
if (!CanProg(executor, who)) {
safe_str(T(e_perm), buff, bp);
return;
else
prompt = (char *) UNDEFINED_PROMPT;
- DESC_ITER_CONN(d) {
- if (d->player == who) {
- if (PromptConnection(d)) {
- if (ShowAnsiColor(who))
- tmp = tprintf("%s %c%c", prompt, IAC, GOAHEAD);
- else
- tmp =
- tprintf("%s %c%c", remove_markup(prompt, NULL), IAC,
- GOAHEAD);
- } else {
- if (ShowAnsiColor(who))
- tmp = tprintf("%s \r\n", prompt);
- else
- tmp = tprintf("%s \r\n", remove_markup(prompt, NULL));
- }
- queue_newwrite(d, (unsigned char *) tmp, strlen(tmp));
- }
- }
+ notify_anything(orator, na_one, &(who), NULL, NA_PROMPT, prompt);
}
}
d->pinfo.lock = atoi(p);
d->input_handler = prog_handler;
memset(wprmpt, '\0', 2);
+ /* TODO: Modify so it only goes tot he connecting port */
+
if ((a = atr_get(d->player, "XY_PROGPROMPT"))) {
/* program prompt */
char rbuf[BUFFER_LEN], *tbp, *rbp;
d->pinfo.object, d->pinfo.object, PE_DEFAULT,
PT_DEFAULT, (PE_Info *) NULL);
+
*rbp = '\0';
- if (PromptConnection(d)) {
- if (ShowAnsiColor(d->player))
- snprintf(buf, BUFFER_LEN - 1, "%s %c%c", rbuf, IAC, GOAHEAD);
- else
- snprintf(buf, BUFFER_LEN - 1, "%s %c%c",
- remove_markup(rbuf, NULL), IAC, GOAHEAD);
- } else {
- if (ShowAnsiColor(d->player))
- snprintf(buf, BUFFER_LEN - 1, "%s\r\n", rbuf);
- else
- snprintf(buf, BUFFER_LEN - 1, "%s\r\n", remove_markup(rbuf, NULL));
- }
+
+ notify_anything(orator, na_one, &(d->player), NULL, NA_PROMPT, rbuf);
} else {
- if (PromptConnection(d)) {
- if (ShowAnsi(d->player))
- snprintf(buf, BUFFER_LEN - 1, "%s>%s %c%c", ANSI_HILITE,
- ANSI_NORMAL, IAC, GOAHEAD);
- else
- snprintf(buf, BUFFER_LEN - 1, "> %c%c", IAC, GOAHEAD);
- } else {
- if (ShowAnsi(d->player))
- snprintf(buf, BUFFER_LEN - 1, "%s>%s\r\n", ANSI_HILITE,
+ snprintf(buf, BUFFER_LEN - 1, "%s>%s", ANSI_HILITE,
ANSI_NORMAL);
- else
- snprintf(buf, BUFFER_LEN - 1, ">\r\n");
- }
+ notify_anything(orator, na_one, &(d->player), NULL, NA_PROMPT, buf);
}
- queue_newwrite(d, (unsigned char *) buf, strlen(buf));
- process_output(d);
}
void