From 112d2ad1904051160822d1845d1418cca889c0d5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 14 Mar 2012 03:56:02 +0300 Subject: Add support for other gender. Fix per gender and race items separation. --- src/net/ea/loginhandler.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/net/ea/loginhandler.cpp') diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index 560893a4f..d35e5a0d5 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -97,7 +97,21 @@ void LoginHandler::registerAccount(LoginData *loginData) return; std::string username = loginData->username; - username.append((loginData->gender == GENDER_FEMALE) ? "_F" : "_M"); + switch (loginData->gender) + { + case GENDER_FEMALE: + username.append("_F"); + break; + case GENDER_MALE: + username.append("_M"); + break; + case GENDER_OTHER: + username.append("_O"); + break; + case GENDER_UNSPECIFIED: + default: + break; + } sendLoginRegister(username, loginData->password); } @@ -181,7 +195,7 @@ void LoginHandler::processLoginData(Net::MessageIn &msg) // msg.skip(30); // unknown // reserve bits for future usage - mToken.sex = (msg.readInt8() & 1) ? GENDER_MALE : GENDER_FEMALE; + mToken.sex = Being::intToGender(msg.readInt8() & 3); for (int i = 0; i < worldCount; i++) { -- cgit v1.2.3-70-g09d2