mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2026-11-11 08:53:14 +03:00
feat(client): implement auth response handler in realm adapter
This commit is contained in:
5 files changed
+58
-26
No files matched your search
@@ -1,5 +1,18 @@
|
||||
#include "client/ClientRealmResponseAdapter.hpp"
|
||||
|
||||
void ClientRealmResponseAdapter::HandleAuthResponse(RealmConnection* connection, uint8_t authResult) {
|
||||
void AccountDataInitialize(bool a1) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void ClientRealmResponseAdapter::HandleAuthResponse(RealmConnection* realmConnection, uint8_t authResult) {
|
||||
auto clientConnection = static_cast<ClientConnection*>(realmConnection);
|
||||
|
||||
// AUTH_WAIT_QUEUE
|
||||
if (authResult == 27) {
|
||||
clientConnection->AccountLogin_Queued();
|
||||
} else {
|
||||
clientConnection->AccountLogin_Finish(authResult);
|
||||
}
|
||||
|
||||
AccountDataInitialize(true);
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
class ClientRealmResponseAdapter : public RealmResponse {
|
||||
public:
|
||||
// Virtual member functions
|
||||
virtual void HandleAuthResponse(RealmConnection* connection, uint8_t authResult);
|
||||
virtual void GameServerResult(RealmConnection* connection, const char* a2, const char* a3, const char* a4) {};
|
||||
virtual void HandleAuthResponse(RealmConnection* realmConnection, uint8_t authResult);
|
||||
virtual void GameServerResult(RealmConnection* realmConnection, const char* a2, const char* a3, const char* a4) {};
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -22,12 +22,12 @@ bool ClientServices::s_selectRealmInfoValid;
|
||||
|
||||
void ClientServices::ConnectToSelectedServer() {
|
||||
if (!ClientServices::s_selectRealmInfoValid && !ClientServices::SetSelectedRealmInfo(0)) {
|
||||
ClientServices::Connection()->SetStatus(0, 39);
|
||||
ClientServices::Connection()->Complete(0, 39);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ClientServices::Connection()->GetState() != NS_INITIALIZED) {
|
||||
ClientServices::Connection()->SetStatus(0, 39);
|
||||
ClientServices::Connection()->Complete(0, 39);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -210,12 +210,12 @@ void ClientServices::RealmEnumCallback(uint32_t a2) {
|
||||
auto connection = ClientServices::Connection();
|
||||
|
||||
if (a2 == 1) {
|
||||
connection->SetStatus(0, 23);
|
||||
connection->Complete(0, 23);
|
||||
return;
|
||||
}
|
||||
|
||||
if (a2 == 2 || a2 == 3 || a2 == 4) {
|
||||
connection->SetStatus(0, 37);
|
||||
connection->Complete(0, 37);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user