diff --git a/src/client/ClientServices.cpp b/src/client/ClientServices.cpp index 9ac249b..4f29490 100644 --- a/src/client/ClientServices.cpp +++ b/src/client/ClientServices.cpp @@ -1,5 +1,6 @@ #include "client/ClientServices.hpp" #include "client/ClientRealmResponseAdapter.hpp" +#include "glue/CGlueMgr.hpp" #include "net/Connection.hpp" #include "net/Login.hpp" #include @@ -87,6 +88,10 @@ void ClientServices::Logon(const char* accountName, const char* password) { ClientServices::s_loginObj->Logon(nullptr, nullptr); } -void ClientServices::LoginServerStatus(LOGIN_STATE state, LOGIN_RESULT result, const char* addrStr, const char* stateStr, const char* resultStr, uint16_t a7) { - // TODO +void ClientServices::LoginServerStatus(LOGIN_STATE state, LOGIN_RESULT result, const char* addrStr, const char* stateStr, const char* resultStr, uint8_t flags) { + CGlueMgr::SetLoginStateAndResult(state, result, addrStr, stateStr, resultStr, flags); + + if (state == LOGIN_STATE_AUTHENTICATED) { + // TODO + } } diff --git a/src/client/ClientServices.hpp b/src/client/ClientServices.hpp index 9ce86e9..1428b05 100644 --- a/src/client/ClientServices.hpp +++ b/src/client/ClientServices.hpp @@ -24,7 +24,7 @@ class ClientServices : public LoginResponse { static void Logon(const char* accountName, const char* password); // Virtual member functions - virtual void LoginServerStatus(LOGIN_STATE state, LOGIN_RESULT result, const char* addrStr, const char* stateStr, const char* resultStr, uint16_t a7); + virtual void LoginServerStatus(LOGIN_STATE state, LOGIN_RESULT result, const char* addrStr, const char* stateStr, const char* resultStr, uint8_t flags); }; #endif diff --git a/src/glue/CGlueMgr.cpp b/src/glue/CGlueMgr.cpp index 59c81b3..97a7893 100644 --- a/src/glue/CGlueMgr.cpp +++ b/src/glue/CGlueMgr.cpp @@ -41,6 +41,7 @@ unsigned char InterfaceKey[256] = { int32_t CGlueMgr::m_acceptedEULA = 1; // TODO int32_t CGlueMgr::m_acceptedTerminationWithoutNotice; int32_t CGlueMgr::m_acceptedTOS = 1; // TODO +int32_t CGlueMgr::m_accountMsgAvailable; char CGlueMgr::m_accountName[1280]; float CGlueMgr::m_aspect; bool CGlueMgr::m_authenticated; @@ -360,6 +361,22 @@ void CGlueMgr::Resume() { // } } +void CGlueMgr::SetLoginStateAndResult(LOGIN_STATE state, LOGIN_RESULT result, const char* addrStr, const char* stateStr, const char* resultStr, uint8_t flags) { + // TODO + // CGlueMgr::LogConnectionStatus("GRUNT: state: %s result: %s %s", a4); + + if (flags & 0x1) { + CGlueMgr::m_accountMsgAvailable = 1; + } + + if (state == LOGIN_STATE_AUTHENTICATED) { + CGlueMgr::m_authenticated = true; + } + + CGlueMgr::m_loginState = state; + CGlueMgr::m_loginResult = result; +} + void CGlueMgr::SetScreen(const char* screen) { FrameScript_SignalEvent(0, "%s", screen); } diff --git a/src/glue/CGlueMgr.hpp b/src/glue/CGlueMgr.hpp index 1a21c2f..15a6cde 100644 --- a/src/glue/CGlueMgr.hpp +++ b/src/glue/CGlueMgr.hpp @@ -2,6 +2,7 @@ #define GLUE_C_GLUE_MGR_HPP #include "event/Event.hpp" +#include "net/Types.hpp" #include class CSimpleTop; @@ -30,6 +31,7 @@ class CGlueMgr { static int32_t m_acceptedEULA; static int32_t m_acceptedTerminationWithoutNotice; static int32_t m_acceptedTOS; + static int32_t m_accountMsgAvailable; static char m_accountName[]; static float m_aspect; static bool m_authenticated; @@ -57,6 +59,7 @@ class CGlueMgr { static void LoginServerLogin(const char* accountName, const char* password); static void QuitGame(); static void Resume(); + static void SetLoginStateAndResult(LOGIN_STATE state, LOGIN_RESULT result, char const* addrStr, char const* stateStr, char const* resultStr, uint8_t flags); static void SetScreen(const char* screen); static void StatusDialogClick(); static void Suspend(); diff --git a/src/net/login/LoginResponse.hpp b/src/net/login/LoginResponse.hpp index 84d4820..99c8009 100644 --- a/src/net/login/LoginResponse.hpp +++ b/src/net/login/LoginResponse.hpp @@ -10,7 +10,7 @@ class LoginResponse { LOGIN_RESULT m_loginResult; // Virtual member functions - virtual void LoginServerStatus(LOGIN_STATE state, LOGIN_RESULT result, const char* addrStr, const char* stateStr, const char* resultStr, uint16_t a7) = 0; + virtual void LoginServerStatus(LOGIN_STATE state, LOGIN_RESULT result, const char* addrStr, const char* stateStr, const char* resultStr, uint8_t flags) = 0; // Member functions void UpdateLoginStatus(LOGIN_STATE state, LOGIN_RESULT result, const char* a4, uint16_t a5);