still works

This commit is contained in:
nullifiedcat 2017-07-29 12:40:51 +03:00
parent 224cb81287
commit f578811e25
7 changed files with 26 additions and 4 deletions

@ -1 +1 @@
Subproject commit 94a287d6faa00d44e1084b04e602842849858443
Subproject commit dd569c63b2ca85e8d9d395a586d54464bb0e1916

View File

@ -38,6 +38,9 @@
#include "aftercheaders.h"
#include "macros.hpp"
#include "colors.hpp"
#ifndef TEXTMODE
extern "C" {
@ -55,8 +58,6 @@ extern "C" {
#endif
#include "macros.hpp"
#include "colors.hpp"
#include "profiler.h"
#include "offsets.hpp"
#include "entitycache.h"

View File

@ -11,6 +11,10 @@
namespace hacks { namespace shared { namespace autojoin {
/*
* Credits to Blackfire for helping me with auto-requeue!
*/
CatEnum classes_enum({ "DISABLED", "SCOUT", "SNIPER", "SOLDIER", "DEMOMAN", "MEDIC", "HEAVY", "PYRO", "SPY", "ENGINEER" });
CatVar autojoin_team(CV_SWITCH, "autojoin_team", "0", "AutoJoin", "Automatically joins a team");
CatVar preferred_class(classes_enum, "autojoin_class", "0", "AutoJoin class", "You will pick a class automatically");
@ -26,6 +30,7 @@ CatCommand debug_startsearch("debug_startsearch", "DEBUG StartSearch", []() {
});
CatCommand debug_casual("debug_casual", "DEBUG Casual", []() {
logging::Info("%d", g_TFGCClientSystem->RequestSelectWizardStep(6));
g_TFGCClientSystem->LoadSearchCriteria();
});
CatCommand debug_readytosearch("debug_gcstate", "DEBUG GCState", []() {
@ -52,6 +57,10 @@ void UpdateSearch() {
if (g_TFGCClientSystem->GetState() == 6) {
logging::Info("Sending MM request");
g_TFGCClientSystem->RequestSelectWizardStep(4);
} else if (g_TFGCClientSystem->GetState() == 5) {
g_IEngine->ExecuteClientCmd("OpenMatchmakingLobby casual");
g_TFGCClientSystem->LoadSearchCriteria();
logging::Info("%d", g_TFGCClientSystem->RequestSelectWizardStep(6));
}
last_check = std::chrono::system_clock::now();
@ -71,6 +80,8 @@ void Update() {
if (int(preferred_class) < 10)
g_IEngine->ExecuteClientCmd(format("join_class ", classnames[int(preferred_class) - 1]).c_str());
}
last_check = std::chrono::system_clock::now();
}
}}}

View File

@ -940,7 +940,7 @@ void Move() {
Load("default");
if (nodes.size() == 0) {
static auto last_abandon = std::chrono::system_clock::from_time_t(0);
auto s = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - last_abandon).count();
auto s = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now() - last_abandon).count();
if (s < 3) {
return;

View File

@ -136,6 +136,7 @@ void UpdateServerAddress(bool shutdown) {
}
void StoreClientData() {
UpdateServerAddress();
peer_t::MutexLock lock(peer);
user_data_s& data = peer->memory->peer_user_data[peer->client_id];
data.friendid = g_ISteamUser->GetSteamID().GetAccountID();

View File

@ -29,3 +29,11 @@ int TFGCClientSystem::SendExitMatchmaking(bool abandon) {
logging::Info("Calling 0x%08x", SendExitMatchmaking_fn);
return SendExitMatchmaking_fn(this, abandon);
}
int TFGCClientSystem::LoadSearchCriteria() {
static uintptr_t LoadSearchCriteria_loc = gSignatures.GetClientSignature("55 89 E5 57 56 53 8D 5D A8 81 EC DC 00 00 00 C7 44 24 0C 00 00 00 00 C7 44 24 08 00 00 00 00 C7 44 24 04 00 00 00 00 89 1C 24 E8 ? ? ? ? C7 44 24 08 01 00 00 00 C7 44 24 04 01 00 00 00 89 1C 24 E8 ? ? ? ? A1 ? ? ? ? 8D 50 04");
typedef int(*LoadSearchCriteria_t)(TFGCClientSystem*);
static LoadSearchCriteria_t LoadSearchCriteria_fn = (LoadSearchCriteria_t)LoadSearchCriteria_loc;
logging::Info("Calling 0x%08x", LoadSearchCriteria_fn);
return LoadSearchCriteria_fn(this);
}

View File

@ -13,5 +13,6 @@ public:
int GetState();
/* 55 89 E5 57 56 8D 75 C8 53 81 EC 8C 00 00 00 8B 45 0C C7 04 24 ? ? ? ? 8B 5D 08 89 45 A4 0F B6 C0 89 44 24 04 E8 ? ? ? ? C7 44 24 04 91 18 00 00 89 34 24 E8 ? ? ? ? A1 ? ? ? ? */
int SendExitMatchmaking(bool abandon);
int LoadSearchCriteria();
};