diff --git a/src/client/Client.cpp b/src/client/Client.cpp index 8d423b7..eae20a6 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -48,6 +48,10 @@ void ClientMiscInitialize() { // TODO } +void ClientInitializeGame(uint32_t mapId, C3Vector position) { + // TODO +} + void ClientPostClose(int32_t a1) { // TODO s_finalDialog = a1; EventPostCloseEx(nullptr); diff --git a/src/client/Client.hpp b/src/client/Client.hpp index 7d3f60b..0a3f10f 100644 --- a/src/client/Client.hpp +++ b/src/client/Client.hpp @@ -2,7 +2,7 @@ #define CLIENT_CLIENT_HPP #include "event/Event.hpp" -#include +#include class CVar; @@ -11,6 +11,8 @@ namespace Client { extern HEVENTCONTEXT g_clientEventContext; } +void ClientInitializeGame(uint32_t mapId, C3Vector position); + void ClientPostClose(int32_t a1); void CommonMain(); diff --git a/src/glue/CGlueMgr.cpp b/src/glue/CGlueMgr.cpp index c38fd28..88ad02c 100644 --- a/src/glue/CGlueMgr.cpp +++ b/src/glue/CGlueMgr.cpp @@ -1,7 +1,8 @@ #include "glue/CGlueMgr.hpp" -#include "glue/CRealmList.hpp" #include "client/Client.hpp" #include "client/ClientServices.hpp" +#include "glue/CRealmList.hpp" +#include "glue/LoadingScreen.hpp" #include "gx/Coordinate.hpp" #include "gx/Device.hpp" #include "math/Utils.hpp" @@ -241,6 +242,11 @@ int32_t CGlueMgr::Idle(const void* a1, void* a2) { break; } + case IDLE_ENTER_WORLD: { + CGlueMgr::PollEnterWorld(); + break; + } + // TODO other idle states default: @@ -407,6 +413,29 @@ void CGlueMgr::PollAccountLogin(int32_t errorCode, const char* msg, int32_t comp } } +void CGlueMgr::PollEnterWorld() { + if (!LoadingScreenDrawing()) { + return; + } + + if (CGlueMgr::m_suspended) { + CGlueMgr::m_idleState = IDLE_NONE; + CGlueMgr::m_showedDisconnect = 0; + + // TODO SI Logic + // TODO ClientConnection::CharacterLogin() + + return; + } + + // TODO Get map ID and position from character info + uint32_t mapId = 0; + C3Vector position = { 0.0f, 0.0f, 0.0f }; + + CGlueMgr::Suspend(); + ClientInitializeGame(mapId, position); +} + void CGlueMgr::PollLoginServerLogin() { if (CGlueMgr::m_loginState != LOGIN_STATE_PIN_WAIT) { CGlueMgr::DisplayLoginStatus(); @@ -655,7 +684,7 @@ void CGlueMgr::StatusDialogClick() { case IDLE_4: case IDLE_5: case IDLE_6: - case IDLE_10: { + case IDLE_ENTER_WORLD: { ClientServices::Connection()->Cancel(2); CGlueMgr::m_showedDisconnect = 0; diff --git a/src/glue/CGlueMgr.hpp b/src/glue/CGlueMgr.hpp index 0ae8284..45abeac 100644 --- a/src/glue/CGlueMgr.hpp +++ b/src/glue/CGlueMgr.hpp @@ -21,7 +21,7 @@ class CGlueMgr { IDLE_7 = 7, IDLE_8 = 8, IDLE_9 = 9, - IDLE_10 = 10, + IDLE_ENTER_WORLD = 10, IDLE_11 = 11, IDLE_12 = 12, IDLE_13 = 13 @@ -64,6 +64,7 @@ class CGlueMgr { static void LoginServerLogin(const char* accountName, const char* password); static void QuitGame(); static void PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op); + static void PollEnterWorld(); static void PollLoginServerLogin(); static void Resume(); static void SetCurrentAccount(const char* accountName); diff --git a/src/glue/LoadingScreen.cpp b/src/glue/LoadingScreen.cpp new file mode 100644 index 0000000..2149dbb --- /dev/null +++ b/src/glue/LoadingScreen.cpp @@ -0,0 +1,6 @@ +#include "glue/LoadingScreen.hpp" + +bool LoadingScreenDrawing() { + // TODO + return false; +} diff --git a/src/glue/LoadingScreen.hpp b/src/glue/LoadingScreen.hpp new file mode 100644 index 0000000..2c49b50 --- /dev/null +++ b/src/glue/LoadingScreen.hpp @@ -0,0 +1,6 @@ +#ifndef GLUE_LOADING_SCREEN_HPP +#define GLUE_LOADING_SCREEN_HPP + +bool LoadingScreenDrawing(); + +#endif