B1g update regarding lagbots and backtrack

This commit is contained in:
BenCat07 2018-05-21 11:54:08 +02:00
parent 024383d2bf
commit b95e564569
30 changed files with 314 additions and 188 deletions

View File

@ -17,6 +17,7 @@ set_property(CACHE Game PROPERTY STRINGS ${GameValues})
set(EnableVisuals 1 CACHE BOOL "Enable Visuals") set(EnableVisuals 1 CACHE BOOL "Enable Visuals")
set(LagbotMode 0 CACHE BOOL "Build light cathook made for lagbots")
set(ExternalDrawing 0 CACHE BOOL "External Visuals") set(ExternalDrawing 0 CACHE BOOL "External Visuals")
set(EnableGUI 1 CACHE BOOL "Enable GUI") set(EnableGUI 1 CACHE BOOL "Enable GUI")
set(EnableIPC 1 CACHE BOOL "Enable IPC") set(EnableIPC 1 CACHE BOOL "Enable IPC")

View File

@ -28,6 +28,8 @@ extern CatVar engine_pred;
extern Timer DelayTimer; extern Timer DelayTimer;
extern CatVar delay; extern CatVar delay;
extern CatVar adjust; extern CatVar adjust;
extern float prevflow;
extern int prevflowticks;
#if ENABLE_VISUALS #if ENABLE_VISUALS
extern int spectator_target; extern int spectator_target;
extern CLC_VoiceData *voicecrash; extern CLC_VoiceData *voicecrash;

View File

@ -6,6 +6,7 @@
#define GAME_SPECIFIC @GameSpecific@ #define GAME_SPECIFIC @GameSpecific@
#define GAME @Game@ #define GAME @Game@
#define ENABLE_VISUALS @EnableVisuals@ #define ENABLE_VISUALS @EnableVisuals@
#define LAGBOT_MODE @LagbotMode@
#define EXTERNAL_DRAWING @ExternalDrawing@ #define EXTERNAL_DRAWING @ExternalDrawing@
#define ENABLE_GUI @EnableGUI@ #define ENABLE_GUI @EnableGUI@
#define ENABLE_IPC @EnableIPC@ #define ENABLE_IPC @EnableIPC@
@ -13,4 +14,4 @@
#define ENABLE_VAC_BYPASS @VACBypass@ #define ENABLE_VAC_BYPASS @VACBypass@
#define ENABLE_TEXTMODE_STDIN @EnableTextmodeStdin@ #define ENABLE_TEXTMODE_STDIN @EnableTextmodeStdin@
#define ENABLE_NULL_GRAPHICS @EnableNullGraphics@ #define ENABLE_NULL_GRAPHICS @EnableNullGraphics@
#define TEXTMODE @Textmode@ #define TEXTMODE @Textmode@

View File

