Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. void IOLoginData::parseCreateCharacter(NetworkMessage& msg)
  2. {
  3. std::string accountName = msg.getString();
  4. std::string characterName = msg.getString();
  5. std::uint16_t vocation = msg.get<uint16_t>();
  6. std::uint8_t sex = msg.get<uint16_t>();
  7. uint32_t nameExist = IOLoginData::getGuidByName(characterName);
  8. uint32_t accountId = IOLoginData::getAccountIdByAccountName(accountName);
  9. if (accountId)
  10. {
  11. if (nameExist == 0) // character doesn't exist
  12. {
  13. if (isValidName(characterName, true))
  14. {
  15. if (vocation >= 1 && vocation <= 4)
  16. {
  17. if (sex >= 0 && sex <= 1)
  18. {
  19. if (IOLoginData::createCharacter(accountId, characterName, vocation, sex))
  20. {
  21. std::cout << "Teste Criacao de char\n Acc Name: " << accountName << "\nChar name: " << characterName << " \n Vocation: " << vocation << std::endl;
  22. }
  23.  
  24. }
  25. else
  26. {
  27. }
  28. }
  29. else
  30. {
  31. }
  32.  
  33. }
  34. else
  35. {
  36. }
  37. }
  38. else
  39. {
  40. }
  41.  
  42. }
  43. else
  44. {
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement