Skip to content

Commit

Permalink
Fix structured binding compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
ranisalt committed Apr 8, 2023
1 parent 83ff401 commit 6ef6bbe
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,14 +468,15 @@ void ProtocolGame::onRecvFirstMessage(NetworkMessage& msg)
return;
}

auto [accountId, characterId] =
IOLoginData::gameworldAuthentication(accountName, password, characterName, token, tokenTime);
if (accountId == 0) {
// TODO: use structured binding when C++20 is adopted
auto authIds = IOLoginData::gameworldAuthentication(accountName, password, characterName, token, tokenTime);
if (authIds.first == 0) {
disconnectClient("Account name or password is not correct.");
return;
}

g_dispatcher.addTask([=, thisPtr = getThis()]() { thisPtr->login(characterId, accountId, operatingSystem); });
g_dispatcher.addTask(
[=, thisPtr = getThis()]() { thisPtr->login(authIds.second, authIds.first, operatingSystem); });
}

void ProtocolGame::onConnect()
Expand Down

0 comments on commit 6ef6bbe

Please sign in to comment.