From 49e5c4af12a9b276a72a9d04033d86a1c4d68601 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 30 Sep 2013 10:17:24 -0700 Subject: Show different GM level types in the online list This removes the setting for the single control. --- src/char/char.cpp | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/char/char.cpp b/src/char/char.cpp index 071076e..6bc0007 100644 --- a/src/char/char.cpp +++ b/src/char/char.cpp @@ -140,8 +140,6 @@ static int online_sorting_option = 0; // sorting option to display online players in online files static int online_refresh_html = 20; // refresh time (in sec) of the html file in the explorer -static -int online_gm_display_min_level = 20; // minimum GM level to display 'GM' when we want to display it static std::vector online_chars; // same size of char_data, and id value of current server (or -1) @@ -774,15 +772,23 @@ void create_online_files(void) { // without/with 'GM' display int gml = isGM(cd.account_id); - { - if (gml >= online_gm_display_min_level) - FPRINTF(fp, "%-24s (GM) ", cd.name); - else - FPRINTF(fp, "%-24s ", cd.name); - } + const char *suffix = ""; + if (gml) + suffix = "(special)"; + if (gml == 1) + suffix = "(bot)"; + if (gml == 40 || gml == 80) + suffix = "(dev)"; + if (gml == 60) + suffix = "(gm)"; + if (gml == 99) + suffix = "(admin)"; + + FPRINTF(fp, "%-24s %s", cd.name, suffix); + // name of the character in the html (no < >, because that create problem in html code) FPRINTF(fp2, " "); - if (gml >= online_gm_display_min_level) + if (*suffix) FPRINTF(fp2, ""); for (char c : cd.name.to__actual()) { @@ -802,8 +808,10 @@ void create_online_files(void) break; }; } - if (gml >= online_gm_display_min_level) - FPRINTF(fp2, " (GM)"); + + if (*suffix) + FPRINTF(fp2, " %s", suffix); + FPRINTF(fp2, "\n"); } FPRINTF(fp, "\n"); @@ -2739,12 +2747,6 @@ int char_config_read(ZString cfgName) { online_sorting_option = atoi(w2.c_str()); } - else if (w1 == "online_gm_display_min_level") - { // minimum GM level to display 'GM' when we want to display it - online_gm_display_min_level = atoi(w2.c_str()); - if (online_gm_display_min_level < 5) // send online file every 5 seconds to player is enough - online_gm_display_min_level = 5; - } else if (w1 == "online_refresh_html") { online_refresh_html = atoi(w2.c_str()); -- cgit v1.2.3-70-g09d2