@ -6,7 +6,7 @@
*/ */
#pragma once #pragma once
#include "common.hpp"
namespace hacks namespace hacks
{ {
namespace shared namespace shared

View File

@ -8,18 +8,21 @@
#pragma once #pragma once
#include "common.hpp" #include "common.hpp"
namespace hacks { namespace hacks
namespace shared { {
namespace backtrack { namespace shared
{
namespace backtrack
{
struct BacktrackData struct BacktrackData
{ {
int tickcount; int tickcount;
Vector hitboxpos; Vector hitboxpos;
}; };
void Init(); void Init();
void Run(); void Run();
void Draw(); void Draw();
extern BacktrackData headPositions[24][12]; extern BacktrackData headPositions[24][13];
} }
} }
} }

View File

@ -1,3 +1,8 @@
target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/AutoJoin.hpp"
"${CMAKE_CURRENT_LIST_DIR}/CatBot.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Spam.hpp")
if(NOT LagbotMode)
target_sources(cathook PRIVATE target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Achievement.hpp" "${CMAKE_CURRENT_LIST_DIR}/Achievement.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Aimbot.hpp" "${CMAKE_CURRENT_LIST_DIR}/Aimbot.hpp"
@ -30,7 +35,8 @@ target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/UberSpam.hpp" "${CMAKE_CURRENT_LIST_DIR}/UberSpam.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Walkbot.hpp" "${CMAKE_CURRENT_LIST_DIR}/Walkbot.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Radar.hpp") "${CMAKE_CURRENT_LIST_DIR}/Radar.hpp")
add_subdirectory(ac)
endif()
if(EnableVisuals) if(EnableVisuals)
target_sources(cathook PRIVATE target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/ESP.hpp" "${CMAKE_CURRENT_LIST_DIR}/ESP.hpp"
@ -40,5 +46,3 @@ target_sources(cathook PRIVATE
endif() endif()
target_include_directories(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}") target_include_directories(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}")
add_subdirectory(ac)

View File

@ -17,7 +17,7 @@
#include "SpyAlert.hpp" #include "SpyAlert.hpp"
#endif #endif
#if not LAGBOT_MODE
#include "Aimbot.hpp" #include "Aimbot.hpp"
#include "AntiAim.hpp" #include "AntiAim.hpp"
#include "AntiDisguise.hpp" #include "AntiDisguise.hpp"
@ -29,11 +29,15 @@
#include "AutoDeadringer.hpp" #include "AutoDeadringer.hpp"
#include "Bunnyhop.hpp" #include "Bunnyhop.hpp"
#include "LagExploit.hpp" #include "LagExploit.hpp"
#endif
#if ENABLE_VISUALS #if ENABLE_VISUALS
#include "Radar.hpp" #include "Radar.hpp"
#endif #endif
#if not LAGBOT_MODE
#include "Walkbot.hpp" #include "Walkbot.hpp"
#endif
#include "AutoJoin.hpp" #include "AutoJoin.hpp"
#if not LAGBOT_MODE
#include "AntiBackstab.hpp" #include "AntiBackstab.hpp"
#include "AutoBackstab.hpp" #include "AutoBackstab.hpp"
#include "FollowBot.hpp" #include "FollowBot.hpp"
@ -43,10 +47,15 @@
#include "KillSay.hpp" #include "KillSay.hpp"
#include "UberSpam.hpp" #include "UberSpam.hpp"
#include "Achievement.hpp" #include "Achievement.hpp"
#endif
#include "Spam.hpp" #include "Spam.hpp"
#if not LAGBOT_MODE
#include "Noisemaker.hpp" #include "Noisemaker.hpp"
#include "FollowBot.hpp" #include "FollowBot.hpp"
#include "Announcer.hpp" #include "Announcer.hpp"
#include "Killstreak.hpp" #include "Killstreak.hpp"
#endif
#include "CatBot.hpp" #include "CatBot.hpp"
#if not LAGBOT_MODE
#include "Backtrack.hpp" #include "Backtrack.hpp"
#endif

View File

@ -12,5 +12,6 @@ namespace tfmm
void queue_start(); void queue_start();
void queue_leave(); void queue_leave();
void dcandabandon();
void abandon(); void abandon();
} }

View File

@ -39,5 +39,7 @@ Timer DelayTimer{};
CatVar delay( CatVar delay(
CV_INT, "delay", "0", "Delay", CV_INT, "delay", "0", "Delay",
"Delay actions like chat spam and serverlag/crash by this many seconds."); "Delay actions like chat spam and serverlag/crash by this many seconds.");
CatVar adjust(CV_SWITCH, "serverlag_ramp", "0", "Ramp lag", CatVar adjust(CV_INT, "serverlag_ramp", "0", "Ramp lag",
"increase lag while packet loss is below 80%"); "keep lag around this many seconds");
float prevflow = 0.0f;
int prevflowticks = 0;

View File

@ -8,6 +8,7 @@
#include <visual/SDLHooks.hpp> #include <visual/SDLHooks.hpp>
#include "hack.hpp" #include "hack.hpp"
#include "common.hpp" #include "common.hpp"
#include "MiscTemporary.hpp"
#include <hacks/hacklist.hpp> #include <hacks/hacklist.hpp>
@ -381,11 +382,12 @@ free(logname);*/
// hooks::materialsystem.HookMethod(); // hooks::materialsystem.HookMethod();
} }
#endif #endif
#if not LAGBOT_MODE
// FIXME [MP] // FIXME [MP]
hacks::shared::killsay::Init(); hacks::shared::killsay::Init();
hacks::shared::announcer::init(); hacks::shared::announcer::init();
hacks::tf2::killstreak::init(); hacks::tf2::killstreak::init();
#endif
hacks::shared::catbot::init(); hacks::shared::catbot::init();
logging::Info("Hooked!"); logging::Info("Hooked!");
velocity::Init(); velocity::Init();
@ -416,10 +418,10 @@ free(logname);*/
g_IGameEventManager->AddListener(&adv_event_listener, false); g_IGameEventManager->AddListener(&adv_event_listener, false);
#endif /* TEXTMODE */ #endif /* TEXTMODE */
#if not LAGBOT_MODE
hacks::shared::anticheat::Init(); hacks::shared::anticheat::Init();
hacks::tf2::healarrow::Init(); hacks::tf2::healarrow::Init();
#endif
#if ENABLE_VISUALS #if ENABLE_VISUALS
#ifndef FEATURE_FIDGET_SPINNER_ENABLED #ifndef FEATURE_FIDGET_SPINNER_ENABLED
InitSpinner(); InitSpinner();
@ -429,8 +431,9 @@ free(logname);*/
backpacktf::init(); backpacktf::init();
logging::Info("Initialized Backpack.TF integration"); logging::Info("Initialized Backpack.TF integration");
#endif #endif
#if not LAGBOT_MODE
hacks::shared::walkbot::Initialize(); hacks::shared::walkbot::Initialize();
#endif
#if ENABLE_VISUALS #if ENABLE_VISUALS
hacks::shared::esp::Init(); hacks::shared::esp::Init();
#endif #endif
@ -467,8 +470,10 @@ void hack::Shutdown()
#endif #endif
logging::Info("Unregistering convars.."); logging::Info("Unregistering convars..");
ConVar_Unregister(); ConVar_Unregister();
#if not LAGBOT_MODE
logging::Info("Shutting down killsay..."); logging::Info("Shutting down killsay...");
hacks::shared::killsay::Shutdown(); hacks::shared::killsay::Shutdown();
hacks::shared::announcer::shutdown(); hacks::shared::announcer::shutdown();
#endif
logging::Info("Success.."); logging::Info("Success..");
} }

View File

