Owner-authorized source migration: 31 helper-only translation units were merged into their callers or existing inline headers; both build manifests updated. Includes the preserved source payload, Lua configuration matching wowdecomp, and exact malloca expansion without diagnostic pragmas. 449 native units compiled locally and 449 staged units compiled by the pinned server toolchain. No previously byte-matched function regressed. Compiler mapping diagnostics remain recorded as needs_cleanup, not accepted or peer-confirmed. Existing independent review records are preserved. README.md is intentionally unchanged.
56 lines
1.6 KiB
C++
56 lines
1.6 KiB
C++
#include "Contents/Emblems/EmblemDataMgr.h"
|
|
#include "Contents/Emblems/GuildEmblemReqBundle.h"
|
|
|
|
#include <algorithm>
|
|
#include <windows.h>
|
|
#include <timeapi.h>
|
|
|
|
// OFFSET: 0x0065C5F0
|
|
// FUNCTION: fn_05150
|
|
CGuildEmblemReqBundle::CGuildEmblemReqBundle() = default;
|
|
|
|
// INLINED
|
|
CGuildEmblemReqBundle::~CGuildEmblemReqBundle() = default;
|
|
|
|
// OFFSET: 0x0065CA90
|
|
// FUNCTION: fn_05154
|
|
void CGuildEmblemReqBundle::Add(std::uint32_t guildId, std::uint32_t version) {
|
|
const auto request = std::pair{guildId, version};
|
|
|
|
if (std::find(this->m_pending.begin(), this->m_pending.end(), request) == this->m_pending.end()) {
|
|
this->m_pending.push_back(request);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x0065CB90
|
|
// FUNCTION: fn_05155
|
|
void CGuildEmblemReqBundle::Update(
|
|
CEmblemDataMgr& emblems, std::uint32_t accountId, const std::string& accountName, const char* token16, CConnection& connection, CAsyncWorkMgr& manager
|
|
) {
|
|
while (!this->m_recent.empty()) {
|
|
if (timeGetTime() < this->m_recent.front().tick + 60000u) {
|
|
break;
|
|
}
|
|
|
|
this->m_recent.pop_front();
|
|
}
|
|
|
|
while (!this->m_pending.empty()) {
|
|
const auto request = this->m_pending.front();
|
|
const bool recent = std::any_of(this->m_recent.begin(), this->m_recent.end(), [&](const Recent& value) {
|
|
return value.guildId == request.first && value.version == request.second;
|
|
});
|
|
this->m_pending.pop_front();
|
|
|
|
if (recent) {
|
|
continue;
|
|
}
|
|
|
|
if (request.first != 0) {
|
|
emblems.Download(request.first, request.second, accountId, accountName, token16, connection, manager);
|
|
this->m_recent.push_back({request.first, request.second, timeGetTime()});
|
|
}
|
|
|
|
return;
|
|
}
|
|
}
|