Batch #12020 by Yommy: 3 byte-identical, 0 confirmed by peer review. - fn_07584 NAsyncWorkThread::Receive: byte-identical - fn_07583 NAsyncWorkThread::RequestStop: byte-identical - fn_07613 NMessageMgr::Send: byte-identical Merged automatically: every function is byte-identical to the original.
38 lines
981 B
C++
38 lines
981 B
C++
#ifndef RAGNAROK_SOURCE_UTILITY_ASYNC_NMESSAGEMGR_H
|
|
#define RAGNAROK_SOURCE_UTILITY_ASYNC_NMESSAGEMGR_H
|
|
|
|
#include <cstdint>
|
|
#include <map>
|
|
#include <windows.h>
|
|
|
|
class NInter {
|
|
public:
|
|
virtual void Receive(std::uint32_t argumentLow, std::uint32_t argumentHigh, std::uint32_t id) = 0;
|
|
virtual ~NInter();
|
|
};
|
|
|
|
class NMessageMgr {
|
|
public:
|
|
NMessageMgr();
|
|
virtual ~NMessageMgr();
|
|
|
|
static bool Initialize();
|
|
static void Shutdown();
|
|
bool Register(std::uint32_t objectId, NInter* object);
|
|
bool Send(std::uint32_t objectId, std::uint32_t argumentLow, std::uint32_t argumentHigh, std::uint32_t id);
|
|
void Unregister(std::uint32_t objectId, NInter* object);
|
|
|
|
protected:
|
|
/* 0004 */ CRITICAL_SECTION m_criticalSection;
|
|
/* 001C */ bool m_enabled;
|
|
/* 0020 */ std::map<std::uint32_t, NInter*> m_objects;
|
|
};
|
|
|
|
extern NMessageMgr* g_messageMgr;
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
static_assert(sizeof(NInter) == 4);
|
|
static_assert(sizeof(NMessageMgr) == 40);
|
|
#endif
|
|
|
|
#endif
|