@ -33,7 +33,7 @@ static CatVar aimkey_mode(aimkey_modes_enum, "aimbot_aimkey_mode", "1",
static CatVar autoshoot(CV_SWITCH, "aimbot_autoshoot", "1", "Autoshoot", static CatVar autoshoot(CV_SWITCH, "aimbot_autoshoot", "1", "Autoshoot",
"Shoot automatically when the target is locked, isn't " "Shoot automatically when the target is locked, isn't "
"compatible with 'Enable when attacking'"); "compatible with 'Enable when attacking'");
static CatVar multipoint(CV_SWITCH, "aimbot_multipoint", "1", "Multipoint", static CatVar multipoint(CV_SWITCH, "aimbot_multipoint", "0", "Multipoint",
"Multipoint aimbot"); "Multipoint aimbot");
static CatEnum hitbox_mode_enum({ "AUTO", "AUTO-CLOSEST", "STATIC" }); static CatEnum hitbox_mode_enum({ "AUTO", "AUTO-CLOSEST", "STATIC" });
static CatVar hitbox_mode(hitbox_mode_enum, "aimbot_hitboxmode", "0", static CatVar hitbox_mode(hitbox_mode_enum, "aimbot_hitboxmode", "0",
@ -207,9 +207,10 @@ void CreateMove()
return; return;
if (!g_IEntityList->GetClientEntity(target_entity->m_IDX)) if (!g_IEntityList->GetClientEntity(target_entity->m_IDX))
return; return;
if (!target_entity->hitboxes.GetHitbox(calculated_data_array[target_entity->m_IDX].hitbox)) if (!target_entity->hitboxes.GetHitbox(
return; calculated_data_array[target_entity->m_IDX].hitbox))
return;
// Auto-zoom // Auto-zoom
IF_GAME(IsTF()) IF_GAME(IsTF())
{ {
@ -705,12 +706,12 @@ void Aim(CachedEntity *entity)
float minx, maxx, miny, maxy, minz, maxz, centerx, centery, centerz; float minx, maxx, miny, maxy, minz, maxz, centerx, centery, centerz;
auto hitbox = entity->hitboxes.GetHitbox(cd.hitbox); auto hitbox = entity->hitboxes.GetHitbox(cd.hitbox);
// get positions // get positions
minx = hitbox->min.x; minx = hitbox->min.x;
miny = hitbox->min.y; miny = hitbox->min.y;
maxx = hitbox->max.x; maxx = hitbox->max.x;
maxy = hitbox->max.y; maxy = hitbox->max.y;
minz = hitbox->min.z; minz = hitbox->min.z;
maxz = hitbox->max.z; maxz = hitbox->max.z;
centerx = hitbox->center.x; centerx = hitbox->center.x;
centery = hitbox->center.y; centery = hitbox->center.y;
centerz = hitbox->center.z; centerz = hitbox->center.z;
@ -724,18 +725,18 @@ void Aim(CachedEntity *entity)
maxz -= (maxz - minz) / 6; maxz -= (maxz - minz) / 6;
minz += (maxz - minz) / 6; minz += (maxz - minz) / 6;
// Create Vectors // Create Vectors
positions.push_back({minx, centery, minz}); positions.push_back({ minx, centery, minz });
positions.push_back({maxx, centery, minz}); positions.push_back({ maxx, centery, minz });
positions.push_back({minx, centery, maxz}); positions.push_back({ minx, centery, maxz });
positions.push_back({maxx, centery, maxz}); positions.push_back({ maxx, centery, maxz });
positions.push_back({centerx, miny, minz}); positions.push_back({ centerx, miny, minz });
positions.push_back({centerx, maxy, minz}); positions.push_back({ centerx, maxy, minz });
positions.push_back({centerx, miny, maxz}); positions.push_back({ centerx, miny, maxz });
positions.push_back({centerx, maxy, maxz}); positions.push_back({ centerx, maxy, maxz });
positions.push_back({minx, miny, centerz}); positions.push_back({ minx, miny, centerz });
positions.push_back({maxx, maxy, centerz}); positions.push_back({ maxx, maxy, centerz });
positions.push_back({minx, miny, centerz}); positions.push_back({ minx, miny, centerz });
positions.push_back({maxx, maxy, centerz}); positions.push_back({ maxx, maxy, centerz });
positions.push_back(hitbox->center); positions.push_back(hitbox->center);
for (auto pos : positions) for (auto pos : positions)
if (IsVectorVisible(g_pLocalPlayer->v_Eye, pos)) if (IsVectorVisible(g_pLocalPlayer->v_Eye, pos))

View File

@ -102,6 +102,7 @@ void UpdateSearch()
Timer timer{}; Timer timer{};
void Update() void Update()
{ {
#if not LAGBOT_MODE
if (timer.test_and_set(500)) if (timer.test_and_set(500))
{ {
if (autojoin_team and UnassignedTeam()) if (autojoin_team and UnassignedTeam())
@ -116,6 +117,7 @@ void Update()
.c_str()); .c_str());
} }
} }
#endif
} }
} }
} }

View File

