/* A new "surfers" style staff list by Silver ------------------------------------------ Ideal for those talkers where there is only a small number of staff and large gaps between the ranks. To install: Replace your current staff_list function with this one. Recompile and reboot. */ void staff_list(player *p, char *str) { char *oldstack = stack; char temp[70]; int i = 1, counter, charcounter, len, numres = 0, numstaff = 0; int ratio_staff = 0, ratio_res = 0, gcf, maxi = 8; saved_player *scanlist, **hlist; int pos = 1; sprintf(temp, "%s Staff", get_config_msg("talker_name")); pstack_mid(temp); sprintf(stack, "\n "); stack = strchr(stack, 0); /* Only psu's and above can see psu's listed on "staff" */ if (!(p->residency & (PSU | SU | ADMIN))) maxi = 7; for (i = 1; i < maxi; i++) { switch (i) { case 1: strcpy(temp, get_config_msg("hc_name")); break; case 2: strcpy(temp, get_config_msg("coder_name")); break; case 3: strcpy(temp, get_config_msg("admin_name")); break; case 4: strcpy(temp, get_config_msg("la_name")); break; case 5: strcpy(temp, get_config_msg("asu_name")); break; case 6: strcpy(temp, get_config_msg("su_name")); break; case 7: strcpy(temp, get_config_msg("psu_name")); break; } numres = 0; for (charcounter = 0; charcounter < 26; charcounter++) { hlist = saved_hash[charcounter]; for (counter = 0; counter < HASH_SIZE; counter++, hlist++) for (scanlist = *hlist; scanlist; scanlist = scanlist->next) { switch (scanlist->residency) { case SYSTEM_ROOM: case BANISHED: case BANISHD: break; default: numres++; if ((i == 1 && most_highest_priv(scanlist) == HCADMIN) || (i == 2 && most_highest_priv(scanlist) == CODER) || (i == 3 && most_highest_priv(scanlist) == ADMIN) || (i == 4 && most_highest_priv(scanlist) == LOWER_ADMIN) || (i == 5 && most_highest_priv(scanlist) == ASU) || (i == 6 && most_highest_priv(scanlist) == SU) || (i == 7 && most_highest_priv(scanlist) == PSU)) { len = 30 - (strlen(temp) + strlen(scanlist->lower_name)); sprintf(stack, "%s ", check_legal_entry(p, scanlist->lower_name, 0)); stack = strchr(stack, 0); while (len > 0) { stack += sprintf(stack, "."); len--; } sprintf(stack, " %s", temp); stack = strchr(stack, 0); if (pos == 1) stack += sprintf(stack, " "); else stack += sprintf(stack, "\n "); pos = -pos; numstaff++; } break; } } } } if (pos == -1) sprintf(stack, "\n\n"); else sprintf(stack, "\n"); stack = strchr(stack, 0); /* Calculate ratios */ if (numstaff != 0) { gcf = greatest_common_factor(numres, numstaff); ratio_staff = numstaff / gcf; ratio_res = numres / gcf; } sprintf(temp, "%d staff listed (staff to resident ratio is %d:%d)", numstaff, ratio_staff, ratio_res); pstack_mid(temp); *stack++ = 0; pager(p, oldstack); stack = oldstack; }