summaryrefslogtreecommitdiff
path: root/src/net/ea/loginhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-03-14 03:56:02 +0300
committerAndrei Karas <akaras@inbox.ru>2012-03-14 04:06:13 +0300
commit112d2ad1904051160822d1845d1418cca889c0d5 (patch)
tree9731934d9dc367f931c028158f3d26a670e18feb /src/net/ea/loginhandler.cpp
parent02e9a62ce9a0f288804bfa2aa59c3a84b0376c4a (diff)
downloadmanaverse-112d2ad1904051160822d1845d1418cca889c0d5.tar.gz
manaverse-112d2ad1904051160822d1845d1418cca889c0d5.tar.bz2
manaverse-112d2ad1904051160822d1845d1418cca889c0d5.tar.xz
manaverse-112d2ad1904051160822d1845d1418cca889c0d5.zip
Add support for other gender.
Fix per gender and race items separation.
Diffstat (limited to 'src/net/ea/loginhandler.cpp')
-rw-r--r--src/net/ea/loginhandler.cpp18
1 files changed, 16 insertions, 2 deletions
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++)
{