From f593049cd8286f48497782d8bc0afe787724ad5d Mon Sep 17 00:00:00 2001 From: wushin Date: Mon, 9 Nov 2015 13:46:56 -0600 Subject: Add third gender to account Add Gender to char Make gear work proper with new gender Enable legacy clients to use account gender --- src/login/login.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/login') diff --git a/src/login/login.cpp b/src/login/login.cpp index 9310ad3..4ab0773 100644 --- a/src/login/login.cpp +++ b/src/login/login.cpp @@ -441,8 +441,6 @@ bool impl_extract(XString line, AuthData *ad) if (sex.size() != 1) return false; ad->sex = sex_from_char(sex.front()); - if (ad->sex == SEX::NEUTRAL) - return false; if (!e_mail_check(ad->email)) ad->email = DEFAULT_EMAIL; @@ -1181,7 +1179,7 @@ void parse_fromchar(Session *s) case 0x2727: // Change of sex (sex is reversed) { Packet_Fixed<0x2727> fixed; - rv = recv_fpacket<0x2727, 6>(s, fixed); + rv = recv_fpacket<0x2727, 7>(s, fixed); if (rv != RecvResult::Complete) break; @@ -1192,11 +1190,7 @@ void parse_fromchar(Session *s) if (ad.account_id == acc) { { - SEX sex; - if (ad.sex == SEX::FEMALE) - sex = SEX::MALE; - else - sex = SEX::FEMALE; + SEX sex = fixed.sex; LOGIN_LOG("Char-server '%s': Sex change (account: %d, new sex %c, ip: %s).\n"_fmt, server[id].name, acc, sex_to_char(sex), @@ -1504,7 +1498,7 @@ void parse_admin(Session *s) LOGIN_LOG("'ladmin': Attempt to create an invalid account (account or pass is too short, ip: %s)\n"_fmt, ip); } - else if (ma.sex != SEX::FEMALE && ma.sex != SEX::MALE) + else if (ma.sex != SEX::FEMALE && ma.sex != SEX::MALE && ma.sex != SEX::NEUTRAL) { LOGIN_LOG("'ladmin': Attempt to create an invalid account (account: %s, invalid sex, ip: %s)\n"_fmt, ma.userid, ip); @@ -1765,7 +1759,7 @@ void parse_admin(Session *s) { SEX sex = fixed.sex; - if (sex != SEX::FEMALE && sex != SEX::MALE) + if (sex != SEX::FEMALE && sex != SEX::MALE && sex != SEX::NEUTRAL) { LOGIN_LOG("'ladmin': Attempt to give an invalid sex (account: %s, received sex: %c, ip: %s)\n"_fmt, account_name, sex_to_char(sex), ip); -- cgit v1.2.3-60-g2f50