Maintenance: [forced, user-approved] Family G27 (resubmit of 10254 rebased on e235d90a; only conflict was the AsyncWorkMgr.h forward
Batch #10259 by ragnarok-clanker: forced by an admin (1 lower score(s), 11 changed function(s)); checked with 508 compiled unit(s), including every includer of Source/Contents/Async/AsyncWorkMgr.h, Source/Contents/Skills/SkillLevelRegistry.h, Source/Contents/UserData/CharacterLinkedUserDataLoadAsyncWork.h, Source/Contents/UserData/CharacterLinkedUserDataMgr.h, Source/UI/Window/UIWindowMgr.h, Source/UI/Window/UIWindowMgr.inl, Source/Contents/Skills/SkillLevelConfig.h, Source/Contents/UserData/CharacterConfigLoad.h, Source/UI/Shortcuts/NormalItemSlotLoad.h. Deletes: Source/Contents/Skills/SkillLevelConfig.h, Source/Contents/UserData/CharacterConfigLoad.h, Source/UI/Shortcuts/NormalItemSlotLoad.h
This commit is contained in:
parent
15ee30e2aa
commit
bd0ade90cd
16 changed files with 63 additions and 124 deletions
|
|
@ -1,11 +1,9 @@
|
|||
#include "Client/Session.h"
|
||||
#include "Contents/Async/AsyncWorkMgr.h"
|
||||
#include "Contents/UserData/CharacterConfigLoad.h"
|
||||
#include "Contents/UserData/CharacterLinkedUserDataMgr.h"
|
||||
#include "Contents/Configuration/ServiceOptions.h"
|
||||
#include "Contents/Skills/SkillLevelConfig.h"
|
||||
#include "Contents/Skills/SkillLevelRegistry.h"
|
||||
#include "UI/Shortcuts/NormalItemSlotLoad.h"
|
||||
#include "UI/Window/UIWindowMgr.h"
|
||||
#include "Utility/Async/AsyncDiagnostic.h"
|
||||
|
||||
#include <json/reader.h>
|
||||
|
|
@ -14,7 +12,7 @@
|
|||
// OFFSET: 0x005E6090
|
||||
// FUNCTION: fn_03927
|
||||
void CCharacterLinkedUserDataMgr::CompleteLoad(
|
||||
AsyncDiagnostic diagnostic, std::uint32_t accountId, std::uint32_t characterId, std::string accountName, std::string response, CharacterConfigLoad& context
|
||||
AsyncDiagnostic diagnostic, std::uint32_t accountId, std::uint32_t characterId, std::string accountName, std::string response
|
||||
) {
|
||||
if (!diagnostic.success) {
|
||||
return;
|
||||
|
|
@ -31,22 +29,21 @@ void CCharacterLinkedUserDataMgr::CompleteLoad(
|
|||
const int type = root["Type"].asInt();
|
||||
|
||||
if (type == 4) {
|
||||
context.registry.Load();
|
||||
LoadSkillUseLevelRegistry();
|
||||
g_session.SetOption(7, 1, 0);
|
||||
g_session.SetOption(8, 1, 0);
|
||||
this->m_loaded = true;
|
||||
} else if (type == 1) {
|
||||
Json::Value& data = root["data"];
|
||||
LoadUseSkillLevels(data, context.useLevels);
|
||||
LoadHomunculusSkillLevels(data, context.homunculusLevels);
|
||||
this->LoadUseSkillLevels(root["data"]);
|
||||
this->LoadHomunculusSkillLevels(root["data"]);
|
||||
|
||||
const Json::Value comparison = data["ItemComparison"];
|
||||
context.serviceOptions.Set(264, comparison.isNull() ? true : comparison.asBool());
|
||||
const Json::Value comparison = root["data"]["ItemComparison"];
|
||||
g_serviceOptions.Set(264, comparison.isNull() ? true : comparison.asBool());
|
||||
|
||||
const Json::Value sorting = data["SortPrivateTab"];
|
||||
context.sortPrivate = sorting.isNull() ? false : sorting.asBool();
|
||||
const Json::Value sorting = root["data"]["SortPrivateTab"];
|
||||
g_sortPrivateTab = sorting.isNull() ? false : sorting.asBool();
|
||||
|
||||
LoadNormalItemSlots(data, context.items, context.saved, context.itemSlotActive, context.windows);
|
||||
this->LoadNormalItemSlots(root["data"]);
|
||||
this->m_loaded = true;
|
||||
}
|
||||
|
||||
|
|
@ -57,14 +54,12 @@ void CCharacterLinkedUserDataMgr::CompleteLoad(
|
|||
|
||||
// OFFSET: 0x005E6E20
|
||||
// FUNCTION: fn_03932
|
||||
void CCharacterLinkedUserDataMgr::Load(
|
||||
std::uint32_t accountId, std::uint32_t characterId, std::string accountName, const char* token16, CAsyncWorkMgr& workManager, CharacterConfigLoad& context
|
||||
) {
|
||||
void CCharacterLinkedUserDataMgr::Load(std::uint32_t accountId, std::uint32_t characterId, std::string accountName) {
|
||||
if (accountId == 0 || characterId == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string token(token16, 16);
|
||||
const std::string token(reinterpret_cast<const char*>(&g_session.unknown_807C[0x08]), 16);
|
||||
const std::string url = this->LoadUrl();
|
||||
workManager.LoadCharacter(accountId, characterId, accountName, url, token, context);
|
||||
g_asyncWorkMgr->LoadCharacter(accountId, characterId, accountName, url, token);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
#ifndef RAGNAROK_SOURCE_CONTENTS_USERDATA_CHARACTERCONFIGLOAD_H
|
||||
#define RAGNAROK_SOURCE_CONTENTS_USERDATA_CHARACTERCONFIGLOAD_H
|
||||
|
||||
struct NormalItemSlot;
|
||||
struct NormalItemSlotWindow;
|
||||
struct ServiceOptions;
|
||||
struct SkillLevelRegistry;
|
||||
#include "UI/Window/WindowManagerWindows.h"
|
||||
|
||||
struct CharacterConfigLoad {
|
||||
int* useLevels;
|
||||
int* homunculusLevels;
|
||||
ServiceOptions& serviceOptions;
|
||||
SkillLevelRegistry& registry;
|
||||
bool& sortPrivate;
|
||||
NormalItemSlot* items;
|
||||
NormalItemSlotWindow& saved;
|
||||
bool& itemSlotActive;
|
||||
WindowManagerWindows& windows;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -22,7 +22,7 @@ namespace {
|
|||
// OFFSET: 0x005E4A50
|
||||
// FUNCTION: fn_03916
|
||||
CCharacterLinkedUserDataLoadAsyncWork::CCharacterLinkedUserDataLoadAsyncWork()
|
||||
: NAsyncWork("CharacterLinkedUserData_Load"), m_accountId(0), m_characterId(0), m_diagnostic(Diagnostic(false, "unknwon", 29)), m_context(nullptr) {
|
||||
: NAsyncWork("CharacterLinkedUserData_Load"), m_accountId(0), m_characterId(0), m_diagnostic(Diagnostic(false, "unknwon", 29)) {
|
||||
}
|
||||
|
||||
// INLINED
|
||||
|
|
@ -36,7 +36,7 @@ void CCharacterLinkedUserDataLoadAsyncWork::Reset() {
|
|||
// OFFSET: 0x005E4F10
|
||||
// FUNCTION: fn_03918
|
||||
void CCharacterLinkedUserDataLoadAsyncWork::Bind(
|
||||
std::uint32_t accountId, std::uint32_t characterId, std::string accountName, std::string url, std::string token, CharacterConfigLoad& context
|
||||
std::uint32_t accountId, std::uint32_t characterId, std::string accountName, std::string url, std::string token
|
||||
) {
|
||||
this->m_group = timeGetTime();
|
||||
this->m_accountId = accountId;
|
||||
|
|
@ -46,7 +46,6 @@ void CCharacterLinkedUserDataLoadAsyncWork::Bind(
|
|||
this->m_url = url;
|
||||
this->m_token = token;
|
||||
this->m_response.clear();
|
||||
this->m_context = &context;
|
||||
|
||||
AsyncDiagnostic diagnostic = Diagnostic(false, "unknwon", 55);
|
||||
this->m_diagnostic.MoveFrom(diagnostic);
|
||||
|
|
@ -80,6 +79,6 @@ bool CCharacterLinkedUserDataLoadAsyncWork::Execute() {
|
|||
// FUNCTION: fn_03920
|
||||
void CCharacterLinkedUserDataLoadAsyncWork::Complete() {
|
||||
g_characterLinkedUserDataMgr->CompleteLoad(
|
||||
this->m_diagnostic, this->m_accountId, this->m_characterId, this->m_accountName, this->m_response, *this->m_context
|
||||
this->m_diagnostic, this->m_accountId, this->m_characterId, this->m_accountName, this->m_response
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@
|
|||
#include "Utility/Async/AsyncDiagnostic.h"
|
||||
#include "Utility/Async/NAsyncWork.h"
|
||||
|
||||
struct CharacterConfigLoad;
|
||||
|
||||
class CCharacterLinkedUserDataLoadAsyncWork : public NAsyncWork {
|
||||
public:
|
||||
CCharacterLinkedUserDataLoadAsyncWork();
|
||||
|
|
@ -13,7 +11,7 @@ public:
|
|||
void Reset() override;
|
||||
bool Execute() override;
|
||||
void Complete() override;
|
||||
void Bind(std::uint32_t accountId, std::uint32_t characterId, std::string accountName, std::string url, std::string token, CharacterConfigLoad& context);
|
||||
void Bind(std::uint32_t accountId, std::uint32_t characterId, std::string accountName, std::string url, std::string token);
|
||||
|
||||
protected:
|
||||
/* 0028 */ std::uint32_t m_accountId;
|
||||
|
|
@ -23,12 +21,10 @@ protected:
|
|||
/* 0060 */ std::string m_token;
|
||||
/* 0078 */ std::string m_response;
|
||||
/* 0090 */ AsyncDiagnostic m_diagnostic;
|
||||
|
||||
CharacterConfigLoad* m_context;
|
||||
};
|
||||
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
static_assert(sizeof(CCharacterLinkedUserDataLoadAsyncWork) == 204);
|
||||
static_assert(sizeof(CCharacterLinkedUserDataLoadAsyncWork) == 200);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@
|
|||
|
||||
class LuaScript;
|
||||
struct AsyncDiagnostic;
|
||||
struct CharacterConfigLoad;
|
||||
namespace Json {
|
||||
class Value;
|
||||
}
|
||||
struct CharacterConfigSave;
|
||||
class CAsyncWorkMgr;
|
||||
|
||||
|
|
@ -19,12 +21,11 @@ public:
|
|||
std::string LoadUrl() const;
|
||||
std::string SaveUrl() const;
|
||||
void CompleteSave();
|
||||
void CompleteLoad(
|
||||
AsyncDiagnostic diagnostic, std::uint32_t accountId, std::uint32_t characterId, std::string accountName, std::string response, CharacterConfigLoad& context
|
||||
);
|
||||
void Load(
|
||||
std::uint32_t accountId, std::uint32_t characterId, std::string accountName, const char* token16, CAsyncWorkMgr& workManager, CharacterConfigLoad& context
|
||||
);
|
||||
void CompleteLoad(AsyncDiagnostic diagnostic, std::uint32_t accountId, std::uint32_t characterId, std::string accountName, std::string response);
|
||||
void Load(std::uint32_t accountId, std::uint32_t characterId, std::string accountName);
|
||||
void LoadUseSkillLevels(Json::Value& data);
|
||||
void LoadHomunculusSkillLevels(Json::Value& data);
|
||||
void LoadNormalItemSlots(Json::Value& data);
|
||||
void Save(CharacterConfigSave& context, const char* token16, CAsyncWorkMgr& workManager);
|
||||
void RefreshUrls(LuaScript& script, const char* host, const char* port, const char* overrideKey);
|
||||
void Reset(LuaScript& script, const char* host, const char* port, const char* overrideKey);
|
||||
|
|
@ -41,6 +42,7 @@ protected:
|
|||
};
|
||||
|
||||
extern CCharacterLinkedUserDataMgr* g_characterLinkedUserDataMgr;
|
||||
extern bool g_sortPrivateTab;
|
||||
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
static_assert(sizeof(CCharacterLinkedUserDataMgr) == 96);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue