IRC upgrades
This commit is contained in:
parent
88bc7c5eb2
commit
37b9f234c1
21
src/irc.cpp
21
src/irc.cpp
@ -268,6 +268,17 @@ static bool restarting{ false };
|
|||||||
static HookedFunction paint(HookedFunctions_types::HF_Paint, "IRC", 16, []() {
|
static HookedFunction paint(HookedFunctions_types::HF_Paint, "IRC", 16, []() {
|
||||||
if (!restarting)
|
if (!restarting)
|
||||||
{
|
{
|
||||||
|
if (last_sent_steamid.check(8000) && !last_sent_steamid.check(9500))
|
||||||
|
{
|
||||||
|
static uintptr_t addr = gSignatures.GetClientSignature("55 89 E5 57 56 53 83 EC ? 8B 7D ? 8B 77 ? 85 F6 0F 84");
|
||||||
|
typedef int (*GetNumOnlineMembers_t)(re::CTFPartyClient *);
|
||||||
|
auto GetNumOnlineMembers_fn = GetNumOnlineMembers_t(addr);
|
||||||
|
auto party_client = re::CTFPartyClient::GTFPartyClient();
|
||||||
|
if (party_client && GetNumOnlineMembers_fn(party_client) != 6 && !steamidvec.empty())
|
||||||
|
{
|
||||||
|
hack::command_stack().push("tf_party_leave");
|
||||||
|
}
|
||||||
|
}
|
||||||
if (last_steamid_received.test_and_set(10000))
|
if (last_steamid_received.test_and_set(10000))
|
||||||
{
|
{
|
||||||
static uintptr_t addr = gSignatures.GetClientSignature(
|
static uintptr_t addr = gSignatures.GetClientSignature(
|
||||||
@ -288,14 +299,8 @@ static HookedFunction paint(HookedFunctions_types::HF_Paint, "IRC", 16, []() {
|
|||||||
lowest = steamidvec[i];
|
lowest = steamidvec[i];
|
||||||
idx = i;
|
idx = i;
|
||||||
}
|
}
|
||||||
if (idx != -1 &&
|
if (idx != -1 && steamidvec[idx] != g_ISteamUser->GetSteamID().GetAccountID())
|
||||||
steamidvec[idx] !=
|
hack::command_stack().push(format("tf_party_request_join_user ", steamidvec[idx]));
|
||||||
g_ISteamUser->GetSteamID().GetAccountID())
|
|
||||||
{
|
|
||||||
hack::command_stack().push("tf_party_leave");
|
|
||||||
hack::command_stack().push(format(
|
|
||||||
"tf_party_request_join_user ", steamidvec[idx]));
|
|
||||||
}
|
|
||||||
steamidvec.clear();
|
steamidvec.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user