This repository has been archived on 2024-06-01. You can view files and clone it, but cannot push or open issues or pull requests.
cathook/src/tfmm.cpp
2017-12-10 16:43:23 +03:00

49 lines
1.2 KiB
C++

/*
* tfmm.cpp
*
* Created on: Dec 7, 2017
* Author: nullifiedcat
*/
#include "common.hpp"
CatCommand cmd_queue_start("mm_queue_casual", "Start casual queue",
[]() { tfmm::queue_start(); });
CatCommand cmd_abandon("mm_abandon", "Abandon match",
[]() { tfmm::abandon(); });
CatCommand get_state("mm_state", "Get party state", []() {
re::CTFParty *party = re::CTFParty::GetParty();
if (!party)
{
logging::Info("Party == NULL");
return;
}
logging::Info("State: %d", re::CTFParty::state_(party));
});
namespace tfmm
{
void queue_start()
{
re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient();
if (client)
{
re::ITFGroupMatchCriteria::SetMatchGroup(
re::CTFPartyClient::MutLocalGroupCriteria(client),
re::ITFGroupMatchCriteria::group::CASUAL);
re::CTFPartyClient::LoadSavedCasualCriteria(client);
re::CTFPartyClient::RequestQueueForMatch(client);
}
}
void abandon()
{
re::CTFGCClientSystem *gc = re::CTFGCClientSystem::GTFGCClientSystem();
if (gc != nullptr)
gc->AbandonCurrentMatch();
}
}