diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-11-05 15:44:23 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2015-01-22 12:16:59 -0800 |
commit | 57e5142d5c9d326912610e3bd60743420f8a328a (patch) | |
tree | a1402032adf2fdb4b36c1021c933551e4958fb83 /src/char | |
parent | e5b967ec9021f2bbfb373b8c164aada8084846fd (diff) | |
download | tmwa-57e5142d5c9d326912610e3bd60743420f8a328a.tar.gz tmwa-57e5142d5c9d326912610e3bd60743420f8a328a.tar.bz2 tmwa-57e5142d5c9d326912610e3bd60743420f8a328a.tar.xz tmwa-57e5142d5c9d326912610e3bd60743420f8a328a.zip |
Remove unsupportable config settings
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/char.cpp | 50 |
1 files changed, 6 insertions, 44 deletions
diff --git a/src/char/char.cpp b/src/char/char.cpp index 8ce2165..57788ee 100644 --- a/src/char/char.cpp +++ b/src/char/char.cpp @@ -110,7 +110,7 @@ AccountPass passwd; static ServerName server_name; static -CharName wisp_server_name = stringish<CharName>("Server"_s); +const CharName WISP_SERVER_NAME = stringish<CharName>("Server"_s); static IP4Address login_ip; static @@ -131,8 +131,6 @@ IP4Address lan_map_ip = IP4_LOCALHOST; static IP4Mask lan_subnet = IP4Mask(IP4_LOCALHOST, IP4_BROADCAST); static -int char_name_option = 0; // Option to know which letters/symbols are authorised in the name of a character (0: all, 1: only those in char_name_letters, 2: all EXCEPT those in char_name_letters) by [Yor] -static std::bitset<256> char_name_letters; // list of letters/symbols authorised (or not) in a character name. by [Yor] static constexpr GmLevel default_gm_level = GmLevel::from(0_u32); @@ -168,9 +166,6 @@ static auto auth_fifo_iter = auth_fifo.begin(); static -int check_ip_flag = 1; // It's to check IP of a player between char-server and other servers (part of anti-hacking system) - -static CharId char_id_count = wrap<CharId>(150000); static std::vector<CharPair> char_keys; @@ -192,8 +187,6 @@ AString online_txt_filename = "online.txt"_s; static AString online_html_filename = "online.html"_s; 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 GmLevel online_gm_display_min_level = GmLevel::from(20_u32); // minimum GM level to display 'GM' when we want to display it @@ -490,7 +483,7 @@ bool extract(XString str, CharPair *cp) else if (!extract(hair_style, &p->hair)) return false; - if (wisp_server_name == k->name) + if (WISP_SERVER_NAME == k->name) return false; // TODO replace *every* lookup with a map lookup @@ -688,7 +681,6 @@ CharPair *make_new_char(Session *s, CharName name, const Stats6& stats, uint8_t } // Check Authorised letters/symbols in the name of the character - if (char_name_option == 1) { // only letters/symbols in char_name_letters are authorised for (uint8_t c : name.to__actual()) @@ -699,17 +691,6 @@ CharPair *make_new_char(Session *s, CharName name, const Stats6& stats, uint8_t return nullptr; } } - else if (char_name_option == 2) - { - // letters/symbols in char_name_letters are forbidden - for (uint8_t c : name.to__actual()) - if (char_name_letters[c]) - { - CHAR_LOG("Make new char error (invalid letter in the name): (connection #%d, account: %d), name: %s, invalid letter: %c.\n"_fmt, - s, sd->account_id, name, c); - return nullptr; - } - } // else, all letters/symbols are authorised (except control char removed before) // TODO this comment is obsolete // this is why it needs to be unsigned @@ -764,10 +745,10 @@ CharPair *make_new_char(Session *s, CharName name, const Stats6& stats, uint8_t } } - if (wisp_server_name == name) + if (WISP_SERVER_NAME == name) { CHAR_LOG("Make new char error (name used is wisp name for server): (connection #%d, account: %d) slot %d, name: %s (actual name whisper server: %s), stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d.\n"_fmt, - s, sd->account_id, slot, name, wisp_server_name, + s, sd->account_id, slot, name, WISP_SERVER_NAME, stats.str, stats.agi, stats.vit, stats.int_, stats.dex, stats.luk, stats.str + stats.agi + stats.vit + stats.int_ + stats.dex + stats.luk, hair_style, hair_color); @@ -1705,7 +1686,6 @@ void parse_frommap(Session *ms) Packet_Fixed<0x2afb> fixed_fb; fixed_fb.unknown = 0; - fixed_fb.whisper_name = wisp_server_name; send_fpacket<0x2afb, 27>(ms, fixed_fb); { @@ -1781,7 +1761,7 @@ void parse_frommap(Session *ms) afi.login_id1 == login_id1 && // here, it's the only area where it's possible that we doesn't know login_id2 (map-server asks just after 0x72 packet, that doesn't given the value) (afi.login_id2 == login_id2 || login_id2 == 0) && // relate to the versions higher than 18 - (!check_ip_flag || afi.ip == ip) + afi.ip == ip && !afi.delflag) { CharPair *cp = nullptr; @@ -2422,8 +2402,7 @@ void parse_char(Session *s) if (afi.account_id == sd->account_id && afi.login_id1 == sd->login_id1 && afi.login_id2 == sd->login_id2 - && (!check_ip_flag - || afi.ip == s->client_ip) + && afi.ip == s->client_ip && afi.delflag == 2) { afi.delflag = 1; @@ -2837,11 +2816,6 @@ bool char_config(XString w1, ZString w2) server_name = stringish<ServerName>(w2); PRINTF("%s server has been intialized\n"_fmt, w2); } - else if (w1 == "wisp_server_name"_s) - { - if (w2.size() >= 4) - wisp_server_name = stringish<CharName>(w2); - } else if (w1 == "login_ip"_s) { h = gethostbyname(w2.c_str()); @@ -2900,10 +2874,6 @@ bool char_config(XString w1, ZString w2) if (max_connect_user < 0) max_connect_user = 0; // unlimited online players } - else if (w1 == "check_ip_flag"_s) - { - check_ip_flag = config_switch(w2); - } else if (w1 == "autosave_time"_s) { autosave_time = std::chrono::seconds(atoi(w2.c_str())); @@ -2922,10 +2892,6 @@ bool char_config(XString w1, ZString w2) { char_log_filename = w2; } - else if (w1 == "char_name_option"_s) - { - char_name_option = atoi(w2.c_str()); - } else if (w1 == "char_name_letters"_s) { if (!w2) @@ -2942,10 +2908,6 @@ bool char_config(XString w1, ZString w2) { online_html_filename = w2; } - else if (w1 == "online_sorting_option"_s) - { - online_sorting_option = atoi(w2.c_str()); - } else if (w1 == "online_gm_display_min_level"_s) { // minimum GM level to display 'GM' when we want to display it |