@ -7,128 +7,146 @@
#include "common.hpp" #include "common.hpp"
#include "Backtrack.hpp" #include "Backtrack.hpp"
namespace hacks { namespace hacks
namespace shared { {
namespace backtrack { namespace shared
CatVar enable(CV_SWITCH, "backtrack", "0", "Enable backtrack", "For legit play only as of right now."); {
BacktrackData headPositions[24][12]; namespace backtrack
{
CatVar enable(CV_SWITCH, "backtrack", "0", "Enable backtrack",
"For legit play only as of right now.");
extern CatVar draw_bt(CV_SWITCH, "backtrack_draw", "0", "Draw", "Draw backtrack ticks");
BacktrackData headPositions[24][13];
//======================================================================= //=======================================================================
inline float distance_point_to_line(Vector Point, Vector LineOrigin, Vector Dir) inline float distance_point_to_line(Vector Point, Vector LineOrigin, Vector Dir)
{ {
auto PointDir = Point - LineOrigin; auto PointDir = Point - LineOrigin;
auto TempOffset = PointDir.Dot(Dir) / (Dir.x*Dir.x + Dir.y*Dir.y + Dir.z*Dir.z); auto TempOffset =
if (TempOffset < 0.000001f) PointDir.Dot(Dir) / (Dir.x * Dir.x + Dir.y * Dir.y + Dir.z * Dir.z);
return FLT_MAX; if (TempOffset < 0.000001f)
return FLT_MAX;
auto PerpendicularPoint = LineOrigin + (Dir * TempOffset); auto PerpendicularPoint = LineOrigin + (Dir * TempOffset);
return (Point - PerpendicularPoint).Length(); return (Point - PerpendicularPoint).Length();
} }
inline Vector angle_vector(Vector meme) inline Vector angle_vector(Vector meme)
{ {
auto sy = sin(meme.y / 180.f * static_cast<float>(PI)); auto sy = sin(meme.y / 180.f * static_cast<float>(PI));
auto cy = cos(meme.y / 180.f * static_cast<float>(PI)); auto cy = cos(meme.y / 180.f * static_cast<float>(PI));
auto sp = sin(meme.x / 180.f * static_cast<float>(PI)); auto sp = sin(meme.x / 180.f * static_cast<float>(PI));
auto cp = cos(meme.x / 180.f* static_cast<float>(PI)); auto cp = cos(meme.x / 180.f * static_cast<float>(PI));
return Vector(cp*cy, cp*sy, -sp); return Vector(cp * cy, cp * sy, -sp);
} }
//======================================================================= //=======================================================================
void Init() void Init()
{ {
for (auto a : headPositions) for (auto a : headPositions)
{ {
a->hitboxpos = {0,0,0}; a->hitboxpos = { 0, 0, 0 };
a->tickcount = 0; a->tickcount = 0;
} }
} }
bool disabled = true;
void Run() void Run()
{ {
if (!enable) if (!enable)
return; {
CUserCmd *cmd = g_pUserCmd; if (!disabled)
int iBestTarget = -1; Init();
float bestFov = 99999; disabled = true;
return;
}
disabled = true;
CUserCmd *cmd = g_pUserCmd;
int iBestTarget = -1;
float bestFov = 99999;
if (CE_BAD(LOCAL_E)) if (CE_BAD(LOCAL_E))
return; return;
for (int i = 1; i <= g_IEngine->GetMaxClients(); i++) for (int i = 1; i <= g_IEngine->GetMaxClients(); i++)
{ {
CachedEntity* pEntity = ENTITY(i); CachedEntity *pEntity = ENTITY(i);
if (CE_BAD(pEntity)) if (CE_BAD(pEntity))
continue; continue;
if (!pEntity->m_bAlivePlayer) if (!pEntity->m_bAlivePlayer)
{ {
for (int j = 0; j < 13; j++) { for (int j = 0; j < 13; j++)
headPositions[i][j].hitboxpos = {0,0,0}; {
headPositions[i][j].tickcount = 0; headPositions[i][j].hitboxpos = { 0, 0, 0 };
} headPositions[i][j].tickcount = 0;
continue; }
} continue;
if (pEntity->m_iTeam == LOCAL_E->m_iTeam) }
continue; if (pEntity->m_iTeam == LOCAL_E->m_iTeam)
continue;
Vector hitboxpos = pEntity->hitboxes.GetHitbox(0)->center; Vector hitboxpos = pEntity->hitboxes.GetHitbox(0)->center;
headPositions[i][cmd->command_number % 13] = BacktrackData{ cmd->tick_count, hitboxpos }; headPositions[i][cmd->command_number % 13] =
BacktrackData{ cmd->tick_count, hitboxpos };
Vector ViewDir = angle_vector(cmd->viewangles); Vector ViewDir = angle_vector(cmd->viewangles);
float FOVDistance = distance_point_to_line(hitboxpos, g_pLocalPlayer->v_Eye, ViewDir); float FOVDistance =
distance_point_to_line(hitboxpos, g_pLocalPlayer->v_Eye, ViewDir);
if (bestFov > FOVDistance) if (bestFov > FOVDistance)
{ {
bestFov = FOVDistance; bestFov = FOVDistance;
iBestTarget = i; iBestTarget = i;
} }
if (iBestTarget != -1) if (iBestTarget != -1)
{ {
int bestTick = 0; int bestTick = 0;
float tempFOV = 9999; float tempFOV = 9999;
float bestFOV = 30; float bestFOV = 30;
Vector lowestDistTicks(180, 180, 0); Vector lowestDistTicks(180, 180, 0);
for (int t = 0; t < 12; ++t) for (int t = 0; t < 12; ++t)
{ {
Vector ViewDir = angle_vector(cmd->viewangles); Vector ViewDir = angle_vector(cmd->viewangles);
float tempFOV = distance_point_to_line(headPositions[iBestTarget][t].hitboxpos, g_pLocalPlayer->v_Eye, ViewDir); float tempFOV = distance_point_to_line(
if (bestFOV > tempFOV) headPositions[iBestTarget][t].hitboxpos,
bestTick = t, bestFOV = tempFOV; g_pLocalPlayer->v_Eye, ViewDir);
} if (bestFOV > tempFOV)
bestTick = t, bestFOV = tempFOV;
if (cmd->buttons & IN_ATTACK) }
cmd->tick_count = headPositions[i][bestTick].tickcount;
}
}
if (cmd->buttons & IN_ATTACK)
cmd->tick_count = headPositions[i][bestTick].tickcount;
}
}
} }
void Draw() void Draw()
{ {
#if ENABLE_VISUALS #if ENABLE_VISUALS
if (!enable)
return;
if (!draw_bt)
return;
for (int i = 0; i < 24; i++) for (int i = 0; i < 24; i++)
for (int j = 0; j < 12; j++) for (int j = 0; j < 12; j++)
{ {
auto hbpos = headPositions[i][j].hitboxpos; auto hbpos = headPositions[i][j].hitboxpos;
auto tickount = headPositions[i][j].tickcount; auto tickount = headPositions[i][j].tickcount;
if (!hbpos.x && !hbpos.y && !hbpos.z) if (!hbpos.x && !hbpos.y && !hbpos.z)
continue; continue;
Vector out; Vector out;
rgba_t color = colors::FromHSL(fabs(sin(j / 2.0f)) * 360.0f, rgba_t color =
0.85f, 0.9f); colors::FromHSL(fabs(sin(j / 2.0f)) * 360.0f, 0.85f, 0.9f);
if (draw::WorldToScreen(hbpos, out)) if (draw::WorldToScreen(hbpos, out))
{ {
draw_api::draw_rect(out.x, out.y, 3, 3, color); draw_api::draw_rect(out.x, out.y, 3, 3, color);
} }
} }
#endif #endif
} }
} }
} }
} }

View File

@ -1,4 +1,9 @@
target_sources(cathook PRIVATE target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/AutoJoin.cpp"
"${CMAKE_CURRENT_LIST_DIR}/CatBot.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Spam.cpp")
if(NOT LagbotMode)
target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Achievement.cpp" "${CMAKE_CURRENT_LIST_DIR}/Achievement.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Aimbot.cpp" "${CMAKE_CURRENT_LIST_DIR}/Aimbot.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Announcer.cpp" "${CMAKE_CURRENT_LIST_DIR}/Announcer.cpp"
@ -11,13 +16,11 @@ target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/AutoDetonator.cpp" "${CMAKE_CURRENT_LIST_DIR}/AutoDetonator.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AutoEquip.cpp" "${CMAKE_CURRENT_LIST_DIR}/AutoEquip.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AutoHeal.cpp" "${CMAKE_CURRENT_LIST_DIR}/AutoHeal.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AutoJoin.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AutoReflect.cpp" "${CMAKE_CURRENT_LIST_DIR}/AutoReflect.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AutoSticky.cpp" "${CMAKE_CURRENT_LIST_DIR}/AutoSticky.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AutoTaunt.cpp" "${CMAKE_CURRENT_LIST_DIR}/AutoTaunt.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Bunnyhop.cpp" "${CMAKE_CURRENT_LIST_DIR}/Bunnyhop.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Backtrack.cpp" "${CMAKE_CURRENT_LIST_DIR}/Backtrack.cpp"
"${CMAKE_CURRENT_LIST_DIR}/CatBot.cpp"
"${CMAKE_CURRENT_LIST_DIR}/FollowBot.cpp" "${CMAKE_CURRENT_LIST_DIR}/FollowBot.cpp"
"${CMAKE_CURRENT_LIST_DIR}/HealArrows.cpp" "${CMAKE_CURRENT_LIST_DIR}/HealArrows.cpp"
"${CMAKE_CURRENT_LIST_DIR}/KillSay.cpp" "${CMAKE_CURRENT_LIST_DIR}/KillSay.cpp"
@ -25,12 +28,12 @@ target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/LagExploit.cpp" "${CMAKE_CURRENT_LIST_DIR}/LagExploit.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Misc.cpp" "${CMAKE_CURRENT_LIST_DIR}/Misc.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Noisemaker.cpp" "${CMAKE_CURRENT_LIST_DIR}/Noisemaker.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Spam.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Trigger.cpp" "${CMAKE_CURRENT_LIST_DIR}/Trigger.cpp"
"${CMAKE_CURRENT_LIST_DIR}/UberSpam.cpp" "${CMAKE_CURRENT_LIST_DIR}/UberSpam.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Walkbot.cpp" "${CMAKE_CURRENT_LIST_DIR}/Walkbot.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Radar.cpp") "${CMAKE_CURRENT_LIST_DIR}/Radar.cpp")
add_subdirectory(ac)
endif()
if(EnableVisuals) if(EnableVisuals)
target_sources(cathook PRIVATE target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/ESP.cpp" "${CMAKE_CURRENT_LIST_DIR}/ESP.cpp"
@ -38,5 +41,3 @@ if(EnableVisuals)
"${CMAKE_CURRENT_LIST_DIR}/SkinChanger.cpp" "${CMAKE_CURRENT_LIST_DIR}/SkinChanger.cpp"
"${CMAKE_CURRENT_LIST_DIR}/SpyAlert.cpp") "${CMAKE_CURRENT_LIST_DIR}/SpyAlert.cpp")
endif() endif()
add_subdirectory(ac)

