mirror of
https://github.com/diamante0018/MW3ServerFreezer.git
synced 2025-04-20 12:05:42 +00:00
Fix security check here as well (stop coby pasting code from gsc utils maybe)
This commit is contained in:
parent
b48ab294b8
commit
5458381253
@ -1,10 +1,11 @@
|
||||
#include <std_include.hpp>
|
||||
#include "../loader/component_loader.hpp"
|
||||
|
||||
#include <utils/thread.hpp>
|
||||
|
||||
namespace console {
|
||||
namespace {
|
||||
std::thread thread;
|
||||
std::thread::id async_thread_id;
|
||||
|
||||
LRESULT __stdcall sys_start_console(HWND, UINT, WPARAM, LPARAM) {
|
||||
game::Sys_ShowConsole();
|
||||
@ -29,12 +30,16 @@ void show_console() {
|
||||
class component final : public component_interface {
|
||||
public:
|
||||
void post_unpack() override {
|
||||
thread = std::thread([]() {
|
||||
thread = utils::thread::create_named_thread("Console Thread", []() {
|
||||
console_unlock();
|
||||
show_console();
|
||||
});
|
||||
}
|
||||
|
||||
async_thread_id = thread.get_id();
|
||||
void pre_destroy() override {
|
||||
if (thread.joinable()) {
|
||||
thread.join();
|
||||
}
|
||||
}
|
||||
};
|
||||
} // namespace console
|
||||
|
Loading…
x
Reference in New Issue
Block a user