mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 08:42:45 +03:00
feat(glue): implement more of CGlueMgr::PollAccountLogin
This commit is contained in:
parent
d3d28c1bce
commit
f479d6ab53
@ -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,46 +377,69 @@ 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) {
|
||||||
if (result == 0) {
|
return;
|
||||||
if (errorCode != 2) {
|
}
|
||||||
|
|
||||||
|
// Error
|
||||||
|
|
||||||
|
if (result == 0) {
|
||||||
|
if (errorCode != 2) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
CGlueMgr::m_idleState = IDLE_NONE;
|
||||||
|
CGlueMgr::m_showedDisconnect = 0;
|
||||||
|
|
||||||
|
if (errorCode == 2) {
|
||||||
|
CGlueMgr::m_disconnectPending = 1;
|
||||||
|
ClientServices::Connection()->Disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errorCode != 13) {
|
||||||
|
CCharacterSelection::ClearCharacterList();
|
||||||
|
|
||||||
|
if (ClientServices::GetInstance()->m_realmList.Count()) {
|
||||||
|
FrameScript_SignalEvent(5, nullptr);
|
||||||
|
CRealmList::UpdateList();
|
||||||
|
} else {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
CGlueMgr::m_idleState = IDLE_NONE;
|
|
||||||
CGlueMgr::m_showedDisconnect = 0;
|
|
||||||
|
|
||||||
if (errorCode == 2) {
|
|
||||||
// TODO CGlueMgr::m_disconnectPending = 1;
|
|
||||||
// TODO ClientServices::Connection()->Disconnect();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (errorCode != 13) {
|
|
||||||
// TODO CCharacterSelection::ClearCharacterList();
|
|
||||||
|
|
||||||
if (ClientServices::GetInstance()->m_realmList.Count()) {
|
|
||||||
FrameScript_SignalEvent(5, nullptr);
|
|
||||||
CRealmList::UpdateList();
|
|
||||||
} else {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!SStrCmpI(CGlueMgr::m_currentScreen, "charselect", STORM_MAX_STR)) {
|
|
||||||
CGlueMgr::SetScreen("login");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (op == COP_CONNECT) {
|
if (!SStrCmpI(CGlueMgr::m_currentScreen, "charselect", STORM_MAX_STR)) {
|
||||||
ClientServices::Connection()->AccountLogin(CGlueMgr::m_accountName, "", CURRENT_REGION, CURRENT_LANGUAGE);
|
CGlueMgr::SetScreen("login");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Success
|
||||||
|
|
||||||
|
if (op == COP_CONNECT) {
|
||||||
|
ClientServices::Connection()->AccountLogin(CGlueMgr::m_accountName, "", CURRENT_REGION, CURRENT_LANGUAGE);
|
||||||
|
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
5
src/glue/Character.cpp
Normal 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
8
src/glue/Character.hpp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef GLUE_CHARACTER_HPP
|
||||||
|
#define GLUE_CHARACTER_HPP
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
void ValidateNameInitialize(int32_t localeMask, int32_t charsetMask);
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Reference in New Issue
Block a user