Just thought I would pass along this little cut and paste code. Using this
will retrieve the
password of any given player. If you have ever been approached by a mortal
or ever received an email from a mudder asking for their password, this
code will help you do just that.
I suggest that only IMPS have this command and that you actually come up
with some policy for giving out a password...maybe you don't give them out,
but if you wanted to.....
Also, I may be showing some of my ignorance in that, there may already be
some nice little utility already built into the mud that does this, but I
haven't found it.
Have fun, and thanks for everyones contributions to this list
Abram - Legends of Blades and Magic
/* I put this in act.wizard.c */
ACMD(get_password)
{
struct char_data *victim = 0;
struct char_file_u tmp_store;
half_chop(argument, buf1, buf2);
if (!*buf1) {
send_to_char("Usage: passwd 'live/file' 'playername'\r\n", ch);
return;
}
if (is_abbrev(buf1, "live")) {
if (!*buf2) {
send_to_char("Whose Password?\r\n", ch);
} else {
if ((victim = get_player_vis(ch, buf2, 0))) {
sprintf(buf, "%s\r\n", GET_PASSWD(victim));
send_to_char(buf, ch);
}
else
send_to_char("No such player around.\r\n", ch);
}
}
if (is_abbrev(buf1, "file")) {
if (!*buf2) {
send_to_char("Whose Password?\r\n", ch);
} else {
CREATE(victim, struct char_data, 1);
clear_char(victim);
if (load_char(buf2, &tmp_store) > -1) {
store_to_char(&tmp_store, victim);
char_to_room(victim, 0);
if (GET_LEVEL(victim) > GET_LEVEL(ch))
send_to_char("Sorry, you can't do that.\r\n", ch);
else {
sprintf(buf, "%s\r\n", GET_PASSWD(victim));
send_to_char(buf, ch);
extract_char(victim);
}
} else {
send_to_char("There is no such player.\r\n", ch);
free(victim);
}
}
}
}
/* Don't forget to add this ACMD to interpreter.c along with some command name (duh) */
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST