diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-01-03 22:39:49 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-01-03 22:39:49 +0100 |
commit | c3c80d017e0d27a1659458419afedf44882832b0 (patch) | |
tree | 69911bee42c2787d50942c6ce60735eb7084f450 | |
parent | 906d765382233c07db7bfd74164e3a66e8abbfb9 (diff) |
Reformatted who_terse()
-rw-r--r-- | FICS/comproc.c | 110 |
1 files changed, 58 insertions, 52 deletions
diff --git a/FICS/comproc.c b/FICS/comproc.c index c89a21d..7f2a992 100644 --- a/FICS/comproc.c +++ b/FICS/comproc.c @@ -725,59 +725,65 @@ AddPlayerLists(int p1, char *ptmp) strcat(ptmp, "(B)"); } -PRIVATE void who_terse(int p, int num, int *plist, int type) +PRIVATE void +who_terse(int p, int num, int *plist, int type) { - char ptmp[80 + 20]; /* for highlight */ - multicol *m = multicol_start(PARRAY_SIZE); - int i; - int p1; - int rat; - - /* altered DAV 3/15/95 */ - - for (i = 0; i < num; i++) { - p1 = plist[i]; - - if (type == blitz_rat) - rat = parray[p1].b_stats.rating; - else if (type == wild_rat) - rat = parray[p1].w_stats.rating; - else if (type == std_rat) - rat = parray[p1].s_stats.rating; - else if (type == light_rat) - rat = parray[p1].l_stats.rating; - - if (type == none) { - sprintf(ptmp, " "); - } else { - sprintf(ptmp, "%-4s", ratstrii(rat, parray[p1].registered)); - if (parray[p1].simul_info.numBoards) { - strcat(ptmp, "~"); - } else if ((parray[p1].game >= 0) && (garray[parray[p1].game].status == GAME_EXAMINE)) { - strcat(ptmp, "#"); - } else if (parray[p1].game >= 0) { - strcat(ptmp, "^"); - } else if (!parray[p1].open) { - strcat(ptmp, ":"); - } else if (player_idle(p1) > 300) { - strcat(ptmp, "."); - } else { - strcat(ptmp, " "); - } - } - - if (p == p1) { - psprintf_highlight(p, ptmp + strlen(ptmp), "%s", parray[p1].name); - } else { - strcat(ptmp, parray[p1].name); - } - - AddPlayerLists(p1, ptmp); - multicol_store(m, ptmp); - } - multicol_pprint(m, p, 80, 2); - multicol_end(m); - pprintf(p, "\n %d players displayed (of %d). (*) indicates system administrator.\n", num, player_count(1)); + char ptmp[80 + 20] = { '\0' }; // for highlight + int i; + int p1; + int rat; + multicol *m = multicol_start(PARRAY_SIZE); + + for (i = 0; i < num; i++) { + p1 = plist[i]; + + if (type == blitz_rat) + rat = parray[p1].b_stats.rating; + else if (type == wild_rat) + rat = parray[p1].w_stats.rating; + else if (type == std_rat) + rat = parray[p1].s_stats.rating; + else if (type == light_rat) + rat = parray[p1].l_stats.rating; + + if (type == none) { + sprintf(ptmp, " "); + } else { + sprintf(ptmp, "%-4s", ratstrii(rat, + parray[p1].registered)); + + if (parray[p1].simul_info.numBoards) { + strcat(ptmp, "~"); + } else if (parray[p1].game >= 0 && + garray[parray[p1].game].status == GAME_EXAMINE) { + strcat(ptmp, "#"); + } else if (parray[p1].game >= 0) { + strcat(ptmp, "^"); + } else if (!parray[p1].open) { + strcat(ptmp, ":"); + } else if (player_idle(p1) > 300) { + strcat(ptmp, "."); + } else { + strcat(ptmp, " "); + } + } + + if (p == p1) { + psprintf_highlight(p, ptmp + strlen(ptmp), "%s", + parray[p1].name); + } else { + strcat(ptmp, parray[p1].name); + } + + AddPlayerLists(p1, ptmp); + multicol_store(m, ptmp); + } + + multicol_pprint(m, p, 80, 2); + multicol_end(m); + + pprintf(p, "\n %d players displayed (of %d). (*) indicates system " + "administrator.\n", num, player_count(1)); } PRIVATE void |