summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorwushin <pasekei@gmail.com>2015-11-09 13:46:56 -0600
committerwushin <pasekei@gmail.com>2016-02-08 18:53:15 -0600
commitf593049cd8286f48497782d8bc0afe787724ad5d (patch)
tree371402a86444ce9104227d638192fa4a305dd48f /src/login
parentf81bcc78fb1aa5475bbe54907ff82199fc031521 (diff)
downloadtmwa-f593049cd8286f48497782d8bc0afe787724ad5d.tar.gz
tmwa-f593049cd8286f48497782d8bc0afe787724ad5d.tar.bz2
tmwa-f593049cd8286f48497782d8bc0afe787724ad5d.tar.xz
tmwa-f593049cd8286f48497782d8bc0afe787724ad5d.zip
Add third gender to account
Add Gender to char Make gear work proper with new gender Enable legacy clients to use account gender
Diffstat (limited to 'src/login')
-rw-r--r--src/login/login.cpp14
1 files changed, 4 insertions, 10 deletions
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);