Maintenance: [forced, user-approved] Family G30: remove ModeBaseEvents, CharacterConfigSave, AccountConfigLoad. ModeBaseEvents::Send
Batch #10264 by ragnarok-clanker: forced by an admin (2 lower score(s), 29 changed function(s)); checked with 511 compiled unit(s), including every includer of Source/Client/Session.h, Source/Contents/Async/AsyncWorkMgr.h, Source/Contents/Hotkeys/EmotionHotkeys.h, Source/Contents/UserData/AccountLinkedUserDataLoadAsyncWork.h, Source/Contents/UserData/AccountLinkedUserDataMgr.h, Source/Contents/UserData/CharacterLinkedUserDataMgr.h, Source/Contents/UserData/NormalItemSlots.h, Source/Client/ModeBaseEvents.h, Source/Contents/UserData/AccountConfigLoad.h, Source/Contents/UserData/CharacterConfigSave.h. Deletes: Source/Client/ModeBaseEvents.h, Source/Contents/UserData/AccountConfigLoad.h, Source/Contents/UserData/CharacterConfigSave.h
This commit is contained in:
parent
643cf8e993
commit
749039eea6
28 changed files with 101 additions and 211 deletions
|
|
@ -1,7 +1,6 @@
|
|||
#include "Client/Session.h"
|
||||
#include "Client/Session.h"
|
||||
#include "Contents/Async/AsyncWorkMgr.h"
|
||||
#include "Contents/UserData/CharacterConfigSave.h"
|
||||
#include "Contents/UserData/CharacterLinkedUserDataMgr.h"
|
||||
#include "Contents/UserData/NormalItemSlots.h"
|
||||
#include "Contents/Skills/PlayerSkillBundle.h"
|
||||
|
|
@ -12,19 +11,23 @@
|
|||
|
||||
// OFFSET: 0x00DE0E40
|
||||
// FUNCTION: fn_23474
|
||||
int CharacterConfigSave::UseLevel(int id) const {
|
||||
int CSession::UseLevel(int id) const {
|
||||
const auto key = static_cast<std::uint32_t>(id);
|
||||
|
||||
if (key - 1u <= 0x1F3D) {
|
||||
return this->useLevels[key];
|
||||
return this->m_skillBundle.unknown_0064[key];
|
||||
}
|
||||
|
||||
if (id > 10000) {
|
||||
return this->additionalLevels[key - 10000u];
|
||||
return this->unknown_0710[key - 10000u];
|
||||
}
|
||||
|
||||
if (key - 8000u <= 60) {
|
||||
return this->homunculusLevels[key - 8000u];
|
||||
if (this->IsHomunculusSkill(key)) {
|
||||
const int index = id - 8000;
|
||||
|
||||
if (index > -1) {
|
||||
return this->m_homunSkillLevels[index];
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -32,7 +35,7 @@ int CharacterConfigSave::UseLevel(int id) const {
|
|||
|
||||
// OFFSET: 0x005E6EF0
|
||||
// FUNCTION: fn_03933
|
||||
void CCharacterLinkedUserDataMgr::Save(CharacterConfigSave& context, const char* token16, CAsyncWorkMgr& workManager) {
|
||||
void CCharacterLinkedUserDataMgr::Save() {
|
||||
if (!this->m_loaded) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -44,14 +47,13 @@ void CCharacterLinkedUserDataMgr::Save(CharacterConfigSave& context, const char*
|
|||
Json::Value values;
|
||||
|
||||
struct SaveUseSkillLevel {
|
||||
const CharacterConfigSave* context;
|
||||
Json::Value* values;
|
||||
|
||||
// OFFSET: 0x005E7AE0
|
||||
// FUNCTION: fn_03940
|
||||
bool operator()(CSkillInfo* skill) const {
|
||||
const int id = static_cast<int>(skill->id);
|
||||
const int level = reinterpret_cast<const CharacterConfigSave*>(&g_session)->UseLevel(id);
|
||||
const int level = g_session.UseLevel(id);
|
||||
if (level != 0) {
|
||||
Json::Value value;
|
||||
value["SKID"] = id;
|
||||
|
|
@ -63,17 +65,16 @@ void CCharacterLinkedUserDataMgr::Save(CharacterConfigSave& context, const char*
|
|||
}
|
||||
};
|
||||
|
||||
context.skills.ForEachGrouped(SaveUseSkillLevel{&context, &values});
|
||||
g_session.m_skillBundle.ForEachGrouped(SaveUseSkillLevel{&values});
|
||||
data["UseSkillInfo"] = values;
|
||||
}
|
||||
|
||||
if (g_session.GetOption(8) != 0) {
|
||||
Json::Value values;
|
||||
|
||||
for (const CSkillInfo& skill : context.homunculusSkills) {
|
||||
for (const CSkillInfo& skill : g_session.m_homunSkills) {
|
||||
const int id = static_cast<int>(skill.id);
|
||||
const auto index = skill.id - 8000u;
|
||||
const int level = static_cast<int>(index) < 0 ? 0 : context.homunculusLevels[index];
|
||||
const int level = g_session.HomunSkillLevel(id);
|
||||
|
||||
if (level != 0) {
|
||||
Json::Value value;
|
||||
|
|
@ -86,17 +87,17 @@ void CCharacterLinkedUserDataMgr::Save(CharacterConfigSave& context, const char*
|
|||
data["HomunSkillInfo"] = values;
|
||||
}
|
||||
|
||||
data["ItemComparison"] = context.serviceOptions.Get(264) != 0;
|
||||
data["SortPrivateTab"] = context.sortPrivate;
|
||||
ExportNormalItemSlots(data, context.items, context.saved, context.itemSlotActive);
|
||||
data["ItemComparison"] = g_serviceOptions.Get(264) != 0;
|
||||
data["SortPrivateTab"] = g_sortPrivateTab;
|
||||
this->ExportNormalItemSlots(data);
|
||||
|
||||
if (!data.isNull()) {
|
||||
root["data"] = data;
|
||||
Json::StyledWriter writer;
|
||||
const std::string response = writer.write(root);
|
||||
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->SaveUrl();
|
||||
workManager.SaveCharacter(this->m_accountId, this->m_characterId, this->m_accountName, url, token, response);
|
||||
g_asyncWorkMgr->SaveCharacter(this->m_accountId, this->m_characterId, this->m_accountName, url, token, response);
|
||||
|
||||
++this->m_pendingSaves;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue