diff options
author | Wushin <pasekei@gmail.com> | 2015-04-29 22:21:35 -0500 |
---|---|---|
committer | Wushin <pasekei@gmail.com> | 2015-04-29 22:21:35 -0500 |
commit | bc5ae9b66a95ded0510ec4ac284d54b26d6dc14c (patch) | |
tree | 7e192fa66bc0d544d353db9964e8688aebf3883b /src/login/login.cpp | |
parent | 7da6873424307a6097a86772dd4994eccab041f3 (diff) | |
parent | 533cb165e0a9b4031f027c1ee193da52f962bdd2 (diff) | |
download | tmwa-bc5ae9b66a95ded0510ec4ac284d54b26d6dc14c.tar.gz tmwa-bc5ae9b66a95ded0510ec4ac284d54b26d6dc14c.tar.bz2 tmwa-bc5ae9b66a95ded0510ec4ac284d54b26d6dc14c.tar.xz tmwa-bc5ae9b66a95ded0510ec4ac284d54b26d6dc14c.zip |
Merge pull request #62 from mekolat/gm-atcommand
remove @gm atcommand
Diffstat (limited to 'src/login/login.cpp')
-rw-r--r-- | src/login/login.cpp | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/src/login/login.cpp b/src/login/login.cpp index 66b3ea0..92f8cc0 100644 --- a/src/login/login.cpp +++ b/src/login/login.cpp @@ -982,93 +982,6 @@ void parse_fromchar(Session *s) break; } - case 0x2720: // To become GM request - { - Packet_Head<0x2720> head; - AString repeat; - rv = recv_vpacket<0x2720, 8, 1>(s, head, repeat); - if (rv != RecvResult::Complete) - break; - - { - AccountId acc = head.account_id; - - Packet_Fixed<0x2721> fixed_21; - fixed_21.account_id = acc; - fixed_21.gm_level = GmLevel(); - - AString pass = repeat; - - if (pass == login_conf.gm_pass) - { - // only non-GM can become GM - if (!isGM(acc)) - { - // if we autorise creation - if (login_conf.level_new_gm) - { - // if we can open the file to add the new GM - io::AppendFile fp(login_conf.gm_account_filename); - if (fp.is_open()) - { - timestamp_seconds_buffer tmpstr; - stamp_time(tmpstr); - FPRINTF(fp, - "\n// %s: @GM command on account %d\n%d %d\n"_fmt, - tmpstr, - acc, acc, login_conf.level_new_gm); - if (!fp.close()) - { - PRINTF("warning: didn't actually save GM file\n"_fmt); - } - fixed_21.gm_level = login_conf.level_new_gm; - read_gm_account(); - send_GM_accounts(); - PRINTF("GM Change of the account %d: level 0 -> %d.\n"_fmt, - acc, login_conf.level_new_gm); - LOGIN_LOG("Char-server '%s': GM Change of the account %d: level 0 -> %d (ip: %s).\n"_fmt, - server[id].name, acc, - login_conf.level_new_gm, ip); - } - else - { - PRINTF("Error of GM change (suggested account: %d, correct password, unable to add a GM account in GM accounts file)\n"_fmt, - acc); - LOGIN_LOG("Char-server '%s': Error of GM change (suggested account: %d, correct password, unable to add a GM account in GM accounts file, ip: %s).\n"_fmt, - server[id].name, acc, ip); - } - } - else - { - PRINTF("Error of GM change (suggested account: %d, correct password, but GM creation is disable (level_new_gm = 0))\n"_fmt, - acc); - LOGIN_LOG("Char-server '%s': Error of GM change (suggested account: %d, correct password, but GM creation is disable (level_new_gm = 0), ip: %s).\n"_fmt, - server[id].name, acc, ip); - } - } - else - { - PRINTF("Error of GM change (suggested account: %d (already GM), correct password).\n"_fmt, - acc); - LOGIN_LOG("Char-server '%s': Error of GM change (suggested account: %d (already GM), correct password, ip: %s).\n"_fmt, - server[id].name, acc, ip); - } - } - else - { - PRINTF("Error of GM change (suggested account: %d, invalid password).\n"_fmt, - acc); - LOGIN_LOG("Char-server '%s': Error of GM change (suggested account: %d, invalid password, ip: %s).\n"_fmt, - server[id].name, acc, ip); - } - for (Session *ss : iter_char_sessions()) - { - send_fpacket<0x2721, 10>(ss, fixed_21); - } - } - break; - } - // Map server send information to change an email of an account via char-server case 0x2722: // 0x2722 <account_id>.L <actual_e-mail>.40B <new_e-mail>.40B { |