Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void IOLoginData::parseCreateCharacter(NetworkMessage& msg)
- {
- std::string accountName = msg.getString();
- std::string characterName = msg.getString();
- std::uint16_t vocation = msg.get<uint16_t>();
- std::uint8_t sex = msg.get<uint16_t>();
- uint32_t nameExist = IOLoginData::getGuidByName(characterName);
- uint32_t accountId = IOLoginData::getAccountIdByAccountName(accountName);
- if (accountId)
- {
- if (nameExist == 0) // character doesn't exist
- {
- if (isValidName(characterName, true))
- {
- if (vocation >= 1 && vocation <= 4)
- {
- if (sex >= 0 && sex <= 1)
- {
- if (IOLoginData::createCharacter(accountId, characterName, vocation, sex))
- {
- std::cout << "Teste Criacao de char\n Acc Name: " << accountName << "\nChar name: " << characterName << " \n Vocation: " << vocation << std::endl;
- }
- }
- else
- {
- }
- }
- else
- {
- }
- }
- else
- {
- }
- }
- else
- {
- }
- }
- else
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement