rodecomp/Source/Contents/Party/StopRecruitingCompletion.cpp
ragnarok-clanker 8b3ba20b56 Maintenance: [forced, user-approved] Family G9: remove the adventurer-agency bundle family: AgencyRequestContext, StopRecruitingConte
Batch #10208 by ragnarok-clanker: forced by an admin (10 lower score(s), 42 changed function(s)); checked with 119 compiled unit(s), including every includer of Source/Client/ModeBaseEvents.h, Source/Contents/Async/AsyncWorkMgr.h, Source/Contents/Configuration/ServiceConfiguration.h, Source/Contents/Party/AdventurerAgencyMgr.h, Source/Contents/Party/LoadPartyInfoAsyncWork.h, Source/Contents/Party/PartyJoinResult.h, Source/Contents/Party/RegisterPartyAsyncWork.h, Source/Contents/Party/StopRecruitingAsyncWork.h, Source/UI/Party/UIAdvenPartyBoardWnd.h, Source/UI/Party/UIApplyForPartyWnd.h, Source/UI/Party/UIPartyInfoWnd.h, Source/UI/Party/UIRegisterPartyWnd.h, Source/Contents/Party/AgencyRequestContext.h.
Deletes: Source/Contents/Party/AgencyRequestContext.h
2026-11-02 22:46:30 +00:00

57 lines
1.4 KiB
C++

#include "Client/Session.h"
#include "Contents/Party/AdventurerAgencyMgr.h"
#include "Utility/Async/AsyncDiagnostic.h"
#include "Contents/MessageTable.h"
#include "UI/Party/UIAdvenPartyBoardWnd.h"
#include "UI/Buttons/UIBasicButton.h"
#include "UI/Window/UIWindowMgr.h"
#include <json/reader.h>
#include <json/value.h>
// OFFSET: 0x005CD0A0
// FUNCTION: fn_03668
void CAdventurerAgencyMgr::CompleteStopRecruiting(AsyncDiagnostic diagnostic, std::string response) {
--this->pending;
const auto notify = [&](int id, unsigned color) {
g_windowMgr.SendNotice(1, reinterpret_cast<std::intptr_t>(LookupMessage(id)), color, 0, 0, 0);
};
if (!diagnostic.success) {
if (this->unknown_0008 == g_session.m_aid) {
notify(3507, 0xFF);
}
return;
}
Json::Value root;
Json::Reader reader;
const std::string document(response.c_str());
if (!reader.parse(document, root, true)) {
return;
}
const int type = root["Type"].asInt();
if (type == 2 || type == 3) {
if (this->unknown_0008 == g_session.m_aid) {
notify(3507, 0xFF);
}
return;
}
if (this->unknown_0008 == g_session.m_aid) {
notify(3459, 0xFFFF64);
}
this->registered = false;
auto* board = static_cast<UIAdvenPartyBoardWnd*>(g_windowMgr.LookupWindow(324));
if (board) {
board->stop->Enable(0);
board->SendMsg(nullptr, 6, 415, 0, 0, 0);
}
}