this is so catbots crashing

This commit is contained in:
TotallyNotElite 2018-09-11 20:54:28 +02:00
parent e88e756610
commit 46c4d9f0c0
2 changed files with 20 additions and 11 deletions

View File

@ -40,7 +40,9 @@ bool UnassignedClass()
static Timer autoqueue_timer{}; static Timer autoqueue_timer{};
static Timer queuetime{}; static Timer queuetime{};
#if not ENABLE_VISUALS
static Timer req_timer{}; static Timer req_timer{};
#endif
void updateSearch() void updateSearch()
{ {
// segfaults for no reason // segfaults for no reason
@ -90,7 +92,12 @@ void updateSearch()
return; return;
} }
if (g_IEngine->IsInGame()) if (g_IEngine->IsInGame())
{
#if not ENABLE_VISUALS
req_timer.update();
#endif
return; return;
}
static uintptr_t addr = static uintptr_t addr =
gSignatures.GetClientSignature("C7 04 24 ? ? ? ? 8D 7D ? 31 F6"); gSignatures.GetClientSignature("C7 04 24 ? ? ? ? 8D 7D ? 31 F6");
@ -113,25 +120,27 @@ void updateSearch()
#endif #endif
tfmm::leaveQueue(); tfmm::leaveQueue();
} }
// if (gc && !gc->BConnectedToMatchServer(false) && // if (gc && !gc->BConnectedToMatchServer(false) &&
// queuetime.test_and_set(10 * 1000 * 60) && !gc->BHaveLiveMatch()) // queuetime.test_and_set(10 * 1000 * 60) &&
// tfmm::leaveQueue(); // !gc->BHaveLiveMatch())
// tfmm::leaveQueue();
if (auto_requeue) if (auto_requeue)
{ {
if (gc && !gc->BConnectedToMatchServer(false) && !gc->BHaveLiveMatch() && if (gc && !gc->BConnectedToMatchServer(false) &&
!invites) !gc->BHaveLiveMatch() && !invites)
if (!(pc && pc->BInQueueForMatchGroup(tfmm::getQueue()))) if (!(pc && pc->BInQueueForMatchGroup(tfmm::getQueue())))
{ {
logging::Info("Starting queue for standby, Invites %d", invites); logging::Info("Starting queue for standby, Invites %d",
invites);
tfmm::startQueueStandby(); tfmm::startQueueStandby();
} }
} }
if (auto_queue) if (auto_queue)
{ {
if (gc && !gc->BConnectedToMatchServer(false) && !gc->BHaveLiveMatch() && if (gc && !gc->BConnectedToMatchServer(false) &&
!invites) !gc->BHaveLiveMatch() && !invites)
if (!(pc && pc->BInQueueForMatchGroup(tfmm::getQueue()))) if (!(pc && pc->BInQueueForMatchGroup(tfmm::getQueue())))
{ {
logging::Info("Starting queue, Invites %d", invites); logging::Info("Starting queue, Invites %d", invites);

View File

@ -23,7 +23,7 @@ DEFINE_HOOKED_METHOD(Shutdown, void, INetChannel *this_, const char *reason)
logging::Info("Disconnect: %s", reason); logging::Info("Disconnect: %s", reason);
if (strstr(reason, "Generic_Kicked")) if (strstr(reason, "Generic_Kicked"))
{ {
if (die_if_vac) { if (*die_if_vac) {
static uintptr_t addr = static uintptr_t addr =
gSignatures.GetClientSignature("C7 04 24 ? ? ? ? 8D 7D ? 31 F6"); gSignatures.GetClientSignature("C7 04 24 ? ? ? ? 8D 7D ? 31 F6");
static uintptr_t offset0 = uintptr_t(*(uintptr_t *) (addr + 0x3)); static uintptr_t offset0 = uintptr_t(*(uintptr_t *) (addr + 0x3));
@ -48,7 +48,7 @@ DEFINE_HOOKED_METHOD(Shutdown, void, INetChannel *this_, const char *reason)
} }
if (strstr(reason, "banned")) if (strstr(reason, "banned"))
{ {
if (die_if_vac) if (*die_if_vac)
{ {
logging::Info("VAC/Matchmaking banned"); logging::Info("VAC/Matchmaking banned");
*(int *) 0 = 0; *(int *) 0 = 0;