Force session host and improve protections (#593)
* Add force session host and update protections * Remove old popgroup protection * Harden script patcher * Replace looped options with script patches * Missing break * Use enums * Forgot to break again... * Add tooltip for force session host Co-authored-by: user <email@hostname>
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
#include "friends_service.hpp"
|
||||
#include "pointers.hpp"
|
||||
#include <network/CNetGamePlayer.hpp>
|
||||
#include <socialclub/FriendRegistry.hpp>
|
||||
|
||||
namespace big
|
||||
{
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "network/CNetGamePlayer.hpp"
|
||||
#include "services/friends/friends_service.hpp"
|
||||
#include "gta_util.hpp"
|
||||
#include <network/Network.hpp>
|
||||
|
||||
namespace big
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "gta_util.hpp"
|
||||
#include "player_service.hpp"
|
||||
#include <network/CNetworkPlayerMgr.hpp>
|
||||
|
||||
namespace big
|
||||
{
|
||||
|
@ -17,6 +17,9 @@ namespace big
|
||||
{
|
||||
}
|
||||
|
||||
script_data(const script_data& that) = delete;
|
||||
script_data& operator=(const script_data& that) = delete;
|
||||
|
||||
~script_data()
|
||||
{
|
||||
for (auto i = 0u; i < m_num_pages; i++)
|
||||
@ -25,6 +28,7 @@ namespace big
|
||||
}
|
||||
|
||||
delete[] m_bytecode;
|
||||
m_bytecode = nullptr;
|
||||
}
|
||||
};
|
||||
}
|
@ -5,6 +5,18 @@
|
||||
|
||||
namespace big
|
||||
{
|
||||
script_patcher_service::script_patcher_service()
|
||||
{
|
||||
g_script_patcher_service = this;
|
||||
}
|
||||
|
||||
script_patcher_service::~script_patcher_service()
|
||||
{
|
||||
m_script_data.clear();
|
||||
m_script_patches.clear();
|
||||
g_script_patcher_service = nullptr;
|
||||
}
|
||||
|
||||
script_data* script_patcher_service::get_data_for_script(rage::joaat_t script)
|
||||
{
|
||||
for (auto& p : m_script_data)
|
||||
@ -31,7 +43,7 @@ namespace big
|
||||
|
||||
void script_patcher_service::create_data_for_script(rage::scrProgram* program)
|
||||
{
|
||||
auto pages = new std::uint8_t * [program->get_num_code_pages()];
|
||||
auto pages = new std::uint8_t *[program->get_num_code_pages()];
|
||||
|
||||
for (auto i = 0u; i < program->get_num_code_pages(); i++)
|
||||
{
|
||||
@ -51,16 +63,6 @@ namespace big
|
||||
p.update(data);
|
||||
}
|
||||
|
||||
script_patcher_service::script_patcher_service()
|
||||
{
|
||||
g_script_patcher_service = this;
|
||||
}
|
||||
|
||||
script_patcher_service::~script_patcher_service()
|
||||
{
|
||||
g_script_patcher_service = nullptr;
|
||||
}
|
||||
|
||||
void script_patcher_service::add_patch(script_patch&& patch)
|
||||
{
|
||||
m_script_patches.push_back(std::move(patch));
|
||||
|
Reference in New Issue
Block a user