feat(client): prepare EnterWorld classes and methods

This commit is contained in:
VDm 2025-03-30 00:02:58 +04:00
parent babeb2d864
commit 140bcde493
12 changed files with 93 additions and 7 deletions

View file

@ -77,6 +77,8 @@ int32_t CGlueMgr::m_surveyDownload;
int32_t CGlueMgr::m_patchDownload;
bool CGlueMgr::m_deleteLocalPatch;
CHARACTER_INFO* CGlueMgr::m_characterInfo = nullptr;
float CalculateAspectRatio() {
auto widescreenVar = CVar::Lookup("widescreen");
@ -300,6 +302,11 @@ int32_t CGlueMgr::Idle(const void* a1, void* a2) {
break;
}
case IDLE_ENTER_WORLD: {
CGlueMgr::PollEnterWorld();
break;
}
case IDLE_12: {
if (CGlueMgr::m_patchDownload) {
CGlueMgr::PatchDownloadIdle();
@ -411,6 +418,20 @@ void CGlueMgr::QuitGame() {
ClientPostClose(0);
}
void CGlueMgr::EnterWorld() {
// TODO: Proper implementation
if (CCharacterSelection::GetNumCharacters() < 1) {
return;
}
CGlueMgr::m_characterInfo = &CCharacterSelection::s_characterList[0].m_characterInfo;
if (!m_characterInfo || !ClientServices::Connection()->IsConnected()) {
return;
}
CGlueMgr::m_idleState = IDLE_ENTER_WORLD;
CGlueMgr::m_showedDisconnect = 0;
}
void CGlueMgr::PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op) {
auto login = ClientServices::LoginConnection();
@ -820,9 +841,9 @@ void CGlueMgr::StatusDialogClick() {
}
case IDLE_REALM_LIST:
case IDLE_5:
case IDLE_6:
case IDLE_10: {
case IDLE_CREATE_CHARACTER:
case IDLE_DELETE_CHARACTER:
case IDLE_ENTER_WORLD: {
ClientServices::Connection()->Cancel(2);
CGlueMgr::m_showedDisconnect = 0;
@ -899,6 +920,29 @@ bool CGlueMgr::HandleBattlenetDisconnect() {
return false;
}
void CGlueMgr::PollEnterWorld() {
//if (!LoadingScreenDrawing())
// return;
if (CGlueMgr::m_suspended) {
CGlueMgr::m_idleState = IDLE_NONE;
CGlueMgr::m_showedDisconnect = 0;
//SI3::StopGlueMusic(3.0);
//SI3::StopGlueAmbience(-1.0);
ClientServices::CharacterLogin(CGlueMgr::m_characterInfo->guid, C3Vector());
return;
}
auto info = CGlueMgr::m_characterInfo;
//if (*(_BYTE*)(info + 385))
// sub_4D9660(*(_BYTE*)(info + 377), (int)v51, *(_BYTE*)(info + 376), (int)&v68);
CGlueMgr::Suspend();
ClientInitializeGame(info->mapID, info->position);
}
void CGlueMgr::SurveyDownloadStart() {
}

View file

@ -21,12 +21,12 @@ class CGlueMgr {
IDLE_ACCOUNT_LOGIN = 2,
IDLE_CHARACTER_LIST = 3,
IDLE_REALM_LIST = 4,
IDLE_5 = 5,
IDLE_6 = 6,
IDLE_CREATE_CHARACTER = 5,
IDLE_DELETE_CHARACTER = 6,
IDLE_7 = 7,
IDLE_8 = 8,
IDLE_9 = 9,
IDLE_10 = 10,
IDLE_ENTER_WORLD = 10,
IDLE_WORLD_LOGIN = 11,
IDLE_12 = 12,
IDLE_13 = 13
@ -69,6 +69,8 @@ class CGlueMgr {
static int32_t m_patchDownload;
static bool m_deleteLocalPatch;
static CHARACTER_INFO* m_characterInfo;
// Static functions
static void ChangeRealm(const REALM_INFO* realmInfo);
static void DisplayLoginStatus();
@ -81,6 +83,7 @@ class CGlueMgr {
static void InitCursor();
static void LoginServerLogin(const char* accountName, const char* password);
static void QuitGame();
static void EnterWorld();
static void PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
static void PollLoginServerLogin();
static void PollCharacterList(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
@ -95,6 +98,8 @@ class CGlueMgr {
static void UpdateCurrentScreen(const char* screen);
static bool HandleBattlenetDisconnect();
static void PollEnterWorld();
// Survey Download System
static void SurveyDownloadStart();
static void SurveyDownloadCancel();