rodecomp/Source/Contents/Party/StopRecruitingAsyncWork.cpp
ragnarok-clanker 0fb17beeda Decompile fn_03716 (CStopRecruitingAsyncWork::Execute)
Batch #18417 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review.

- fn_03716 CStopRecruitingAsyncWork::Execute: logic confirmed by peer review

Peer-reviewed-by: eAthena, bibinir
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-11-12 14:16:04 +00:00

84 lines
3.2 KiB
C++

#include "Contents/Party/AdventurerAgencyMgr.h"
#include "Contents/Party/StopRecruitingAsyncWork.h"
#include "Network/Http/CURLMgr.h"
#include "Network/Http/CURLPostHander.h"
#include "Network/TextEncoding.h"
#include "Utility/Cipher/XorBytes.h"
#include "Utility/Text/FormatString.h"
#include "Utility/Cipher/LocalEncryptedName.h"
#include "Utility/Cipher/CryptName.h"
#include "Utility/Cipher/Obfuscate.h"
#include <cstdio>
#include <windows.h>
#include <timeapi.h>
namespace {
constexpr char sourceFile[] = "C:\\repositories\\RagnarokClient\\RagnarokClient\\Contents\\AdventurerAgency\\CStopRecruitingAsyncWork.cpp";
// INLINED
}
// GLOBAL: gl_25606
const char* g_stopRecruitingPoolName = OBFUSCATE_BYTES_TEXT("Stop_Recruiting", 0xD97D5DBDBB2F2709ULL);
// OFFSET: 0x005D5D70
// FUNCTION: fn_03711
CStopRecruitingAsyncWork::CStopRecruitingAsyncWork()
: NAsyncWork(g_stopRecruitingPoolName), m_accountId(0), m_masterAccountId(0),
m_diagnostic(false, std::string(OBFUSCATE_BYTES_TEXT("unknwon", 0xA5FD29D7AB6DC59FULL)), sourceFile, 28) {
}
// INLINED
CStopRecruitingAsyncWork::~CStopRecruitingAsyncWork() = default;
// OFFSET: 0x005D64A0
// FUNCTION: fn_03714
void CStopRecruitingAsyncWork::Reset() {
}
// OFFSET: 0x005D6230
// FUNCTION: fn_03713
void CStopRecruitingAsyncWork::Bind(std::uint32_t accountId, std::string world, std::string url, std::string token, std::uint32_t masterAccountId) {
this->m_group = timeGetTime();
this->m_accountId = accountId;
this->m_masterAccountId = masterAccountId;
this->m_key = 0;
this->m_world = world;
this->m_url = url;
this->m_token = token;
this->m_diagnostic = AsyncDiagnostic(false, std::string(OBFUSCATE_BYTES_TEXT("unknwon", 0xF14F79170939C7F1ULL)), sourceFile, 50);
}
// OFFSET: 0x005D6570
// FUNCTION: fn_03716
bool CStopRecruitingAsyncWork::Execute() {
char account[64] = {};
StringFormat(account, sizeof(account), _TRUNCATE, "%lu", this->m_accountId);
char master[64] = {};
StringFormat(master, sizeof(master), _TRUNCATE, "%lu", this->m_masterAccountId);
const std::string world = CCURLMgr::GetInstance()->ToUtf8(this->m_world);
CCURLPostHander handler(this->m_url);
handler.AddField(OBFUSCATE_BYTES_TEXT("AID", 0x050505679903579BULL), account, 4);
handler.AddField(OBFUSCATE_BYTES_TEXT("WorldName", 0xDD3913D5D7F97BE1ULL), world, 4);
handler.AddField(OBFUSCATE_BYTES_TEXT("AuthToken", 0xBF2B4B31397FF5A7ULL), this->m_token, 4);
handler.AddField(OBFUSCATE_BYTES_TEXT("MasterAID", 0x83EFBFBB37EDBDBDULL), master, 4);
if (handler.Perform() != 0) {
this->m_diagnostic = AsyncDiagnostic(false, std::string(OBFUSCATE_BYTES_TEXT("fail", 0x39FF7FB50DEB998FULL)), sourceFile, 92);
} else {
this->m_response = CCURLMgr::GetInstance()->FromUtf8(handler.Response());
this->m_diagnostic = AsyncDiagnostic(true, std::string(OBFUSCATE_BYTES_TEXT("success", 0x2FE993D1DDE1F197ULL)), sourceFile, 101);
}
return false;
}
// OFFSET: 0x005D64B0
// FUNCTION: fn_03715
void CStopRecruitingAsyncWork::Complete() {
CAdventurerAgencyMgr* manager = g_adventurerAgencyMgr;
manager->CompleteStopRecruiting(this->m_diagnostic, this->m_response);
}
template void std::deque<CStopRecruitingAsyncWork*>::push_back(CStopRecruitingAsyncWork*&&);