feat(glue): implement more of CGlueMgr::PollAccountLogin

This commit is contained in:
fallenoak 2025-10-04 00:44:32 -05:00
parent d3d28c1bce
commit f479d6ab53
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
3 changed files with 69 additions and 31 deletions

View File

@ -3,7 +3,9 @@
#include "client/ClientServices.hpp" #include "client/ClientServices.hpp"
#include "client/Util.hpp" #include "client/Util.hpp"
#include "console/CVar.hpp" #include "console/CVar.hpp"
#include "db/Db.hpp"
#include "glue/CCharacterSelection.hpp" #include "glue/CCharacterSelection.hpp"
#include "glue/Character.hpp"
#include "glue/CRealmList.hpp" #include "glue/CRealmList.hpp"
#include "gx/Coordinate.hpp" #include "gx/Coordinate.hpp"
#include "gx/Device.hpp" #include "gx/Device.hpp"
@ -375,7 +377,12 @@ void CGlueMgr::PollAccountLogin(int32_t errorCode, const char* msg, int32_t comp
FrameScript_SignalEvent(4, "%s", msg); FrameScript_SignalEvent(4, "%s", msg);
} }
if (complete) { if (!complete) {
return;
}
// Error
if (result == 0) { if (result == 0) {
if (errorCode != 2) { if (errorCode != 2) {
// TODO // TODO
@ -385,12 +392,12 @@ void CGlueMgr::PollAccountLogin(int32_t errorCode, const char* msg, int32_t comp
CGlueMgr::m_showedDisconnect = 0; CGlueMgr::m_showedDisconnect = 0;
if (errorCode == 2) { if (errorCode == 2) {
// TODO CGlueMgr::m_disconnectPending = 1; CGlueMgr::m_disconnectPending = 1;
// TODO ClientServices::Connection()->Disconnect(); ClientServices::Connection()->Disconnect();
} }
if (errorCode != 13) { if (errorCode != 13) {
// TODO CCharacterSelection::ClearCharacterList(); CCharacterSelection::ClearCharacterList();
if (ClientServices::GetInstance()->m_realmList.Count()) { if (ClientServices::GetInstance()->m_realmList.Count()) {
FrameScript_SignalEvent(5, nullptr); FrameScript_SignalEvent(5, nullptr);
@ -410,11 +417,29 @@ void CGlueMgr::PollAccountLogin(int32_t errorCode, const char* msg, int32_t comp
return; return;
} }
// Success
if (op == COP_CONNECT) { if (op == COP_CONNECT) {
ClientServices::Connection()->AccountLogin(CGlueMgr::m_accountName, "", CURRENT_REGION, CURRENT_LANGUAGE); ClientServices::Connection()->AccountLogin(CGlueMgr::m_accountName, "", CURRENT_REGION, CURRENT_LANGUAGE);
return; return;
} }
CGlueMgr::m_idleState = IDLE_NONE;
CGlueMgr::m_showedDisconnect = 0;
CCharacterSelection::ClearCharacterList();
// TODO streaming, trial, and expansion checks
auto realm = ClientServices::GetSelectedRealm();
auto categoryRec = g_cfg_CategoriesDB.GetRecord(realm->category);
if (categoryRec) {
ValidateNameInitialize(categoryRec->m_localeMask, categoryRec->m_createCharsetMask);
} else {
ValidateNameInitialize(1 << CURRENT_LANGUAGE, 0);
} }
CGlueMgr::SetScreen("charselect");
} }
void CGlueMgr::PollEnterWorld() { void CGlueMgr::PollEnterWorld() {

5
src/glue/Character.cpp Normal file
View File

@ -0,0 +1,5 @@
#include "glue/Character.hpp"
void ValidateNameInitialize(int32_t localeMask, int32_t charsetMask) {
// TODO
}

8
src/glue/Character.hpp Normal file
View File

@ -0,0 +1,8 @@
#ifndef GLUE_CHARACTER_HPP
#define GLUE_CHARACTER_HPP
#include <cstdint>
void ValidateNameInitialize(int32_t localeMask, int32_t charsetMask);
#endif