mirror of
https://github.com/diamante0018/MW3ServerFreezer.git
synced 2025-04-19 11:42:53 +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 <std_include.hpp>
|
||||||
#include "../loader/component_loader.hpp"
|
#include "../loader/component_loader.hpp"
|
||||||
|
|
||||||
|
#include <utils/thread.hpp>
|
||||||
|
|
||||||
namespace console {
|
namespace console {
|
||||||
namespace {
|
namespace {
|
||||||
std::thread thread;
|
std::thread thread;
|
||||||
std::thread::id async_thread_id;
|
|
||||||
|
|
||||||
LRESULT __stdcall sys_start_console(HWND, UINT, WPARAM, LPARAM) {
|
LRESULT __stdcall sys_start_console(HWND, UINT, WPARAM, LPARAM) {
|
||||||
game::Sys_ShowConsole();
|
game::Sys_ShowConsole();
|
||||||
@ -29,12 +30,16 @@ void show_console() {
|
|||||||
class component final : public component_interface {
|
class component final : public component_interface {
|
||||||
public:
|
public:
|
||||||
void post_unpack() override {
|
void post_unpack() override {
|
||||||
thread = std::thread([]() {
|
thread = utils::thread::create_named_thread("Console Thread", []() {
|
||||||
console_unlock();
|
console_unlock();
|
||||||
show_console();
|
show_console();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async_thread_id = thread.get_id();
|
void pre_destroy() override {
|
||||||
|
if (thread.joinable()) {
|
||||||
|
thread.join();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace console
|
} // namespace console
|
||||||
|
Loading…
x
Reference in New Issue
Block a user