Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void LoginManager::handleLoginClientId(LoginClient* client, Message* message) {
- // Extract our username, password, and id string
- std::string username = message->getStringAnsi();
- std::string password = message->getStringAnsi();
- std::string clientId = message->getStringAnsi();
- if (!validateClientVersion_(clientId)) {
- LOG(WARNING) << "illegal client: " << clientId;
- client->Disconnect(0);
- return;
- }
- future<bool> authenticated = authenticate(client, username, password);
- std::function<void()> work;
- work = [this, authenticated, client, &work] () {
- if (!work.is_ready()) {
- active_object_.send(work);
- }
- if (!authenticated.get()) { // .get() returns true if authenticated, false if not
- sendErrorMessage_(client, "@cpt_login_fail", "@msg_login_fail");
- client->Disconnect(6);
- return;
- }
- sendLoginClientToken_(client);
- sendGalaxyList_(client);
- sendGalaxyStatus_(client);
- updateCharacterList_(client);
- sendEnumerateCharacterId_(client);
- };
- active_object.send(work);
- }
Add Comment
Please, Sign In to add comment