View File

@ -349,15 +349,18 @@ void CreateMove()
if (i <= g_IEngine->GetMaxClients()) if (i <= g_IEngine->GetMaxClients())
{ {
for (int j = 0; j < 18; ++j) if (!CE_BAD(ent))
hitboxcache[i][j] = ent->hitboxes.GetHitbox(j);
if (draw_bones && ent->m_Type == ENTITY_PLAYER)
{ {
modelcache[i] = RAW_ENT(ent)->GetModel(); for (int j = 0; j < 18; ++j)
if (modelcache[i]) hitboxcache[i][j] = ent->hitboxes.GetHitbox(j);
if (draw_bones && ent->m_Type == ENTITY_PLAYER)
{ {
stdiocache[i] = modelcache[i] = RAW_ENT(ent)->GetModel();
g_IModelInfo->GetStudiomodel(modelcache[i]); if (modelcache[i])
{
stdiocache[i] =
g_IModelInfo->GetStudiomodel(modelcache[i]);
}
} }
} }
} }

View File

@ -89,7 +89,8 @@ void WorldTick()
continue; continue;
if (entity->m_Type != ENTITY_PLAYER) if (entity->m_Type != ENTITY_PLAYER)
continue; continue;
if ((int)follow_steam + 18 != entity->player_info.friendsID) // steamid check if ((int) follow_steam + 18 !=
entity->player_info.friendsID) // steamid check
continue; continue;
logging::Info("Success"); logging::Info("Success");
@ -147,7 +148,7 @@ void WorldTick()
} }
} }
// last check for entity before we continue // last check for entity before we continue
if (!follow_target) if (!follow_target)
return; return;
} }

View File

@ -116,6 +116,7 @@ CatCommand
void CreateMove() void CreateMove()
{ {
#if not LAGBOT_MODE
// Crithack // Crithack
static IClientEntity *localplayer, *weapon, *last_weapon = nullptr; static IClientEntity *localplayer, *weapon, *last_weapon = nullptr;
static int tries, cmdn, md5seed, rseed, c, b; static int tries, cmdn, md5seed, rseed, c, b;
@ -354,6 +355,7 @@ void CreateMove()
if (nopush_enabled == pNoPush->GetBool()) if (nopush_enabled == pNoPush->GetBool())
pNoPush->SetValue(!nopush_enabled); pNoPush->SetValue(!nopush_enabled);
} }
#endif
} }
#if ENABLE_VISUALS #if ENABLE_VISUALS

View File

@ -82,7 +82,6 @@ std::pair<int, int> WorldToRadar(int x, int y)
} }
bool loaded = false; bool loaded = false;
textures::texture_atlas texture(DATA_PATH "/res/atlas.png", 1024, 512); textures::texture_atlas texture(DATA_PATH "/res/atlas.png", 1024, 512);
void DrawEntity(int x, int y, CachedEntity *ent) void DrawEntity(int x, int y, CachedEntity *ent)
@ -101,20 +100,21 @@ void DrawEntity(int x, int y, CachedEntity *ent)
else if (texture.texture.handle != GLEZ_TEXTURE_INVALID) else if (texture.texture.handle != GLEZ_TEXTURE_INVALID)
loaded = true; loaded = true;
else else
return; return;
} }
struct basesprite struct basesprite
{ {
textures::sprite sprite = texture.create_sprite(0, 0, 0, 0); textures::sprite sprite = texture.create_sprite(0, 0, 0, 0);
}; };
static std::array<std::array<basesprite, 9>, 3> tx_class; static std::array<std::array<basesprite, 9>, 3> tx_class;
static std::array<basesprite, 2> tx_teams; static std::array<basesprite, 2> tx_teams;
static std::array<basesprite, 2> tx_items; static std::array<basesprite, 2> tx_items;
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
for (int j = 0; j < 9; j++) for (int j = 0; j < 9; j++)
tx_class[i][j].sprite.setsprite(64 * j, texture.height -64 * (i + 1), 64, 64); tx_class[i][j].sprite.setsprite(
64 * j, texture.height - 64 * (i + 1), 64, 64);
tx_teams[0].sprite.setsprite(11 * 64, texture.height - 128, 64, 64); tx_teams[0].sprite.setsprite(11 * 64, texture.height - 128, 64, 64);
tx_teams[1].sprite.setsprite(11 * 64, texture.height -64, 64, 64); tx_teams[1].sprite.setsprite(11 * 64, texture.height - 64, 64, 64);
tx_items[0].sprite.setsprite(10 * 64, texture.height - 64, 64, 64); tx_items[0].sprite.setsprite(10 * 64, texture.height - 64, 64, 64);
tx_items[1].sprite.setsprite(10 * 64, texture.height - 128, 64, 64); tx_items[1].sprite.setsprite(10 * 64, texture.height - 128, 64, 64);

View File

