rodecomp/Source/Contents/Party/MyPartyCompletion.cpp
ragnarok-clanker a47d20f8be Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.

Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
2026-10-25 07:42:41 +00:00

61 lines
1.7 KiB
C++

#include "Contents/Party/AdventurerAgencyMgr.h"
#include "UI/Party/UIAdvenPartyBoardWnd.h"
#include "UI/Window/WindowManagerWindows.h"
#include "Utility/Async/AsyncDiagnostic.h"
#include <json/reader.h>
#include <json/value.h>
// OFFSET: 0x005CB810
// FUNCTION: fn_03660
void CAdventurerAgencyMgr::CompleteMyParty(AsyncDiagnostic diagnostic, std::string response, WindowManagerWindows& windows) {
--this->pending;
if (!diagnostic.success) {
return;
}
Json::Value root;
Json::Reader reader;
const std::string document(response.c_str());
if (!reader.parse(document, root, true)) {
return;
}
if (root["Type"].asInt() == 2 || root["Type"].asInt() == 3) {
return;
}
if (root["data"].isNull()) {
this->registered = false;
auto* board = static_cast<UIAdvenPartyBoardWnd*>(windows.EnsureWindow(324));
if (board) {
board->Registration(false);
}
return;
}
const Json::Value data = root["data"];
CAdvenPartyInfo info;
info.characterName = data.get("CharName", "").asString();
info.accountId = Id(data.get("AID", 0).asDouble());
info.characterId = Id(data.get("GID", 0).asDouble());
info.assist = data.get("Assist", 1).asInt() != 0;
info.healer = data.get("Healer", 1).asInt() != 0;
info.dealer = data.get("Dealer", 1).asInt() != 0;
info.tanker = data.get("Tanker", 1).asInt() != 0;
info.minimumLevel = data.get("MinLV", 0).asInt();
info.maximumLevel = data.get("MaxLV", 999).asInt();
info.type = data.get("Type", 1).asInt();
info.memo = data.get("Memo", "").asString();
auto* board = static_cast<UIAdvenPartyBoardWnd*>(windows.EnsureWindow(324));
if (board) {
board->SetOwnParty(info);
}
this->registered = true;
}