Guest User

Untitled

a guest
Jul 29th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. void LoginManager::handleLoginClientId(LoginClient* client, Message* message) {
  2. // Extract our username, password, and id string
  3. std::string username = message->getStringAnsi();
  4. std::string password = message->getStringAnsi();
  5. std::string clientId = message->getStringAnsi();
  6.  
  7. if (!validateClientVersion_(clientId)) {
  8. LOG(WARNING) << "illegal client: " << clientId;
  9. client->Disconnect(0);
  10. return;
  11. }
  12.  
  13. future<bool> authenticated = authenticate(client, username, password);
  14. std::function<void()> work;
  15.  
  16. work = [this, authenticated, client, &work] () {
  17. if (!work.is_ready()) {
  18. active_object_.send(work);
  19. }
  20.  
  21. if (!authenticated.get()) { // .get() returns true if authenticated, false if not
  22. sendErrorMessage_(client, "@cpt_login_fail", "@msg_login_fail");
  23. client->Disconnect(6);
  24. return;
  25. }
  26.  
  27. sendLoginClientToken_(client);
  28. sendGalaxyList_(client);
  29. sendGalaxyStatus_(client);
  30.  
  31. updateCharacterList_(client);
  32. sendEnumerateCharacterId_(client);
  33. };
  34.  
  35. active_object.send(work);
  36. }
Add Comment
Please, Sign In to add comment