t8-mod/source/proxy-dll/definitions/game.cpp
project-bo4 81a92f69a4 Custom CMD & Structural Upgrade
+ Added custom commands interface
+ Tidy up and reorder game interface
2024-05-31 15:35:20 -07:00

38 lines
1.0 KiB
C++

#include <std_include.hpp>
#include "game.hpp"
namespace game
{
const char* Com_GetVersionString()
{
static std::string version_string{};
if (version_string.empty()) {
version_string = std::format("BlackOps4 {}", Com_GetBuildVersion());
}
return version_string.data();
}
void verify_game_version()
{
if (*(int*)0x1449CA7E8_g != 13869365) // BlackOps4 CL(13869365) BEYQBBUILD106 DEV [Wed Feb 22 16:31:32 2023]
{
throw std::runtime_error("Unsupported BlackOps4.exe Version. This DLL Expects Latest BNET Build");
}
#ifdef DEBUG
logger::write(logger::LOG_TYPE_DEBUG, "[ SYSTEM ]: Verified Game Version '%s'", Com_GetVersionString());
#endif // DEBUG
}
scoped_critical_section::scoped_critical_section(int32_t s, scoped_critical_section_type type) : _s(0), _hasOwnership(false), _isScopedRelease(false), _next(nullptr)
{
game::ScopedCriticalSectionConstructor(this, s, type);
}
scoped_critical_section::~scoped_critical_section()
{
game::ScopedCriticalSectionDestructor(this);
}
}