2023-01-02 13:17:18 -06:00
|
|
|
#ifndef GLUE_C_GLUE_MGR_HPP
|
|
|
|
|
#define GLUE_C_GLUE_MGR_HPP
|
|
|
|
|
|
|
|
|
|
#include "event/Event.hpp"
|
2023-01-09 17:37:24 -06:00
|
|
|
#include "net/Types.hpp"
|
2024-09-06 12:26:04 -04:00
|
|
|
#include "gx/Texture.hpp"
|
2023-01-02 13:17:18 -06:00
|
|
|
#include <cstdint>
|
|
|
|
|
|
2025-03-29 23:57:13 +04:00
|
|
|
|
|
|
|
|
float CalculateAspectRatio();
|
|
|
|
|
|
|
|
|
|
|
2023-01-02 13:17:18 -06:00
|
|
|
class CSimpleTop;
|
|
|
|
|
|
|
|
|
|
class CGlueMgr {
|
|
|
|
|
public:
|
|
|
|
|
// Types
|
|
|
|
|
enum GLUE_IDLE_STATE {
|
|
|
|
|
IDLE_NONE = 0,
|
2023-01-09 18:01:27 -06:00
|
|
|
IDLE_LOGIN_SERVER_LOGIN = 1,
|
|
|
|
|
IDLE_ACCOUNT_LOGIN = 2,
|
2025-03-29 23:31:27 +04:00
|
|
|
IDLE_CHARACTER_LIST = 3,
|
|
|
|
|
IDLE_REALM_LIST = 4,
|
2025-03-30 00:02:58 +04:00
|
|
|
IDLE_CREATE_CHARACTER = 5,
|
|
|
|
|
IDLE_DELETE_CHARACTER = 6,
|
2023-01-02 13:17:18 -06:00
|
|
|
IDLE_7 = 7,
|
|
|
|
|
IDLE_8 = 8,
|
|
|
|
|
IDLE_9 = 9,
|
2025-03-30 00:02:58 +04:00
|
|
|
IDLE_ENTER_WORLD = 10,
|
2025-03-29 23:31:27 +04:00
|
|
|
IDLE_WORLD_LOGIN = 11,
|
2023-01-02 13:17:18 -06:00
|
|
|
IDLE_12 = 12,
|
|
|
|
|
IDLE_13 = 13
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Static variables
|
|
|
|
|
static int32_t m_acceptedEULA;
|
|
|
|
|
static int32_t m_acceptedTerminationWithoutNotice;
|
|
|
|
|
static int32_t m_acceptedTOS;
|
2025-03-29 23:28:52 +04:00
|
|
|
static int32_t m_processServerAlert;
|
|
|
|
|
static int32_t m_pendingTimerAlert;
|
2023-01-09 17:37:24 -06:00
|
|
|
static int32_t m_accountMsgAvailable;
|
2023-01-02 13:17:18 -06:00
|
|
|
static char m_accountName[];
|
|
|
|
|
static float m_aspect;
|
|
|
|
|
static bool m_authenticated;
|
|
|
|
|
static char m_currentScreen[];
|
2024-09-06 12:26:04 -04:00
|
|
|
static MipBits* m_cursorMipBits;
|
2023-02-18 16:32:27 -06:00
|
|
|
static int32_t m_disconnectPending;
|
2023-02-11 23:35:53 -06:00
|
|
|
static int32_t m_displayingQueueDialog;
|
2023-01-02 13:17:18 -06:00
|
|
|
static GLUE_IDLE_STATE m_idleState;
|
|
|
|
|
static int32_t m_initialized;
|
|
|
|
|
static int32_t m_lastLoginResult;
|
|
|
|
|
static int32_t m_lastLoginState;
|
|
|
|
|
static int32_t m_loginResult;
|
|
|
|
|
static int32_t m_loginState;
|
2025-03-29 23:31:27 +04:00
|
|
|
static int32_t m_matrixChallengeCount;
|
2023-01-02 13:17:18 -06:00
|
|
|
static int32_t m_matrixRemaining;
|
2023-02-18 16:32:27 -06:00
|
|
|
static int32_t m_reconnect;
|
2023-01-02 13:17:18 -06:00
|
|
|
static int32_t m_reload;
|
|
|
|
|
static int32_t m_scandllOkayToLogIn;
|
|
|
|
|
static float m_screenHeight;
|
|
|
|
|
static float m_screenWidth;
|
2025-04-17 01:32:37 +04:00
|
|
|
static int32_t m_clientKickReason;
|
2023-01-02 13:17:18 -06:00
|
|
|
static int32_t m_showedDisconnect;
|
|
|
|
|
static CSimpleTop* m_simpleTop;
|
|
|
|
|
static int32_t m_suspended;
|
|
|
|
|
|
2025-03-29 23:31:27 +04:00
|
|
|
static int32_t m_surveyTimer;
|
|
|
|
|
static int32_t m_executedSurvey;
|
|
|
|
|
static int32_t m_surveyDownload;
|
|
|
|
|
static int32_t m_patchDownload;
|
|
|
|
|
static bool m_deleteLocalPatch;
|
|
|
|
|
|
2025-03-30 00:02:58 +04:00
|
|
|
static CHARACTER_INFO* m_characterInfo;
|
|
|
|
|
|
2023-01-02 13:17:18 -06:00
|
|
|
// Static functions
|
2023-02-18 16:32:27 -06:00
|
|
|
static void ChangeRealm(const REALM_INFO* realmInfo);
|
2023-02-07 23:36:15 -06:00
|
|
|
static void DisplayLoginStatus();
|
2023-01-02 13:17:18 -06:00
|
|
|
// TODO a1: const EVENT_DATA_IDLE*
|
|
|
|
|
static int32_t HandleDisplaySizeChanged(const CSizeEvent& event);
|
2025-03-29 23:31:27 +04:00
|
|
|
static void GetRealmList(bool showProgress);
|
|
|
|
|
static void GetCharacterList();
|
2025-04-17 01:32:37 +04:00
|
|
|
static int32_t NetDisconnectHandler(const void* eventData, void*);
|
2023-01-05 20:58:51 -06:00
|
|
|
static int32_t Idle(const void* a1, void* a2);
|
2023-01-02 13:17:18 -06:00
|
|
|
static void Initialize();
|
2024-09-06 12:26:04 -04:00
|
|
|
static void InitCursor();
|
2023-01-02 13:17:18 -06:00
|
|
|
static void LoginServerLogin(const char* accountName, const char* password);
|
|
|
|
|
static void QuitGame();
|
2025-03-30 00:02:58 +04:00
|
|
|
static void EnterWorld();
|
2023-02-11 23:35:53 -06:00
|
|
|
static void PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
|
2023-01-09 18:01:27 -06:00
|
|
|
static void PollLoginServerLogin();
|
2025-03-29 23:31:27 +04:00
|
|
|
static void PollCharacterList(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
|
2025-04-17 01:32:37 +04:00
|
|
|
static void PollRealmList(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
|
|
|
|
|
static void PollCreateCharacter(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
|
|
|
|
|
static void PollDeleteCharacter(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
|
2025-03-29 23:31:27 +04:00
|
|
|
static void PollUserSurvey();
|
2025-04-17 01:32:37 +04:00
|
|
|
static void CancelLogin();
|
2023-01-02 13:17:18 -06:00
|
|
|
static void Resume();
|
2023-02-07 12:57:25 -06:00
|
|
|
static void SetCurrentAccount(const char* accountName);
|
2023-01-09 17:37:24 -06:00
|
|
|
static void SetLoginStateAndResult(LOGIN_STATE state, LOGIN_RESULT result, char const* addrStr, char const* stateStr, char const* resultStr, uint8_t flags);
|
2023-01-05 20:58:51 -06:00
|
|
|
static void SetScreen(const char* screen);
|
2023-01-02 13:17:18 -06:00
|
|
|
static void StatusDialogClick();
|
2023-02-07 23:59:36 -06:00
|
|
|
static void Sub4D8BA0();
|
2023-01-02 13:17:18 -06:00
|
|
|
static void Suspend();
|
|
|
|
|
static void UpdateCurrentScreen(const char* screen);
|
2025-03-29 23:43:21 +04:00
|
|
|
static bool HandleBattlenetDisconnect();
|
2025-04-17 01:32:37 +04:00
|
|
|
static void DeleteCharacter(uint64_t guid);
|
2025-03-29 23:31:27 +04:00
|
|
|
|
2025-03-30 00:02:58 +04:00
|
|
|
static void PollEnterWorld();
|
|
|
|
|
|
2025-03-29 23:31:27 +04:00
|
|
|
// Survey Download System
|
|
|
|
|
static void SurveyDownloadStart();
|
2025-03-29 23:32:33 +04:00
|
|
|
static void SurveyDownloadCancel();
|
2025-03-29 23:31:27 +04:00
|
|
|
static void SurveyDownloadIdle();
|
|
|
|
|
static bool SurveyExecute();
|
|
|
|
|
static void SurveySendResults();
|
|
|
|
|
|
|
|
|
|
// Patch Download System
|
|
|
|
|
static void PatchDownloadStart();
|
|
|
|
|
static void PatchDownloadIdle();
|
2023-01-02 13:17:18 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|