Batch #11737 by cremane: 0 byte-identical, 1 confirmed by peer review. - fn_18171 ResourceFailures::Report: logic confirmed by peer review Peer-reviewed-by: Yommy, KWDev Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
35 lines
1 KiB
C++
35 lines
1 KiB
C++
#include "Resource/ResourceFailures.h"
|
|
#include "UI/Window/UIWindowMgr.h"
|
|
#include "Utility/Threading/NSyncObject.h"
|
|
|
|
#include <cstdint>
|
|
#include <cstring>
|
|
|
|
// 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(1, reinterpret_cast<std::intptr_t>("Resource File Loading fail"), 255, 0, 0, 0);
|
|
g_windowMgr.SendNotice(1, reinterpret_cast<std::intptr_t>(requested.c_str()), 255, 0, 0, 0);
|
|
g_windowMgr.SendNotice(1, reinterpret_cast<std::intptr_t>(resolved.c_str()), 255, 0, 0, 0);
|
|
}
|