Example #1
0
void
account_display_trusted(struct account *account, struct creature *ch)
{
    int col = 0;

    for (GList *it = account->trusted;it;it = it->next) {
        int idnum = GPOINTER_TO_INT(it->data);

        if (player_idnum_exists(idnum)) {
            send_to_char(ch, "%20s   ", player_name_by_idnum(idnum));
            col += 1;
            if (col > 2) {
                send_to_char(ch, "\r\n");
                col = 0;
            }
        }
    }
    if (col)
        send_to_char(ch, "\r\n");
}
Example #2
0
static void
show_dyntext(struct creature *ch, dynamic_text_file * dyntext, char *argument)
{
    int i;

    if (dyntext) {

        if (!*argument) {
            send_to_char(ch,
                "DYNTEXT: filename: '%s'\r\n"
                "             last: %s (%d) @ %s\r"
                "            level: %d\r\n"
                "             lock: %s (%d)\r\n"
                "              old: %-3s (Len: %zd)\r\n"
                "              new: %-3s (Len: %zd)\r\n",
                dyntext->filename,
                player_name_by_idnum(dyntext->last_edit[0].idnum),
                dyntext->last_edit[0].idnum,
                ctime(&(dyntext->last_edit[0].tEdit)),
                dyntext->level,
                player_name_by_idnum(dyntext->lock),
                dyntext->lock,
                YESNO(dyntext->buffer),
                dyntext->buffer ? strlen(dyntext->buffer) : 0,
                YESNO(dyntext->tmp_buffer),
                dyntext->tmp_buffer ? strlen(dyntext->tmp_buffer) : 0);
            return;
        }
        // there was an argument, parse it
        if (is_abbrev(argument, "old")) {
            if (!dyntext->buffer) {
                send_to_char(ch, "There is no old text buffer.\r\n");
            } else {
                page_string(ch->desc, dyntext->buffer);
            }
        } else if (is_abbrev(argument, "new")) {
            if (!dyntext->tmp_buffer) {
                send_to_char(ch, "There is no new text buffer.\r\n");
            } else {
                page_string(ch->desc, dyntext->tmp_buffer);
            }
        } else if (is_abbrev(argument, "perms")) {
            send_to_char(ch, "Permissions defined:\r\n");
            for (i = 0; i < DYN_TEXT_PERM_SIZE; i++) {
                send_to_char(ch, "%3d.] (%5d) %s\r\n",
                    i, dyntext->perms[i],
                    player_name_by_idnum(dyntext->perms[i]));
            }
        } else if (is_abbrev(argument, "last")) {
            send_to_char(ch, "Last edits:\r\n");
            for (i = 0; i < DYN_TEXT_HIST_SIZE; i++) {
                send_to_char(ch, "%3d.] (%5d) %30s @ %s\r",
                    i, dyntext->last_edit[i].idnum,
                    player_name_by_idnum(dyntext->last_edit[i].idnum),
                    ctime(&(dyntext->last_edit[i].tEdit)));
            }

        } else {
            send_to_char(ch, "Unknown argument for show.\r\n");
            show_dynedit_options(ch);
        }
        return;
    }
    send_to_char(ch, "DYNTEXT LIST:\r\n");
    for (dyntext = dyntext_list; dyntext; dyntext = dyntext->next)
        send_to_char(ch, "%s\r\n", dyntext->filename);

}