@ -679,11 +679,8 @@ bool GetProjectileData(CachedEntity *weapon, float &speed, float &gravity)
{ {
IF_GAME(IsTF2()) IF_GAME(IsTF2())
{ {
rspeed = re::C_TFWeaponBaseGun::GetProjectileSpeed( rspeed = 1200.0f;
RAW_ENT(g_pLocalPlayer->weapon())); rgrav = 0.4f;
// TODO Wrong grenade launcher gravity
rgrav = re::C_TFWeaponBaseGun::GetProjectileGravity(
RAW_ENT(g_pLocalPlayer->weapon()));
} }
else IF_GAME(IsTF2C()) else IF_GAME(IsTF2C())
{ {
@ -693,10 +690,13 @@ bool GetProjectileData(CachedEntity *weapon, float &speed, float &gravity)
} }
else if (weapon->m_iClassID == CL_CLASS(CTFCompoundBow)) else if (weapon->m_iClassID == CL_CLASS(CTFCompoundBow))
{ {
rspeed = re::C_TFWeaponBaseGun::GetProjectileSpeed( float chargetime =
RAW_ENT(g_pLocalPlayer->weapon())); g_GlobalVars->curtime - CE_FLOAT(weapon, netvar.flChargeBeginTime);
rgrav = re::C_TFWeaponBaseGun::GetProjectileGravity( rspeed = (float) ((float) (fminf(fmaxf(chargetime, 0.0), 1.0) * 800.0) +
RAW_ENT(g_pLocalPlayer->weapon())); 1800.0);
rgrav = (float) ((float) (fminf(fmaxf(chargetime, 0.0), 1.0) *
-0.40000001) +
0.5);
} }
else if (weapon->m_iClassID == CL_CLASS(CTFBat_Wood)) else if (weapon->m_iClassID == CL_CLASS(CTFBat_Wood))
{ {

View File

@ -75,7 +75,6 @@ void RunEnginePrediction(IClientEntity *ent, CUserCmd *ucmd)
namespace hooked_methods namespace hooked_methods
{ {
DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
CUserCmd *cmd) CUserCmd *cmd)
{ {
@ -90,7 +89,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
tickcount++; tickcount++;
g_pUserCmd = cmd; g_pUserCmd = cmd;
#if not LAGBOT_MODE
IF_GAME(IsTF2C()) IF_GAME(IsTF2C())
{ {
if (CE_GOOD(LOCAL_W) && minigun_jump && if (CE_GOOD(LOCAL_W) && minigun_jump &&
@ -99,7 +98,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
CE_INT(LOCAL_W, netvar.iWeaponState) = 0; CE_INT(LOCAL_W, netvar.iWeaponState) = 0;
} }
} }
#endif
ret = original::CreateMove(this_, input_sample_time, cmd); ret = original::CreateMove(this_, input_sample_time, cmd);
PROF_SECTION(CreateMove); PROF_SECTION(CreateMove);
@ -192,6 +191,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
hacks::shared::autojoin::Update(); hacks::shared::autojoin::Update();
#if ENABLE_IPC #if ENABLE_IPC
#if not LAGBOT_MODE
static int team_joining_state = 0; static int team_joining_state = 0;
static float last_jointeam_try = 0; static float last_jointeam_try = 0;
CachedEntity *found_entity, *ent; CachedEntity *found_entity, *ent;
@ -259,9 +259,11 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
} }
} }
} }
#endif
#endif #endif
if (CE_GOOD(g_pLocalPlayer->entity)) if (CE_GOOD(g_pLocalPlayer->entity))
{ {
#if not LAGBOT_MODE
IF_GAME(IsTF2()) IF_GAME(IsTF2())
{ {
UpdateHoovyList(); UpdateHoovyList();
@ -272,10 +274,12 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
PROF_SECTION(CM_esp); PROF_SECTION(CM_esp);
hacks::shared::esp::CreateMove(); hacks::shared::esp::CreateMove();
} }
#endif
#endif #endif
*bSendPackets = true; *bSendPackets = true;
if (!g_pLocalPlayer->life_state && CE_GOOD(g_pLocalPlayer->weapon())) if (!g_pLocalPlayer->life_state && CE_GOOD(g_pLocalPlayer->weapon()))
{ {
#if not LAGBOT_MODE
{ {
PROF_SECTION(CM_walkbot); PROF_SECTION(CM_walkbot);
hacks::shared::walkbot::Move(); hacks::shared::walkbot::Move();
@ -313,8 +317,8 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
engine_prediction::RunEnginePrediction(RAW_ENT(LOCAL_E), engine_prediction::RunEnginePrediction(RAW_ENT(LOCAL_E),
g_pUserCmd); g_pUserCmd);
{ {
PROF_SECTION(CM_backtracc); PROF_SECTION(CM_backtracc);
hacks::shared::backtrack::Run(); hacks::shared::backtrack::Run();
} }
{ {
PROF_SECTION(CM_aimbot); PROF_SECTION(CM_aimbot);
@ -371,7 +375,9 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
if (debug_projectiles) if (debug_projectiles)
projectile_logging::Update(); projectile_logging::Update();
Prediction_CreateMove(); Prediction_CreateMove();
#endif
} }
#if not LAGBOT_MODE
{ {
PROF_SECTION(CM_misc); PROF_SECTION(CM_misc);
hacks::shared::misc::CreateMove(); hacks::shared::misc::CreateMove();
@ -380,19 +386,23 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
PROF_SECTION(CM_crits); PROF_SECTION(CM_crits);
criticals::create_move(); criticals::create_move();
} }
#endif
{ {
PROF_SECTION(CM_spam); PROF_SECTION(CM_spam);
hacks::shared::spam::CreateMove(); hacks::shared::spam::CreateMove();
} }
#if not LAGBOT_MODE
{ {
PROF_SECTION(CM_AC); PROF_SECTION(CM_AC);
angles::Update(); angles::Update();
hacks::shared::anticheat::CreateMove(); hacks::shared::anticheat::CreateMove();
} }
#endif
} }
if (time_replaced) if (time_replaced)
g_GlobalVars->curtime = curtime_old; g_GlobalVars->curtime = curtime_old;
g_Settings.bInvalid = false; g_Settings.bInvalid = false;
#if not LAGBOT_MODE
{ {
PROF_SECTION(CM_chat_stack); PROF_SECTION(CM_chat_stack);
chat_stack::OnCreateMove(); chat_stack::OnCreateMove();
@ -405,6 +415,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
PROF_SECTION(CM_lagexploit); PROF_SECTION(CM_lagexploit);
hacks::shared::lagexploit::CreateMove(); hacks::shared::lagexploit::CreateMove();
} }
#endif
// TODO Auto Steam Friend // TODO Auto Steam Friend
@ -419,7 +430,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
} }
} }
#endif #endif
#if not LAGBOT_MODE
if (CE_GOOD(g_pLocalPlayer->entity)) if (CE_GOOD(g_pLocalPlayer->entity))
{ {
static int fakelag_queue = 0; static int fakelag_queue = 0;
@ -481,6 +492,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
if (cmd) if (cmd)
g_Settings.last_angles = cmd->viewangles; g_Settings.last_angles = cmd->viewangles;
} }
#endif
NET_StringCmd senddata(serverlag_string.GetString()); NET_StringCmd senddata(serverlag_string.GetString());
INetChannel *ch = (INetChannel *) g_IEngine->GetNetChannelInfo(); INetChannel *ch = (INetChannel *) g_IEngine->GetNetChannelInfo();
senddata.SetNetChannel(ch); senddata.SetNetChannel(ch);
@ -493,11 +505,24 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
} }
if (serverlag_amount || votelogger::antikick_ticks) if (serverlag_amount || votelogger::antikick_ticks)
{ {
float latency = if (adjust)
g_IEngine->GetNetChannelInfo()->GetAvgPackets(FLOW_INCOMING); {
logging::Info("%f", latency); if ((int) serverlag_amount == 1)
if (latency > 200 && adjust) serverlag_amount = (int) serverlag_amount + 10;
serverlag_amount = (int) serverlag_amount + 1; if (ch->GetAvgData(FLOW_INCOMING) == prevflow)
{
if (prevflowticks > 66 * (int) adjust)
serverlag_amount = (int) serverlag_amount - 1;
prevflowticks++;
}
if (ch->GetAvgData(FLOW_INCOMING) != prevflow)
{
if (prevflowticks < 66 * (int) adjust)
serverlag_amount = (int) serverlag_amount + 1;
prevflowticks = 0;
}
prevflow = ch->GetAvgData(FLOW_INCOMING);
}
if (votelogger::antikick_ticks) if (votelogger::antikick_ticks)
votelogger::antikick_ticks--; votelogger::antikick_ticks--;
if (votelogger::antikick_ticks) if (votelogger::antikick_ticks)

View File

@ -225,15 +225,18 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type,
} }
} }
} }
#if not LAGBOT_MODE
if (sendmsg.test_and_set(300000) && if (sendmsg.test_and_set(300000) &&
hacks::shared::antiaim::communicate) hacks::shared::antiaim::communicate)
chat_stack::Say("!!meow"); chat_stack::Say("!!meow");
#endif
if (crypt_chat) if (crypt_chat)
{ {
if (message.find("!!") == 0) if (message.find("!!") == 0)
{ {
if (ucccccp::validate(message)) if (ucccccp::validate(message))
{ {
#if not LAGBOT_MODE
if (ucccccp::decrypt(message) == "meow" && if (ucccccp::decrypt(message) == "meow" &&
hacks::shared::antiaim::communicate && hacks::shared::antiaim::communicate &&
data[0] != LOCAL_E->m_IDX && data[0] != LOCAL_E->m_IDX &&
@ -244,6 +247,7 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type,
playerlist::k_EState::CAT; playerlist::k_EState::CAT;
chat_stack::Say("!!meow"); chat_stack::Say("!!meow");
} }
#endif
PrintChat("\x07%06X%s\x01: %s", 0xe05938, name.c_str(), PrintChat("\x07%06X%s\x01: %s", 0xe05938, name.c_str(),
ucccccp::decrypt(message).c_str()); ucccccp::decrypt(message).c_str());
} }
@ -270,4 +274,4 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type,
votelogger::user_message(buf, type); votelogger::user_message(buf, type);
return original::DispatchUserMessage(this_, type, buf); return original::DispatchUserMessage(this_, type, buf);
} }
} }

