refactor!: Replace premake5 with CMake. (#551)

Co-authored-by: tupoy-ya <tupoy-ya@users.noreply.github.com>
This commit is contained in:
tupoy-ya
2022-11-08 21:08:58 +00:00
committed by GitHub
parent d9d8aa30c1
commit bc05ecd78c
340 changed files with 19298 additions and 19449 deletions

View File

@ -0,0 +1,28 @@
#include "friends_service.hpp"
#include "pointers.hpp"
namespace big
{
friends_service::friends_service()
{
g_friends_service = this;
}
friends_service::~friends_service()
{
g_friends_service = nullptr;
}
bool friends_service::is_friend(CNetGamePlayer* net_player)
{
if (net_player == nullptr)
return false;
const auto rockstar_id = net_player->get_net_data()->m_gamer_handle_2.m_rockstar_id;
for (std::uint32_t i = 0; i < g_pointers->m_friend_registry->m_friend_count; i++)
if (rockstar_id == g_pointers->m_friend_registry->get(i)->m_rockstar_id)
return true;
return false;
}
}

View File

@ -0,0 +1,20 @@
#pragma once
namespace big
{
class friends_service final
{
public:
friends_service();
~friends_service();
friends_service(const friends_service&) = delete;
friends_service(friends_service&&) noexcept = delete;
friends_service& operator=(const friends_service&) = delete;
friends_service& operator=(friends_service&&) noexcept = delete;
[[nodiscard]] static bool is_friend(CNetGamePlayer* net_player);
};
inline friends_service* g_friends_service{};
}