-e TEXTMODE_STDIN=1
This commit is contained in:
parent
4404e8393e
commit
52fe1a8205
5
makefile
5
makefile
@ -13,6 +13,7 @@ DEFINES=_GLIBCXX_USE_CXX11_ABI=0 _POSIX=1 FREETYPE_GL_USE_VAO RAD_TELEMETRY_DISA
|
|||||||
WARNING_FLAGS=-pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef
|
WARNING_FLAGS=-pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef
|
||||||
COMMON_FLAGS=-fpermissive -O3 -shared -Wno-unknown-pragmas -fmessage-length=0 -m32 -fvisibility=hidden -fPIC -march=native -mtune=native
|
COMMON_FLAGS=-fpermissive -O3 -shared -Wno-unknown-pragmas -fmessage-length=0 -m32 -fvisibility=hidden -fPIC -march=native -mtune=native
|
||||||
|
|
||||||
|
|
||||||
ifdef CLANG
|
ifdef CLANG
|
||||||
COMMON_FLAGS+=-Wno-c++11-narrowing
|
COMMON_FLAGS+=-Wno-c++11-narrowing
|
||||||
endif
|
endif
|
||||||
@ -66,6 +67,10 @@ DEFINES += TEXTMODE=1
|
|||||||
#OUT_NAME := libcathook-textmode.so
|
#OUT_NAME := libcathook-textmode.so
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef TEXTMODE_STDIN
|
||||||
|
DEFINES+=-DTEXTMODE_STDIN
|
||||||
|
endif
|
||||||
|
|
||||||
SRC_DIR = src
|
SRC_DIR = src
|
||||||
RES_DIR = res
|
RES_DIR = res
|
||||||
TARGET_DIR = bin
|
TARGET_DIR = bin
|
||||||
|
@ -401,6 +401,12 @@ void FrameStageNotify_hook(void* _this, int stage) {
|
|||||||
}
|
}
|
||||||
if (stage == FRAME_START) {
|
if (stage == FRAME_START) {
|
||||||
#if IPC_ENABLED
|
#if IPC_ENABLED
|
||||||
|
static Timer nametimer {};
|
||||||
|
if (nametimer.test_and_set(1000 * 10)) {
|
||||||
|
if (ipc::peer) {
|
||||||
|
ipc::StoreClientData();
|
||||||
|
}
|
||||||
|
}
|
||||||
static Timer ipc_timer {};
|
static Timer ipc_timer {};
|
||||||
if (ipc_timer.test_and_set(1000)) {
|
if (ipc_timer.test_and_set(1000)) {
|
||||||
if (ipc::peer) {
|
if (ipc::peer) {
|
||||||
@ -419,12 +425,14 @@ void FrameStageNotify_hook(void* _this, int stage) {
|
|||||||
hack::command_stack().pop();
|
hack::command_stack().pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if defined(TEXTMODE) and defined(TEXTMODE_STDIN)
|
||||||
static auto last_stdin = std::chrono::system_clock::from_time_t(0);
|
static auto last_stdin = std::chrono::system_clock::from_time_t(0);
|
||||||
auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - last_stdin).count();
|
auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - last_stdin).count();
|
||||||
if (ms > 500) {
|
if (ms > 500) {
|
||||||
UpdateInput();
|
UpdateInput();
|
||||||
last_stdin = std::chrono::system_clock::now();
|
last_stdin = std::chrono::system_clock::now();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#ifndef TEXTMODE
|
#ifndef TEXTMODE
|
||||||
if (cathook && !g_Settings.bInvalid && stage == FRAME_RENDER_START) {
|
if (cathook && !g_Settings.bInvalid && stage == FRAME_RENDER_START) {
|
||||||
|
@ -164,7 +164,6 @@ void UpdateTemporaryData() {
|
|||||||
|
|
||||||
void StoreClientData() {
|
void StoreClientData() {
|
||||||
UpdateServerAddress();
|
UpdateServerAddress();
|
||||||
peer_t::MutexLock lock(peer);
|
|
||||||
user_data_s& data = peer->memory->peer_user_data[peer->client_id];
|
user_data_s& data = peer->memory->peer_user_data[peer->client_id];
|
||||||
data.friendid = g_ISteamUser->GetSteamID().GetAccountID();
|
data.friendid = g_ISteamUser->GetSteamID().GetAccountID();
|
||||||
strncpy(data.name, g_ISteamFriends->GetPersonaName(), sizeof(data.name));
|
strncpy(data.name, g_ISteamFriends->GetPersonaName(), sizeof(data.name));
|
||||||
|
@ -34,11 +34,13 @@ CatCommand fixvac("fixvac", "Lemme in to secure servers", []() {
|
|||||||
|
|
||||||
#ifdef TEXTMODE
|
#ifdef TEXTMODE
|
||||||
InitRoutine init([]() {
|
InitRoutine init([]() {
|
||||||
|
#ifdef TEXTMODE_STDIN
|
||||||
logging::Info("[TEXTMODE] Setting up input handling");
|
logging::Info("[TEXTMODE] Setting up input handling");
|
||||||
int flags = fcntl(0, F_GETFL, 0);
|
int flags = fcntl(0, F_GETFL, 0);
|
||||||
flags |= O_NONBLOCK;
|
flags |= O_NONBLOCK;
|
||||||
fcntl(0, F_SETFL, flags);
|
fcntl(0, F_SETFL, flags);
|
||||||
logging::Info("[TEXTMODE] stdin is now non-blocking");
|
logging::Info("[TEXTMODE] stdin is now non-blocking");
|
||||||
|
#endif
|
||||||
EXPOSED_Epic_VACBypass_1337_DoNotSteal_xXx_$1_xXx_MLG();
|
EXPOSED_Epic_VACBypass_1337_DoNotSteal_xXx_$1_xXx_MLG();
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user