View File

@ -82,9 +82,13 @@ namespace hooked_methods
DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name) DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name)
{ {
DelayTimer.update(); DelayTimer.update();
#if not LAGBOT_MODE
playerlist::Save(); playerlist::Save();
#endif
votelogger::antikick_ticks = 0; votelogger::antikick_ticks = 0;
#if not LAGBOT_MODE
hacks::shared::lagexploit::bcalled = false; hacks::shared::lagexploit::bcalled = false;
#endif
#if ENABLE_VISUALS #if ENABLE_VISUALS
typedef bool *(*LoadNamedSkys_Fn)(const char *); typedef bool *(*LoadNamedSkys_Fn)(const char *);
uintptr_t addr = gSignatures.GetEngineSignature( uintptr_t addr = gSignatures.GetEngineSignature(
@ -110,12 +114,14 @@ DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name)
#endif #endif
g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec"); g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec");
#if not LAGBOT_MODE
hacks::shared::aimbot::Reset(); hacks::shared::aimbot::Reset();
hacks::shared::backtrack::Init(); hacks::shared::backtrack::Init();
chat_stack::Reset(); chat_stack::Reset();
hacks::shared::anticheat::ResetEverything(); hacks::shared::anticheat::ResetEverything();
original::LevelInit(this_, name); original::LevelInit(this_, name);
hacks::shared::walkbot::OnLevelInit(); hacks::shared::walkbot::OnLevelInit();
#endif
#if ENABLE_IPC #if ENABLE_IPC
if (ipc::peer) if (ipc::peer)
{ {

View File

@ -13,11 +13,15 @@ namespace hooked_methods
DEFINE_HOOKED_METHOD(LevelShutdown, void, void *this_) DEFINE_HOOKED_METHOD(LevelShutdown, void, void *this_)
{ {
need_name_change = true; need_name_change = true;
#if not LAGBOT_MODE
playerlist::Save(); playerlist::Save();
#endif
g_Settings.bInvalid = true; g_Settings.bInvalid = true;
#if not LAGBOT_MODE
hacks::shared::aimbot::Reset(); hacks::shared::aimbot::Reset();
chat_stack::Reset(); chat_stack::Reset();
hacks::shared::anticheat::ResetEverything(); hacks::shared::anticheat::ResetEverything();
#endif
#if ENABLE_IPC #if ENABLE_IPC
if (ipc::peer) if (ipc::peer)
{ {
@ -27,4 +31,4 @@ DEFINE_HOOKED_METHOD(LevelShutdown, void, void *this_)
#endif #endif
return original::LevelShutdown(this_); return original::LevelShutdown(this_);
} }
} }

View File

@ -23,7 +23,9 @@ DEFINE_HOOKED_METHOD(Paint, void, IEngineVGui *this_, PaintMode_t mode)
if (mode & PaintMode_t::PAINT_UIPANELS) if (mode & PaintMode_t::PAINT_UIPANELS)
{ {
#if not LAGBOT_MODE
hacks::tf2::killstreak::apply_killstreaks(); hacks::tf2::killstreak::apply_killstreaks();
#endif
hacks::shared::catbot::update(); hacks::shared::catbot::update();
if (hitrate::hitrate_check) if (hitrate::hitrate_check)
{ {
@ -91,4 +93,4 @@ DEFINE_HOOKED_METHOD(Paint, void, IEngineVGui *this_, PaintMode_t mode)
return original::Paint(this_, mode); return original::Paint(this_, mode);
} }
} }

View File

@ -7,7 +7,7 @@
#include "HookedMethods.hpp" #include "HookedMethods.hpp"
static CatVar die_if_vac(CV_SWITCH, "die_if_vac", "0", "Die if VAC banned"); static CatVar die_if_vac(CV_SWITCH, "die_if_vac", "0", "Die if VAC banned");
static CatVar autoabandon(CV_SWITCH, "cbu_abandon", "0", "Auto abandon");
namespace hooked_methods namespace hooked_methods
{ {
@ -39,7 +39,9 @@ DEFINE_HOOKED_METHOD(Shutdown, void, INetChannel *this_, const char *reason)
original::Shutdown(this_, reason); original::Shutdown(this_, reason);
} }
if (autoabandon)
tfmm::dcandabandon();
if (hacks::shared::autojoin::auto_queue) if (hacks::shared::autojoin::auto_queue)
tfmm::queue_start(); tfmm::queue_start();
} }
} }

