mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 16:03:52 +00:00
Use auth username for world connection
This commit is contained in:
parent
d6d180abf5
commit
d2fcf5e71f
2 changed files with 6 additions and 1 deletions
|
|
@ -52,6 +52,7 @@ public:
|
||||||
// State
|
// State
|
||||||
AuthState getState() const { return state; }
|
AuthState getState() const { return state; }
|
||||||
const std::vector<uint8_t>& getSessionKey() const { return sessionKey; }
|
const std::vector<uint8_t>& getSessionKey() const { return sessionKey; }
|
||||||
|
const std::string& getUsername() const { return username; }
|
||||||
|
|
||||||
// Callbacks
|
// Callbacks
|
||||||
void setOnSuccess(AuthSuccessCallback callback) { onSuccess = callback; }
|
void setOnSuccess(AuthSuccessCallback callback) { onSuccess = callback; }
|
||||||
|
|
|
||||||
|
|
@ -559,7 +559,11 @@ void Application::setupUICallbacks() {
|
||||||
|
|
||||||
// Connect to world server
|
// Connect to world server
|
||||||
const auto& sessionKey = authHandler->getSessionKey();
|
const auto& sessionKey = authHandler->getSessionKey();
|
||||||
const std::string accountName = "TESTACCOUNT"; // TODO: Store from auth
|
std::string accountName = authHandler->getUsername();
|
||||||
|
if (accountName.empty()) {
|
||||||
|
LOG_WARNING("Auth username missing; falling back to TESTACCOUNT");
|
||||||
|
accountName = "TESTACCOUNT";
|
||||||
|
}
|
||||||
|
|
||||||
if (gameHandler->connect(host, port, sessionKey, accountName)) {
|
if (gameHandler->connect(host, port, sessionKey, accountName)) {
|
||||||
LOG_INFO("Connected to world server, transitioning to character selection");
|
LOG_INFO("Connected to world server, transitioning to character selection");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue