Added admin levels to who list, and minor bug fixes

This commit is contained in:
JamDog 2010-11-25 20:34:26 +00:00
parent 5acbfd29eb
commit a95ac76ef7
5 changed files with 16 additions and 6 deletions

View file

@ -40,6 +40,7 @@ Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
Bug-Fix: admin <player> default now targets the victim player Bug-Fix: admin <player> default now targets the victim player
Bug-Fix: Crash bug developed due to no 'vict' in is_tell_ok, added checks Bug-Fix: Crash bug developed due to no 'vict' in is_tell_ok, added checks
Added HIDDEN flag for doors, hiding from exits, autoexits, scan and map Added HIDDEN flag for doors, hiding from exits, autoexits, scan and map
Admins now show admin level instead of class on who list
[Nov 24 2010] - Jamdog [Nov 24 2010] - Jamdog
Split mortal and admin levels (thanks fnord for original patch/idea) Split mortal and admin levels (thanks fnord for original patch/idea)
Mortal level converted to ubyte for 255 max Mortal level converted to ubyte for 255 max

View file

@ -1146,7 +1146,7 @@ ACMD(do_who)
struct descriptor_data *d; struct descriptor_data *d;
struct char_data *tch; struct char_data *tch;
int i, num_can_see = 0; int i, num_can_see = 0;
char name_search[MAX_INPUT_LENGTH], buf[MAX_INPUT_LENGTH]; char name_search[MAX_INPUT_LENGTH], buf[MAX_INPUT_LENGTH], admlev[15];
char mode; char mode;
int low = 0, high = CONFIG_MAX_LEVEL, localwho = 0, questwho = 0; int low = 0, high = CONFIG_MAX_LEVEL, localwho = 0, questwho = 0;
int showclass = 0, short_list = 0, outlaws = 0; int showclass = 0, short_list = 0, outlaws = 0;
@ -1301,16 +1301,20 @@ ACMD(do_who)
if (showleader && (!tch->followers || !AFF_FLAGGED(tch, AFF_GROUP))) if (showleader && (!tch->followers || !AFF_FLAGGED(tch, AFF_GROUP)))
continue; continue;
sprintf(admlev, "%11s", admin_level_names[(GET_ADMLEVEL(tch))]);
if (short_list) { if (short_list) {
send_to_char(ch, "%s[%2d %s] %-12.12s%s%s", send_to_char(ch, "%s[%2d %s] %-12.12s%s%s",
(IS_ADMIN(tch, ADMLVL_IMMORT) ? CCYEL(ch, C_SPR) : ""), (IS_ADMIN(tch, ADMLVL_IMMORT) ? CCYEL(ch, C_SPR) : ""),
GET_LEVEL(tch), CLASS_ABBR(tch), GET_NAME(tch), GET_LEVEL(tch),
(IS_ADMIN(tch, ADMLVL_IMMORT) ? admlev : CLASS_ABBR(tch)),
GET_NAME(tch),
CCNRM(ch, C_SPR), ((!(++num_can_see % 4)) ? "\r\n" : "")); CCNRM(ch, C_SPR), ((!(++num_can_see % 4)) ? "\r\n" : ""));
} else { } else {
num_can_see++; num_can_see++;
send_to_char(ch, "%s[%2d %s] %s%s%s%s", send_to_char(ch, "%s[%2d %s] %s%s%s%s",
(IS_ADMIN(tch, ADMLVL_IMMORT) ? CCYEL(ch, C_SPR) : ""), (IS_ADMIN(tch, ADMLVL_IMMORT) ? CCYEL(ch, C_SPR) : ""),
GET_LEVEL(tch), CLASS_ABBR(tch), GET_LEVEL(tch),
(IS_ADMIN(tch, ADMLVL_IMMORT) ? admlev : CLASS_ABBR(tch)),
GET_NAME(tch), (*GET_TITLE(tch) ? " " : ""), GET_TITLE(tch), GET_NAME(tch), (*GET_TITLE(tch) ? " " : ""), GET_TITLE(tch),
CCNRM(ch, C_SPR)); CCNRM(ch, C_SPR));

View file

@ -1655,9 +1655,9 @@ ACMD(do_admin)
changed = FALSE; changed = FALSE;
if (IS_NPC(vict)) { if (IS_NPC(vict)) {
send_to_char(ch, "%s is a mob, and mobs can't have admin privs!", GET_NAME(vict)); send_to_char(ch, "%s is a mob, and mobs can't have admin privs!\r\n", GET_NAME(vict));
} else if (GET_ADMLEVEL(vict) > GET_ADMLEVEL(ch)) { } else if (GET_ADMLEVEL(vict) > GET_ADMLEVEL(ch)) {
send_to_char(ch, "%s is a higher admin level, you can't change their admin privs!", GET_NAME(vict)); send_to_char(ch, "%s is a higher admin level, you can't change their admin privs!\r\n", GET_NAME(vict));
} else if (!*arg2) { } else if (!*arg2) {
// Display player's current admin settings // Display player's current admin settings
send_to_char(ch, "%sAdmin information for %s%s\r\n", QBWHT, GET_NAME(vict), QNRM); send_to_char(ch, "%sAdmin information for %s%s\r\n", QBWHT, GET_NAME(vict), QNRM);

View file

@ -1725,6 +1725,11 @@ ACMD(do_cmdinfo)
one_argument(argument, arg); one_argument(argument, arg);
if (!*arg) {
send_to_char(ch, "Usage: %scmdinfo <command>%s", QYEL, QNRM);
return;
}
for (length = strlen(arg), c = 0; *complete_cmd_info[c].command != '\n'; c++) { for (length = strlen(arg), c = 0; *complete_cmd_info[c].command != '\n'; c++) {
if(!strncmp(complete_cmd_info[c].command, arg, length)) if(!strncmp(complete_cmd_info[c].command, arg, length))
break; break;

View file

@ -797,7 +797,7 @@ void redit_parse(struct descriptor_data *d, char *arg)
case REDIT_EXIT_DOORFLAGS: case REDIT_EXIT_DOORFLAGS:
number = atoi(arg); number = atoi(arg);
if (number < 0 || number > 2) { if (number < 0 || number > 4) {
write_to_output(d, "That's not a valid choice!\r\n"); write_to_output(d, "That's not a valid choice!\r\n");
redit_disp_exit_flag_menu(d); redit_disp_exit_flag_menu(d);
} else { } else {