diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-09-30 10:17:24 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-09-30 10:17:28 -0700 |
commit | 49e5c4af12a9b276a72a9d04033d86a1c4d68601 (patch) | |
tree | f29c87fd82fffb486bd999e63f59a7c50b4e1870 | |
parent | 580d4c103f2fa8b5d72e4221385238b1153dc2ca (diff) | |
download | tmwa-49e5c4af12a9b276a72a9d04033d86a1c4d68601.tar.gz tmwa-49e5c4af12a9b276a72a9d04033d86a1c4d68601.tar.bz2 tmwa-49e5c4af12a9b276a72a9d04033d86a1c4d68601.tar.xz tmwa-49e5c4af12a9b276a72a9d04033d86a1c4d68601.zip |
Show different GM level types in the online list
This removes the setting for the single control.
-rw-r--r-- | src/char/char.cpp | 36 |
1 files 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<int> 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, " <td>"); - if (gml >= online_gm_display_min_level) + if (*suffix) FPRINTF(fp2, "<b>"); 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, "</b> (GM)"); + + if (*suffix) + FPRINTF(fp2, "</b> %s", suffix); + FPRINTF(fp2, "</td>\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()); |