View File

@ -195,7 +195,7 @@ void update_mapname()
strncpy(data.ingame.mapname, GetLevelName().c_str(), strncpy(data.ingame.mapname, GetLevelName().c_str(),
sizeof(data.ingame.mapname)); sizeof(data.ingame.mapname));
} }
float framerate = 0.0f;
void UpdateTemporaryData() void UpdateTemporaryData()
{ {
user_data_s &data = peer->memory->peer_user_data[peer->client_id]; user_data_s &data = peer->memory->peer_user_data[peer->client_id];

View File

@ -53,23 +53,32 @@ void queue_leave()
logging::Info("queue_start: CTFPartyClient == null!"); logging::Info("queue_start: CTFPartyClient == null!");
} }
Timer abandont{}; Timer abandont{};
CatCommand abandoncmd("disconnect_and_abandon", "Disconnect and abandon", []() {
void dcandabandon()
{
re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient(); re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient();
re::CTFGCClientSystem *gc = re::CTFGCClientSystem::GTFGCClientSystem();
if (client) if (client)
{
abandon(); abandon();
else
{
logging::Info("your party client is gay!");
if (gc)
queue_leave();
else
logging::Info("your gc is gay!");
}
if (gc && client)
while (1) while (1)
{
if (abandont.test_and_set(4000)) if (abandont.test_and_set(4000))
{ {
queue_leave(); queue_leave();
break; break;
} }
} }
} CatCommand abandoncmd("disconnect_and_abandon", "Disconnect and abandon",
else []() { dcandabandon(); });
logging::Info("your party client is gay!");
});
void abandon() void abandon()
{ {
re::CTFGCClientSystem *gc = re::CTFGCClientSystem::GTFGCClientSystem(); re::CTFGCClientSystem *gc = re::CTFGCClientSystem::GTFGCClientSystem();

View File

@ -140,8 +140,8 @@ void DrawCheatVisuals()
} }
IF_GAME(IsTF2()) IF_GAME(IsTF2())
{ {
PROF_SECTION(DRAW_backtracc); PROF_SECTION(DRAW_backtracc);
hacks::shared::backtrack::Draw(); hacks::shared::backtrack::Draw();
} }
IF_GAME(IsTF2()) IF_GAME(IsTF2())
{ {

View File

@ -721,6 +721,7 @@ static const std::string list_tf2 = R"(
"Backtrack" [ "Backtrack" [
"Backtrack Menu" "Backtrack Menu"
"backtrack" "backtrack"
"backtrack_draw"
] ]
"Anti Cheat" [ "Anti Cheat" [
"Anti Cheat Menu" "Anti Cheat Menu"

View File

@ -6,6 +6,7 @@
*/ */
#include "common.hpp" #include "common.hpp"
#include <boost/algorithm/string.hpp>
namespace votelogger namespace votelogger
{ {
@ -19,7 +20,17 @@ static CatVar anti_votekick(CV_SWITCH, "anti_votekick", "0", "anti-votekick",
"to enable votelog and that this\nmakes the server " "to enable votelog and that this\nmakes the server "
"be down for about 30 seconds\ncl_timeout 60 is a " "be down for about 30 seconds\ncl_timeout 60 is a "
"must"); "must");
int antikick_ticks = 0; static CatVar kick_msg(CV_STRING, "anti_votekick_string",
"Everyone thank $NAME for initiating the votekick! The "
"server will now be shut down!",
"anti-votekick message",
"Send this message on Votekick attempts against "
"you.\n$NAME gets replaced with their name\n$CLASS with "
"their class.");
int antikick_ticks = 0;
const std::string tf_classes[] = { "class", "scout", "sniper", "soldier",
"demoman", "medic", "heavy", "pyro",
"spy", "engineer" };
void user_message(bf_read &buffer, int type) void user_message(bf_read &buffer, int type)
{ {
bool islocalplayer = false; bool islocalplayer = false;
@ -47,17 +58,23 @@ void user_message(bf_read &buffer, int type)
unsigned steamID = 0; unsigned steamID = 0;
player_info_s info; player_info_s info;
if (g_IEngine->GetPlayerInfo(eid, &info)) if (g_IEngine->GetPlayerInfo(eid, &info))
{
steamID = info.friendsID; steamID = info.friendsID;
} if (eid == LOCAL_E->m_IDX ||
if (eid == LOCAL_E->m_IDX) playerlist::AccessData(steamID).state ==
playerlist::k_EState::FRIEND)
{ {
islocalplayer = true; islocalplayer = true;
if (anti_votekick && !antikick_ticks) if (anti_votekick && !antikick_ticks)
{ {
antikick_ticks = 66 * 60; antikick_ticks = 66 * 60;
for (int i = 0; i < (int) 70; i++) std::string msg = std::to_string(*kick_msg.GetString());
g_IEngine->ServerCmd("voicemenu 0 0", false); boost::replace_all(msg, "$NAME", format(info.name));
if (CE_GOOD(ENTITY(eid)))
{
int clz = g_pPlayerResource->GetClass(ENTITY(eid));
boost::replace_all(msg, "$CLASS", format(tf_classes[clz]));
}
chat_stack::Say(msg);
} }
} }