external draw fixes
This commit is contained in:
parent
fca8b01f74
commit
ed74c7c66e
@ -1,22 +0,0 @@
|
|||||||
/*
|
|
||||||
* Events.hpp
|
|
||||||
*
|
|
||||||
* Created on: Feb 24, 2018
|
|
||||||
* Author: bencat07
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "common.hpp"
|
|
||||||
|
|
||||||
namespace hacks
|
|
||||||
{
|
|
||||||
namespace shared
|
|
||||||
{
|
|
||||||
namespace event
|
|
||||||
{
|
|
||||||
|
|
||||||
void CreateMove();
|
|
||||||
char *inttochar(int i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -25,7 +25,6 @@
|
|||||||
#include "AutoSticky.hpp"
|
#include "AutoSticky.hpp"
|
||||||
#include "AutoDetonator.hpp"
|
#include "AutoDetonator.hpp"
|
||||||
#include "AntiCheat.hpp"
|
#include "AntiCheat.hpp"
|
||||||
#include "Events.hpp"
|
|
||||||
#include "Bunnyhop.hpp"
|
#include "Bunnyhop.hpp"
|
||||||
#include "LagExploit.hpp"
|
#include "LagExploit.hpp"
|
||||||
#include "Walkbot.hpp"
|
#include "Walkbot.hpp"
|
||||||
|
@ -96,9 +96,9 @@ void DrawSpinner()
|
|||||||
glez_texture_load_png_rgba("/opt/cathook/data/res/atlas.png");
|
glez_texture_load_png_rgba("/opt/cathook/data/res/atlas.png");
|
||||||
while (!tex)
|
while (!tex)
|
||||||
tex = glez_texture_load_png_rgba("/opt/cathook/data/res/atlas.png");
|
tex = glez_texture_load_png_rgba("/opt/cathook/data/res/atlas.png");
|
||||||
glez_rect_textured(draw::width / 2, draw::height / 2, size, size, color,
|
draw_api::draw_rect_textured(draw::width / 2, draw::height / 2, size, size, colors::white,
|
||||||
tex, 0 + 64 * state, (3 + (v9mode ? 1 : 0)) * 64, 64, 64,
|
{tex}, 0 + 64 * state, (3 + (v9mode ? 1 : 0)) * 64, 64, 64,
|
||||||
angle);
|
angle);
|
||||||
if (angle > PI * 4)
|
if (angle > PI * 4)
|
||||||
angle -= PI * 4;
|
angle -= PI * 4;
|
||||||
}
|
}
|
||||||
|
66
src/hack.cpp
66
src/hack.cpp
@ -80,7 +80,8 @@ std::stack<std::string> &hack::command_stack()
|
|||||||
|
|
||||||
#if ENABLE_VISUALS == 1 /* Why would we need colored chat stuff in textmode? \
|
#if ENABLE_VISUALS == 1 /* Why would we need colored chat stuff in textmode? \
|
||||||
*/
|
*/
|
||||||
|
#define red 184, 56, 59, 255
|
||||||
|
#define blu 88, 133, 162, 255
|
||||||
class AdvancedEventListener : public IGameEventListener
|
class AdvancedEventListener : public IGameEventListener
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -88,31 +89,29 @@ public:
|
|||||||
{
|
{
|
||||||
if (!event_log)
|
if (!event_log)
|
||||||
return;
|
return;
|
||||||
|
static ConVar *var = g_ICvar->FindVar("developer");
|
||||||
|
static ConVar *filter = g_ICvar->FindVar("con_filter_text");
|
||||||
|
static ConVar *enable = g_ICvar->FindVar("con_filter_enable");
|
||||||
|
filter->SetValue("[CAT]");
|
||||||
|
var->SetValue(1);
|
||||||
|
enable->SetValue(1);
|
||||||
const char *name = event->GetName();
|
const char *name = event->GetName();
|
||||||
if (!strcmp(name, "player_connect_client"))
|
if (!strcmp(name, "player_connect_client"))
|
||||||
{
|
PrintChat("\x07%06X%s\x01 \x07%06X%s\x01 joining", 0xa06ba0,event->GetString("name"), 0x914e65,event->GetString("networkid"));
|
||||||
PrintChat("\x07%06X%s\x01 \x07%06X%s\x01 joining", 0xa06ba0,
|
|
||||||
event->GetString("name"), 0x914e65,
|
|
||||||
event->GetString("networkid"));
|
|
||||||
}
|
|
||||||
else if (!strcmp(name, "player_activate"))
|
else if (!strcmp(name, "player_activate"))
|
||||||
{
|
{
|
||||||
int uid = event->GetInt("userid");
|
int uid = event->GetInt("userid");
|
||||||
int entity = g_IEngine->GetPlayerForUserID(uid);
|
int entity = g_IEngine->GetPlayerForUserID(uid);
|
||||||
player_info_s info;
|
player_info_s info;
|
||||||
if (g_IEngine->GetPlayerInfo(entity, &info))
|
if (g_IEngine->GetPlayerInfo(entity, &info))
|
||||||
{
|
PrintChat("\x07%06X%s\x01 connected", 0xa06ba0, info.name);
|
||||||
PrintChat("\x07%06X%s\x01 connected", 0xa06ba0, info.name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (!strcmp(name, "player_disconnect"))
|
else if (!strcmp(name, "player_disconnect"))
|
||||||
{
|
{
|
||||||
CachedEntity *player =
|
CachedEntity *player =
|
||||||
ENTITY(g_IEngine->GetPlayerForUserID(event->GetInt("userid")));
|
ENTITY(g_IEngine->GetPlayerForUserID(event->GetInt("userid")));
|
||||||
PrintChat("\x07%06X%s\x01 \x07%06X%s\x01 disconnected",
|
PrintChat("\x07%06X%s\x01 \x07%06X%s\x01 disconnected",colors::chat::team(player->m_iTeam),event->GetString("name"), 0x914e65,event->GetString("networkid"));
|
||||||
colors::chat::team(player->m_iTeam),
|
|
||||||
event->GetString("name"), 0x914e65,
|
|
||||||
event->GetString("networkid"));
|
|
||||||
}
|
}
|
||||||
else if (!strcmp(name, "player_team"))
|
else if (!strcmp(name, "player_team"))
|
||||||
{
|
{
|
||||||
@ -122,13 +121,44 @@ public:
|
|||||||
int nteam = event->GetInt("team");
|
int nteam = event->GetInt("team");
|
||||||
const char *oteam_s = teamname(oteam);
|
const char *oteam_s = teamname(oteam);
|
||||||
const char *nteam_s = teamname(nteam);
|
const char *nteam_s = teamname(nteam);
|
||||||
PrintChat("\x07%06X%s\x01 changed team (\x07%06X%s\x01 -> "
|
PrintChat("\x07%06X%s\x01 changed team (\x07%06X%s\x01 -> ""\x07%06X%s\x01)",0xa06ba0, event->GetString("name"),colors::chat::team(oteam), oteam_s,colors::chat::team(nteam), nteam_s);
|
||||||
"\x07%06X%s\x01)",
|
|
||||||
0xa06ba0, event->GetString("name"),
|
|
||||||
colors::chat::team(oteam), oteam_s,
|
|
||||||
colors::chat::team(nteam), nteam_s);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (!strcmp(name, "player_hurt")) {
|
||||||
|
int victim = event->GetInt("userid");
|
||||||
|
int attacker = event->GetInt("attacker");
|
||||||
|
int health = event->GetInt("health");
|
||||||
|
player_info_s kinfo;
|
||||||
|
player_info_s vinfo;
|
||||||
|
g_IEngine->GetPlayerInfo(g_IEngine->GetPlayerForUserID(victim), &vinfo);
|
||||||
|
g_IEngine->GetPlayerInfo(g_IEngine->GetPlayerForUserID(attacker), &kinfo);
|
||||||
|
PrintChat("\x07%06X%s\x01 hurt \x07%06X%s\x01 down to \x07%06X%d\x01hp", 0x4286f4, kinfo.name, 0xc11739, vinfo.name, 0x2aaf18, health);
|
||||||
|
}
|
||||||
|
else if (!strcmp(name, "player_death")) {
|
||||||
|
int victim = event->GetInt("userid");
|
||||||
|
int attacker = event->GetInt("attacker");
|
||||||
|
player_info_s kinfo;
|
||||||
|
player_info_s vinfo;
|
||||||
|
g_IEngine->GetPlayerInfo(g_IEngine->GetPlayerForUserID(victim), &vinfo);
|
||||||
|
g_IEngine->GetPlayerInfo(g_IEngine->GetPlayerForUserID(attacker), &kinfo);
|
||||||
|
PrintChat("\x07%06X%s\x01 killed \x07%06X%s\x01", 0x4286f4, kinfo.name, 0xc11739, vinfo.name);
|
||||||
|
}
|
||||||
|
else if (!strcmp(name, "player_spawn")) {
|
||||||
|
int id = event->GetInt("userid");
|
||||||
|
player_info_s info;
|
||||||
|
g_IEngine->GetPlayerInfo(g_IEngine->GetPlayerForUserID(id), &info);
|
||||||
|
PrintChat("\x07%06X%s\x01 (re)spawned", 0xa06ba0, info.name);
|
||||||
|
}
|
||||||
|
else if (!strcmp(name, "player_changeclass")) {
|
||||||
|
int id = event->GetInt("userid");
|
||||||
|
player_info_s info;
|
||||||
|
PrintChat("\x07%06X%s\x01 changed to \x07%06X%s\x01", 0xa06ba0, info.name, 0xa06ba0, classname(event->GetInt("class")));
|
||||||
|
}
|
||||||
|
else if (!strcmp(name, "player_builtobject")) {
|
||||||
|
int obj = event->GetInt("object");
|
||||||
|
|
||||||
|
logging::Info("%d, %d, %d", obj == ENTITY_BUILDING, obj == CL_CLASS(CObjectSentrygun), obj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -54,11 +54,11 @@ void UpdateSearch()
|
|||||||
if (g_IEngine->IsInGame())
|
if (g_IEngine->IsInGame())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (g_pUserCmd)
|
re::CTFGCClientSystem *gc = re::CTFGCClientSystem::GTFGCClientSystem();
|
||||||
|
if (g_pUserCmd && gc && gc->BConnectedToMatchServer(false))
|
||||||
tfmm::queue_leave();
|
tfmm::queue_leave();
|
||||||
if (autoqueue_timer.test_and_set(30000))
|
if (autoqueue_timer.test_and_set(60000))
|
||||||
{
|
{
|
||||||
re::CTFGCClientSystem *gc = re::CTFGCClientSystem::GTFGCClientSystem();
|
|
||||||
if (gc && !gc->BConnectedToMatchServer(false) && !g_pUserCmd)
|
if (gc && !gc->BConnectedToMatchServer(false) && !g_pUserCmd)
|
||||||
{
|
{
|
||||||
logging::Info("Starting queue");
|
logging::Info("Starting queue");
|
||||||
|
@ -1,88 +0,0 @@
|
|||||||
/*
|
|
||||||
* Events.cpp
|
|
||||||
*
|
|
||||||
* Created on: Feb 24, 2018
|
|
||||||
* Author: bencat07
|
|
||||||
*/
|
|
||||||
#include "common.hpp"
|
|
||||||
|
|
||||||
namespace hacks
|
|
||||||
{
|
|
||||||
namespace shared
|
|
||||||
{
|
|
||||||
namespace event
|
|
||||||
{
|
|
||||||
std::array<int, 2048> data;
|
|
||||||
void CreateMove()
|
|
||||||
{
|
|
||||||
if (!event_log)
|
|
||||||
return;
|
|
||||||
for (int i; i < g_IEngine->GetMaxClients(); ++i)
|
|
||||||
{
|
|
||||||
CachedEntity *ent = ENTITY(i);
|
|
||||||
if (!CE_GOOD(ent))
|
|
||||||
continue;
|
|
||||||
player_info_s info;
|
|
||||||
g_IEngine->GetPlayerInfo(ent->m_IDX, &info);
|
|
||||||
if (!data[i])
|
|
||||||
data[i] = CE_INT(ent, netvar.iClass);
|
|
||||||
|
|
||||||
if (data[i] != CE_INT(ent, netvar.iClass))
|
|
||||||
{
|
|
||||||
if (ent->m_iTeam == TEAM_RED)
|
|
||||||
{
|
|
||||||
PrintChat("\x07%06X%s\x01 changed from \"\x07%06X%s\x01\" to "
|
|
||||||
"\"\x07%06X%s\x01\"",
|
|
||||||
0xb8383b, info.name, 0x6b9ca0, inttochar(data[i]),
|
|
||||||
0x6ba072, inttochar(CE_INT(ent, netvar.iClass)));
|
|
||||||
}
|
|
||||||
else if (ent->m_iTeam == TEAM_BLU)
|
|
||||||
{
|
|
||||||
PrintChat("\x07%06X%s\x01 changed from \"\x07%06X%s\x01\" to "
|
|
||||||
"\"\x07%06X%s\x01\"",
|
|
||||||
0x5885a2, info.name, 0x6b9ca0, inttochar(data[i]),
|
|
||||||
0x6ba072, inttochar(CE_INT(ent, netvar.iClass)));
|
|
||||||
}
|
|
||||||
data[i] = CE_INT(ent, netvar.iClass);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
char *inttochar(int i)
|
|
||||||
{
|
|
||||||
switch (i)
|
|
||||||
{
|
|
||||||
case tf_scout:
|
|
||||||
return "Scout";
|
|
||||||
break;
|
|
||||||
case tf_sniper:
|
|
||||||
return "Sniper";
|
|
||||||
break;
|
|
||||||
case tf_soldier:
|
|
||||||
return "Soldier";
|
|
||||||
break;
|
|
||||||
case tf_demoman:
|
|
||||||
return "Demoman";
|
|
||||||
break;
|
|
||||||
case tf_medic:
|
|
||||||
return "Medic";
|
|
||||||
break;
|
|
||||||
case tf_heavy:
|
|
||||||
return "Heavy";
|
|
||||||
break;
|
|
||||||
case tf_pyro:
|
|
||||||
return "Pyro";
|
|
||||||
break;
|
|
||||||
case tf_spy:
|
|
||||||
return "Spy";
|
|
||||||
break;
|
|
||||||
case tf_engineer:
|
|
||||||
return "Engineer";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return "Invalid";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -446,7 +446,7 @@ void CreateMove()
|
|||||||
if (!i)
|
if (!i)
|
||||||
i = ((int) servertime - (int) nextattack);
|
i = ((int) servertime - (int) nextattack);
|
||||||
amount = i * 66;
|
amount = i * 66;
|
||||||
if (!CE_BYTE(g_pLocalPlayer->weapon(), netvar.m_iClip1))
|
if (CE_INT(g_pLocalPlayer->weapon(), netvar.m_iClip1) == 0)
|
||||||
{
|
{
|
||||||
g_pUserCmd->buttons &= ~IN_ATTACK;
|
g_pUserCmd->buttons &= ~IN_ATTACK;
|
||||||
g_pUserCmd->buttons &= ~IN_ATTACK2;
|
g_pUserCmd->buttons &= ~IN_ATTACK2;
|
||||||
@ -461,8 +461,7 @@ void CreateMove()
|
|||||||
if (!i)
|
if (!i)
|
||||||
i = 3;
|
i = 3;
|
||||||
amount = i * 66;
|
amount = i * 66;
|
||||||
g_pUserCmd->buttons &= ~IN_ATTACK;
|
g_pUserCmd->buttons |= IN_ATTACK;
|
||||||
g_pUserCmd->buttons &= ~IN_ATTACK2;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i)
|
if (i)
|
||||||
|
@ -437,10 +437,6 @@ bool CreateMove_hook(void *thisptr, float inputSample, CUserCmd *cmd)
|
|||||||
angles::Update();
|
angles::Update();
|
||||||
hacks::shared::anticheat::CreateMove();
|
hacks::shared::anticheat::CreateMove();
|
||||||
}
|
}
|
||||||
{
|
|
||||||
PROF_SECTION(CM_EVENTS);
|
|
||||||
hacks::shared::event::CreateMove();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (time_replaced)
|
if (time_replaced)
|
||||||
g_GlobalVars->curtime = curtime_old;
|
g_GlobalVars->curtime = curtime_old;
|
||||||
|
Reference in New Issue
Block a user