rodecomp/Source/Resource/ResourceFailures.cpp
ragnarok-clanker 7d2155b6c2 Decompile fn_18171 (ResourceFailures::Report)
Batch #16022 by Yommy: 0 byte-identical, 1 confirmed by peer review.

- fn_18171 ResourceFailures::Report: logic confirmed by peer review

Peer-reviewed-by: alisonrag, youko
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-11-10 14:19:13 +00:00

38 lines
1.2 KiB
C++

#include "Resource/ResourceFailures.h"
#include "UI/Window/UIEnums.h"
#include "UI/Window/UIWindowMgr.h"
#include "Utility/Text/GroupedInteger.h"
#include "Utility/Threading/CSyncObject.h"
#include <cstdint>
#include <cstring>
#include "Utility/StdStringCompare.h"
// GLOBAL: gl_24582
ResourceFailures g_resourceFailures;
// INLINED
ResourceFailures::ResourceFailures() {
InitializeCriticalSection(&this->m_lock);
}
// OFFSET: 0x00AEE310
// FUNCTION: fn_18171
void ResourceFailures::Report(std::string requested, std::string resolved) {
const char* extension = ReverseFindChar(resolved.c_str(), '.');
if (extension && _stricmp(".ebm", extension) == 0) {
return;
}
{
CSyncObject lock(&this->m_lock);
if (this->m_reported.find(resolved) != this->m_reported.end()) {
return;
}
this->m_reported.insert(resolved);
}
g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast<std::intptr_t>("Resource File Loading fail"), 255, 0, 0, 0);
g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast<std::intptr_t>(requested.c_str()), 255, 0, 0, 0);
g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast<std::intptr_t>(resolved.c_str()), 255, 0, 0, 0);
}