tfmm.cpp: better MM ban detection
Call function that verifies if you are banned
This commit is contained in:
parent
96b1d812e5
commit
7b4cb7535c
36
src/tfmm.cpp
36
src/tfmm.cpp
@ -69,7 +69,8 @@ static CatCommand mm_debug_chat("mm_debug_chat", "Debug party chat", [](const CC
|
|||||||
namespace tfmm
|
namespace tfmm
|
||||||
{
|
{
|
||||||
int queuecount = 0;
|
int queuecount = 0;
|
||||||
bool isMMBanned()
|
|
||||||
|
static bool old_isMMBanned()
|
||||||
{
|
{
|
||||||
auto client = re::CTFPartyClient::GTFPartyClient();
|
auto client = re::CTFPartyClient::GTFPartyClient();
|
||||||
if (!client || ((client->BInQueueForMatchGroup(7) || client->BInQueueForStandby()) && queuecount < 10))
|
if (!client || ((client->BInQueueForMatchGroup(7) || client->BInQueueForStandby()) && queuecount < 10))
|
||||||
@ -79,6 +80,39 @@ bool isMMBanned()
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
static bool getMMBanData(int type, int *time, int *time2)
|
||||||
|
{
|
||||||
|
typedef bool (*GetMMBanData_t)(int, int*, int*);
|
||||||
|
static uintptr_t addr = gSignatures.GetClientSignature("55 89 E5 57 56 53 83 EC ? 8B 5D 08 8B 75 0C 8B 7D 10 83 FB FF");
|
||||||
|
static GetMMBanData_t GetMMBanData_fn = GetMMBanData_t(addr);
|
||||||
|
|
||||||
|
if (!addr)
|
||||||
|
{
|
||||||
|
*time = -1;
|
||||||
|
*time2 = -1;
|
||||||
|
logging::Info("GetMMBanData sig is broken");
|
||||||
|
return old_isMMBanned();
|
||||||
|
}
|
||||||
|
return GetMMBanData_fn(type, time, time2);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CatCommand mm_debug_banned("mm_debug_banned",
|
||||||
|
"Prints if your are MM banned and extra data if you are banned",
|
||||||
|
[]() {
|
||||||
|
int i, time, left, banned;
|
||||||
|
for (i = 0; i < 1; ++i)
|
||||||
|
{
|
||||||
|
time = left = 0;
|
||||||
|
banned = getMMBanData(0, &time, &left);
|
||||||
|
logging::Info("%d: banned %d, time %d, left %d", banned, time, left);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
bool isMMBanned()
|
||||||
|
{
|
||||||
|
/* Competitive only bans are not interesting */
|
||||||
|
return getMMBanData(0, nullptr, nullptr);
|
||||||
|
}
|
||||||
int getQueue()
|
int getQueue()
|
||||||
{
|
{
|
||||||
return *queue;
|
return *queue;
|
||||||
|
Reference in New Issue
Block a user