Add more spoofing options and added clang-format (#1020)

* feat(Spoofing): add spoofing
* feat(Spoofing): prepare code for player attach
* remove(PlayerAttach): isn't going to work due to netsync architecture
* fix(GUI): fix scaling
* feat(Project): add clang-format file
* feat(Classes): update classes
* fix(BlackHole): remove unnecessary cleanup
* fix(Formatting): fix formatting for initializer lists
* feat(clang-format): Set tab width and 1 space before comment

Co-authored-by: Yimura <24669514+Yimura@users.noreply.github.com>
This commit is contained in:
maybegreat48
2023-03-01 21:27:15 +00:00
committed by GitHub
parent 92aea20cd6
commit 97a8c5d60b
466 changed files with 55224 additions and 35596 deletions

View File

@ -1,7 +1,9 @@
#include "matchmaking_service.hpp"
#include "script.hpp"
#include "pointers.hpp"
#include "hooking.hpp"
#include "pointers.hpp"
#include "script.hpp"
#include <network/Network.hpp>
namespace big
@ -25,7 +27,7 @@ namespace big
NetworkGameFilterMatchmakingComponent component{};
strcpy(component.m_filter_name, "Group");
component.m_game_mode = 0;
component.m_game_mode = 0;
component.m_num_parameters = 0;
if (g.session_browser.region_filter_enabled)
@ -42,7 +44,7 @@ namespace big
static rage::rlSessionInfo result_sessions[MAX_SESSIONS_TO_FIND];
m_active = true;
if (g_hooking->get_original<hooks::start_matchmaking_find_sessions>()(0, 1, &component, MAX_SESSIONS_TO_FIND, result_sessions, &m_num_sessions_found, &state))
{
while (state.status == 1)
@ -57,23 +59,26 @@ namespace big
if (constraint && m_found_sessions[i].attributes.player_count >= 30)
m_found_sessions[i].is_valid = false;
if (g.session_browser.language_filter_enabled && m_found_sessions[i].attributes.language != g.session_browser.language_filter)
if (g.session_browser.language_filter_enabled
&& m_found_sessions[i].attributes.language != g.session_browser.language_filter)
m_found_sessions[i].is_valid = false;
if (g.session_browser.player_count_filter_enabled && (m_found_sessions[i].attributes.player_count < g.session_browser.player_count_filter_minimum ||
m_found_sessions[i].attributes.player_count > g.session_browser.player_count_filter_maximum))
if (g.session_browser.player_count_filter_enabled
&& (m_found_sessions[i].attributes.player_count < g.session_browser.player_count_filter_minimum
|| m_found_sessions[i].attributes.player_count > g.session_browser.player_count_filter_maximum))
{
m_found_sessions[i].is_valid = false;
}
if (g.session_browser.pool_filter_enabled && ((m_found_sessions[i].attributes.discriminator & (1 << 14)) == (1 << 14)) != (bool)g.session_browser.pool_filter)
if (g.session_browser.pool_filter_enabled
&& ((m_found_sessions[i].attributes.discriminator & (1 << 14)) == (1 << 14))
!= (bool)g.session_browser.pool_filter)
m_found_sessions[i].is_valid = false;
}
if (g.session_browser.sort_method != 0)
{
std::qsort(m_found_sessions, m_num_sessions_found, sizeof(session), [](const void* a1, const void* a2) -> int
{
std::qsort(m_found_sessions, m_num_sessions_found, sizeof(session), [](const void* a1, const void* a2) -> int {
std::strong_ordering result;
if (g.session_browser.sort_method == 1)

View File

@ -21,15 +21,17 @@ namespace big
session_attributes attributes;
bool is_valid;
};
private:
int m_num_sessions_found = 0;
bool m_active = false;
bool m_active = false;
session m_found_sessions[MAX_SESSIONS_TO_FIND];
public:
matchmaking_service();
~matchmaking_service();
bool matchmake(std::optional<int> constraint = std::nullopt);
inline int get_num_found_sessions()
{
return m_num_sessions_found;