Fix MM Ban detection
This commit is contained in:
parent
43f068c659
commit
f07598d48d
@ -11,7 +11,8 @@
|
|||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
#include "hitrate.hpp"
|
#include "hitrate.hpp"
|
||||||
#include "hack.hpp"
|
#include "hack.hpp"
|
||||||
|
extern settings::Bool die_if_vac;
|
||||||
|
static Timer checkmmban{};
|
||||||
namespace hooked_methods
|
namespace hooked_methods
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -63,6 +64,14 @@ DEFINE_HOOKED_METHOD(Paint, void, IEngineVGui *this_, PaintMode_t mode)
|
|||||||
g_IEngine->ClientCmd_Unrestricted(hack::command_stack().top().c_str());
|
g_IEngine->ClientCmd_Unrestricted(hack::command_stack().top().c_str());
|
||||||
hack::command_stack().pop();
|
hack::command_stack().pop();
|
||||||
}
|
}
|
||||||
|
#if !ENABLE_VISUALS
|
||||||
|
if (*die_if_vac && checkmmban.test_and_set(1000))
|
||||||
|
{
|
||||||
|
if (tfmm::isMMBanned())
|
||||||
|
*(int *) 0 = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if ENABLE_TEXTMODE_STDIN == 1
|
#if ENABLE_TEXTMODE_STDIN == 1
|
||||||
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();
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <settings/Bool.hpp>
|
#include <settings/Bool.hpp>
|
||||||
#include "HookedMethods.hpp"
|
#include "HookedMethods.hpp"
|
||||||
|
|
||||||
static settings::Bool die_if_vac{ "misc.die-if-vac", "false" };
|
settings::Bool die_if_vac{ "misc.die-if-vac", "false" };
|
||||||
static settings::Bool autoabandon{ "misc.auto-abandon", "false" };
|
static settings::Bool autoabandon{ "misc.auto-abandon", "false" };
|
||||||
static settings::String custom_disconnect_reason{ "misc.disconnect-reason", "" };
|
static settings::String custom_disconnect_reason{ "misc.disconnect-reason", "" };
|
||||||
settings::Bool random_name{ "misc.random-name", "false" };
|
settings::Bool random_name{ "misc.random-name", "false" };
|
||||||
@ -15,12 +15,12 @@ extern settings::String force_name;
|
|||||||
|
|
||||||
namespace hooked_methods
|
namespace hooked_methods
|
||||||
{
|
{
|
||||||
Timer t{};
|
|
||||||
DEFINE_HOOKED_METHOD(Shutdown, void, INetChannel *this_, const char *reason)
|
DEFINE_HOOKED_METHOD(Shutdown, void, INetChannel *this_, const char *reason)
|
||||||
{
|
{
|
||||||
g_Settings.bInvalid = true;
|
g_Settings.bInvalid = true;
|
||||||
logging::Info("Disconnect: %s", reason);
|
logging::Info("Disconnect: %s", reason);
|
||||||
if (strstr(reason, "banned") || strstr(reason, "Generic_Kicked"))
|
if (strstr(reason, "banned") || (strstr(reason, "Generic_Kicked") && tfmm::isMMBanned()))
|
||||||
{
|
{
|
||||||
if (*die_if_vac)
|
if (*die_if_vac)
|
||||||
{
|
{
|
||||||
@ -40,12 +40,8 @@ DEFINE_HOOKED_METHOD(Shutdown, void, INetChannel *this_, const char *reason)
|
|||||||
{
|
{
|
||||||
original::Shutdown(this_, reason);
|
original::Shutdown(this_, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (autoabandon)
|
if (autoabandon)
|
||||||
{
|
|
||||||
t.update();
|
|
||||||
tfmm::disconnectAndAbandon();
|
tfmm::disconnectAndAbandon();
|
||||||
}
|
|
||||||
hacks::shared::autojoin::onShutdown();
|
hacks::shared::autojoin::onShutdown();
|
||||||
if (*random_name)
|
if (*random_name)
|
||||||
{
|
{
|
||||||
|
@ -31,7 +31,6 @@ CatCommand join("mm_join", "Join mm Match", []() {
|
|||||||
bool replaced = false;
|
bool replaced = false;
|
||||||
namespace hooked_methods
|
namespace hooked_methods
|
||||||
{
|
{
|
||||||
Timer checkmmban{};
|
|
||||||
DEFINE_HOOKED_METHOD(PaintTraverse, void, vgui::IPanel *this_, unsigned int panel, bool force, bool allow_force)
|
DEFINE_HOOKED_METHOD(PaintTraverse, void, vgui::IPanel *this_, unsigned int panel, bool force, bool allow_force)
|
||||||
{
|
{
|
||||||
if (!isHackActive())
|
if (!isHackActive())
|
||||||
@ -71,16 +70,6 @@ DEFINE_HOOKED_METHOD(PaintTraverse, void, vgui::IPanel *this_, unsigned int pane
|
|||||||
}
|
}
|
||||||
scndwait++;
|
scndwait++;
|
||||||
switcherido = !switcherido;
|
switcherido = !switcherido;
|
||||||
#if not ENABLE_VISUALS
|
|
||||||
if (checkmmban.test_and_set(1000))
|
|
||||||
{
|
|
||||||
{
|
|
||||||
if (tfmm::isMMBanned())
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
*(int *) nullptr = 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (no_reportlimit && !replaced)
|
if (no_reportlimit && !replaced)
|
||||||
{
|
{
|
||||||
static BytePatch no_report_limit(gSignatures.GetClientSignature, "55 89 E5 57 56 53 81 EC ? ? ? ? 8B 5D ? 8B 7D ? 89 D8", 0x75, { 0xB8, 0x01, 0x00, 0x00, 0x00 });
|
static BytePatch no_report_limit(gSignatures.GetClientSignature, "55 89 E5 57 56 53 81 EC ? ? ? ? 8B 5D ? 8B 7D ? 89 D8", 0x75, { 0xB8, 0x01, 0x00, 0x00, 0x00 });
|
||||||
|
Reference in New Issue
Block a user