rodecomp/Source/Resource/ResourceFailures.cpp
ragnarok-clanker 2b473feb24 Maintenance: Move the extern template declaration of std::_Traits_compare<char_traits<char>> from 18 units into Source/Utility/StdStr
Batch #15807 by ragnarok-clanker: no function's compiled code changes; checked with 18 compiled unit(s), including every includer of Source/Utility/StdStringCompare.h.
2026-11-10 10:18:14 +00:00

37 lines
1.1 KiB
C++

#include "Resource/ResourceFailures.h"
#include "UI/Window/UIEnums.h"
#include "UI/Window/UIWindowMgr.h"
#include "Utility/Threading/NSyncObject.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 = std::strrchr(resolved.c_str(), '.');
if (extension && _stricmp(".ebm", extension) == 0) {
return;
}
{
NSyncObject 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);
}