almost none left

This commit is contained in:
nullifiedcat 2018-07-28 23:17:32 +03:00
parent 3778e66ecd
commit b670d24700
10 changed files with 61 additions and 121 deletions

View File

@ -7,39 +7,25 @@
#include <hoovy.hpp>
#include <playerlist.hpp>
#include <online/Online.hpp>
#include <settings/Bool.hpp>
#include "PlayerTools.hpp"
#include "entitycache.hpp"
static settings::Int betrayal_limit{ "player-tools.betrayal-limit", "true" };
static settings::Bool taunting{ "player-tools.ignore.taunting", "true" };
static settings::Bool hoovy{ "player-tools.ignore.hoovy", "true" };
static settings::Bool online_notarget{ "player-tools.ignore.online.notarget", "true" };
static settings::Bool online_friendly_software{ "player-tools.ignore.online.friendly-software", "true" };
static settings::Bool online_only_verified{ "player-tools.ignore.online.only-verified-accounts", "true" };
static settings::Bool online_anonymous{ "player-tools.ignore.online.anonymous", "true" };
static std::unordered_map<unsigned, unsigned> betrayal_list{};
static CatCommand forgive_all("pt_forgive_all", "Clear betrayal list",
[]() { betrayal_list.clear(); });
namespace settings
{
static CatVar online_notarget(CV_SWITCH, "pt_ignore_notarget", "1",
"Ignore notarget",
"Ignore online players with notarget role");
static CatVar hoovy(CV_SWITCH, "pt_ignore_hoovy", "1", "Ignore hoovy");
static CatVar online_friendly_software(CV_SWITCH, "pt_ignore_friendly_software",
"1", "Ignore friendly software",
"Ignore CO-compatible software");
static CatVar online_only_verified(CV_SWITCH, "pt_ignore_only_verified", "0",
"Only ignore verified",
"If online checks are enabled, only apply "
"ignore if SteamID is verified (not "
"recommended right now)");
static CatVar online_anonymous(CV_SWITCH, "pt_ignore_anonymous", "1",
"Ignore anonymous",
"Apply ignore checks to anonymous accounts too");
static CatVar betrayal_limit(
CV_INT, "pt_betrayal_limit", "3", "Betrayal limit",
"Stop ignoring a player after N kills while you ignored them");
static CatVar taunting(CV_SWITCH, "pt_ignore_taunting", "1", "Ignore taunting",
"Don't shoot taunting players");
}
namespace player_tools
{
@ -48,9 +34,9 @@ IgnoreReason shouldTargetSteamId(unsigned id)
if (id == 0)
return IgnoreReason::DO_NOT_IGNORE;
if (settings::betrayal_limit)
if (betrayal_limit)
{
if (betrayal_list[id] > int(settings::betrayal_limit))
if (betrayal_list[id] > int(betrayal_limit))
return IgnoreReason::DO_NOT_IGNORE;
}
@ -62,14 +48,14 @@ IgnoreReason shouldTargetSteamId(unsigned id)
if (co)
{
bool check_verified =
!settings::online_only_verified || co->is_steamid_verified;
bool check_anonymous = settings::online_anonymous || !co->is_anonymous;
!online_only_verified || co->is_steamid_verified;
bool check_anonymous = online_anonymous || !co->is_anonymous;
if (check_verified && check_anonymous)
{
if (settings::online_notarget && co->no_target)
if (online_notarget && co->no_target)
return IgnoreReason::ONLINE_NO_TARGET;
if (settings::online_friendly_software &&
if (online_friendly_software &&
co->is_using_friendly_software)
return IgnoreReason::ONLINE_FRIENDLY_SOFTWARE;
}
@ -84,7 +70,7 @@ IgnoreReason shouldTarget(CachedEntity *entity)
{
if (entity->m_Type() == ENTITY_PLAYER)
{
if (settings::hoovy && IsHoovy(entity))
if (hoovy && IsHoovy(entity))
return IgnoreReason::IS_HOOVY;
if (settings::taunting && HasCondition<TFCond_Taunting>(entity))
return IgnoreReason::IS_TAUNTING;

View File

@ -106,10 +106,7 @@ std::stack<std::string> &hack::command_stack()
*/
#define red 184, 56, 59, 255
#define blu 88, 133, 162, 255
static CatVar cat_event_hurt(CV_SWITCH, "cat_event_hurt", "1",
"Enable OnHurt Event",
"Disable if your chat gets spammed with \"blah "
"damaged blah down to blah hp\"");
class AdvancedEventListener : public IGameEventListener
{
public:

View File

@ -9,20 +9,16 @@
#include "hacks/Backtrack.hpp"
#include <boost/circular_buffer.hpp>
#include <glez/draw.hpp>
#include <settings/Bool.hpp>
static settings::Bool enable{ "backtrack.enable", "false" };
static settings::Bool draw_bt{ "backtrack.draw", "false" };
static settings::Float latency{ "backtrack.latency", "false" };
static settings::Float mindistance{ "backtrack.min-distance", "false" };
static settings::Int slots{ "backtrack.slots", "false" };
namespace hacks::shared::backtrack
{
CatVar enable(CV_SWITCH, "backtrack", "0", "Enable backtrack",
"For legit play only as of right now.");
static CatVar draw_bt(CV_SWITCH, "backtrack_draw", "0", "Draw",
"Draw backtrack ticks");
CatVar latency(CV_FLOAT, "backtrack_latency", "0", "fake lantency",
"Set fake latency to this many ms");
static CatVar mindistance(CV_FLOAT, "mindistance", "60", "mindistance");
static CatEnum slots_enum({ "All", "Primary", "Secondary", "Melee",
"Primary Secondary", "Primary Melee",
"Secondary Melee" });
static CatVar slots(slots_enum, "backtrack_slots", "0", "Enabled Slots",
"Select what slots backtrack should be enabled on.");
BacktrackData headPositions[32][66]{};
BestTickData sorted_ticks[66]{};

View File

@ -8,6 +8,9 @@
#include "common.hpp"
#include <sys/mman.h>
#include <settings/Bool.hpp>
static settings::Bool tcm{ "debug.tcm", "true" };
std::vector<ConVar *> &RegisteredVarsList()
{
@ -52,8 +55,7 @@ void BeginConVars()
void EndConVars()
{
logging::Info("Registering ConVars");
RegisterCatVars();
logging::Info("Registering CatCommands");
RegisterCatCommands();
ConVar_Register();
@ -739,8 +741,6 @@ bool IsEntityVisible(CachedEntity *entity, int hb)
}
}
static CatVar tcm(CV_SWITCH, "debug_tcm", "1", "TCM");
std::mutex trace_lock;
bool IsEntityVectorVisible(CachedEntity *entity, Vector endpos)
{

View File

@ -7,9 +7,12 @@
#include "common.hpp"
#include <hacks/Aimbot.hpp>
#include <settings/Bool.hpp>
#include "MiscTemporary.hpp"
#include "init.hpp"
static settings::Bool hitrate_check{ "hitrate.enable", "true" };
namespace hitrate
{
@ -20,8 +23,6 @@ int count_shots{ 0 };
int count_hits{ 0 };
int count_hits_head{ 0 };
CatVar hitrate_check(CV_SWITCH, "hitrate", "1", "Monitor hitrate");
std::vector<std::chrono::time_point<std::chrono::high_resolution_clock>>
shots{};

View File

@ -6,6 +6,7 @@
*/
#include <hacks/CatBot.hpp>
#include <settings/Bool.hpp>
#include "ipc.hpp"
#include "common.hpp"
@ -14,6 +15,9 @@
#if ENABLE_IPC
static settings::Bool ipc_update_list{ "ipc.update-player-list", "true" };
static settings::String server_name{ "ipc.server", "cathook_followbot_server" };
namespace ipc
{
@ -129,8 +133,6 @@ CatCommand exec_all("ipc_exec_all", "Execute command (on every peer)",
0, 0);
}
});
CatVar server_name(CV_STRING, "ipc_server", "cathook_followbot_server",
"IPC server name");
peer_t *peer{ nullptr };
@ -274,9 +276,6 @@ void Heartbeat()
data.heartbeat = time(nullptr);
}
static CatVar ipc_update_list(CV_SWITCH, "ipc_update_list", "1",
"IPC Auto-Ignore",
"Automaticly assign playerstates for bots");
void UpdatePlayerlist()
{
if (peer && ipc_update_list)

View File

@ -6,8 +6,13 @@
*/
#include <glez/draw.hpp>
#include <settings/Bool.hpp>
#include "common.hpp"
static settings::Bool debug_enginepred{ "debug.engine-pred-others", "false" };
static settings::Bool debug_pp_extrapolate{ "debug.pp-extrapolate", "false" };
static settings::Bool debug_pp_rockettimeping{ "debug.pp-rocket-time-ping", "false" };
// TODO there is a Vector() object created each call.
Vector SimpleLatencyPrediction(CachedEntity *ent, int hb)
@ -46,8 +51,6 @@ std::vector<std::vector<Vector>> predicted_players{};
int predicted_player_count = 0;
static CatVar debug_enginepred(CV_SWITCH, "debug_engine_pred_others", "0",
"DO NOT USE - MOVEMENT");
void Prediction_CreateMove()
{
@ -252,11 +255,7 @@ Vector ProjectilePrediction_Engine(CachedEntity *ent, int hb, float speed,
return result;
}
static CatVar debug_pp_extrapolate(
CV_SWITCH, "debug_pp_extrapolate", "0",
"Extrapolate entity position when predicting projectiles");
static CatVar debug_pp_rockettimeping(CV_SWITCH, "debug_pp_rocket_time_ping",
"0", "Compensate for ping in pp");
Vector ProjectilePrediction(CachedEntity *ent, int hb, float speed,
float gravitymod, float entgmod)

View File

@ -5,6 +5,7 @@
* Author: nullifiedcat
*/
#include <settings/Int.hpp>
#include "common.hpp"
#include "hacks/AutoJoin.hpp"
@ -24,13 +25,11 @@ CatCommand get_state("mm_state", "Get party state", []() {
logging::Info("State: %d", re::CTFParty::state_(party));
});
settings::Int queue{ "autoqueue_mode", "7" };
namespace tfmm
{
CatEnum queue_mode({ "MvmPractice", "MvmMannup", "LadderMatch6v6",
"LadderMatch9v9", "LadderMatch12v12", "CasualMatch6v6",
"CasualMatch9v9", "CasualMatch12v12",
"CompetitiveEventMatch12v12" });
CatVar queue(queue_mode, "autoqueue_mode", "7", "Autoqueue for this mode", "");
void queue_start()
{
re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient();

View File

@ -11,13 +11,17 @@
#include <math.h>
#include <glez/draw.hpp>
#include <settings/Bool.hpp>
#ifndef FEATURE_FIDGET_SPINNER_ENABLED
static CatVar enable_spinner(CV_SWITCH, "fidgetspinner", "0", "Fidget Spinner",
"Part of Cathook Autism Awareness program");
CatVar v9mode(CV_SWITCH, "nullcore_mode", "0", "Nullcore mode",
"Part of Cathook Autism Awareness program");
static settings::Bool enable_spinner{ "visuals.fidget-spinner.enable", "false" };
static settings::Bool v9mode{ "visuals.fidget-spinner.v952-mode", "false" };
static settings::Float spinner_speed_cap{ "visuals.fidget-spinner.speed-cap", "30" };
static settings::Float spinner_speed_scale{ "visuals.fidget-spinner.speed-scale", "0.03" };
static settings::Float spinner_decay_speed{ "visuals.fidget-spinner.decay-speed", "0.1" };
static settings::Float spinner_scale{ "visuals.fidget-spinner.scale", "32" };
static settings::Float spinner_min_speed{ "visuals.fidget-spinner.min-speed", "2" };
float spinning_speed = 0.0f;
float angle = 0;
@ -53,16 +57,6 @@ void InitSpinner()
g_IGameEventManager->AddListener(&listener, false);
}
static CatVar spinner_speed_cap(CV_FLOAT, "fidgetspinner_speed_cap", "30",
"Speed cap");
static CatVar spinner_speed_scale(CV_FLOAT, "fidgetspinner_speed_scale", "0.03",
"Speed scale");
static CatVar spinner_decay_speed(CV_FLOAT, "fidgetspinner_decay_speed", "0.1",
"Decay speed");
static CatVar spinner_scale(CV_FLOAT, "fidgetspinner_scale", "32",
"Spinner Size");
static CatVar spinner_min_speed(CV_FLOAT, "fidgetspinner_min_speed", "2",
"Spinner Min Speed");
Timer retrytimer{};

View File

@ -7,26 +7,14 @@
#include "common.hpp"
#include <boost/algorithm/string.hpp>
#include <settings/Bool.hpp>
static settings::Bool enable{ "vote-log.enable", "false" };
static settings::Bool requeue{ "vote-log.requeue", "false" };
namespace votelogger
{
static CatVar enabled(CV_SWITCH, "votelog", "0", "Log votes");
static CatVar requeue(CV_SWITCH, "votelog_requeue", "1",
"Auto requeue on vote kick", "Auto requeue on vote kick");
static CatVar anti_votekick(CV_SWITCH, "anti_votekick", "0", "anti-votekick",
"Prevent votekicks by lagging the server in a way "
"that every vote comes is delayed.\ndo not forget "
"to enable votelog and that this\nmakes the server "
"be down for about 30 seconds\ncl_timeout 60 is a "
"must");
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.");
Timer antikick{};
bool active = false;
@ -37,7 +25,7 @@ void user_message(bf_read &buffer, int type)
{
bool islocalplayer = false;
if (!enabled)
if (!enable)
return;
switch (type)
{
@ -67,25 +55,6 @@ void user_message(bf_read &buffer, int type)
playerlist::k_EState::FRIEND)
{
islocalplayer = true;
if (anti_votekick && !active)
{
active = true;
antikick.update();
std::string msg(kick_msg.GetString());
ReplaceString(msg, "$NAME", format(info.name));
if (CE_GOOD(ENTITY(eid)))
{
int clz = g_pPlayerResource->GetClass(ENTITY(eid));
ReplaceString(msg, "$CLASS", format(tf_classes[clz]));
}
NET_StringCmd senddata(format("say ", msg).c_str());
INetChannel *ch =
(INetChannel *) g_IEngine->GetNetChannelInfo();
senddata.SetNetChannel(ch);
senddata.SetReliable(true);
ch->SendNetMsg(senddata, true);
ch->Transmit();
}
}
logging::Info("Vote called to kick %s [U:1:%u] for %s", name, steamID,