feat(vendor): Updated GTAV-Classes
This commit is contained in:
parent
4e9cc37181
commit
3e8679792a
@ -51,7 +51,7 @@ namespace big::api
|
||||
http::Request request(domain + path);
|
||||
|
||||
CPlayerInfo* player_info = g_local_player->m_player_info;
|
||||
netPlayerData& netData = player_info->m_net_player_data;
|
||||
rage::netPlayerData& netData = player_info->m_net_player_data;
|
||||
|
||||
nlohmann::json body = {
|
||||
{ "username", std::string(netData.m_name) },
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "backend/looped/looped.hpp"
|
||||
#include "util/misc.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
@ -11,12 +12,12 @@ namespace big
|
||||
if (g.vehicle.god_mode && g_local_player->m_ped_task_flag & (int)ePedTask::TASK_DRIVING)
|
||||
{
|
||||
g_local_player->m_vehicle->m_deform_god = 0x8C;
|
||||
g_local_player->m_vehicle->m_godmode = 0x1;
|
||||
misc::set_bit((int*)&g_local_player->m_vehicle->m_damage_bits, 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_local_player->m_vehicle->m_deform_god = 0x9C;
|
||||
g_local_player->m_vehicle->m_godmode = 0x0;
|
||||
misc::clear_bit((int*)&g_local_player->m_vehicle->m_damage_bits, 8);
|
||||
}
|
||||
|
||||
last_veh_god = g.vehicle.god_mode;
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "logger.hpp"
|
||||
|
||||
#include "core/globals.hpp"
|
||||
#include "gta/natives.hpp"
|
||||
#include "CPed.hpp"
|
||||
|
||||
namespace big
|
||||
|
@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "gta/player.hpp"
|
||||
#include "CNetGamePlayer.hpp"
|
||||
|
||||
#ifndef PLAYER_STRUCT
|
||||
#define PLAYER_STRUCT
|
||||
|
@ -629,7 +629,7 @@ enum WindowTints //m8 do you even int tint?
|
||||
#define TIRESMOKE_COLOR_BROWN 180, 130, 97
|
||||
#define TIRESMOKE_COLOR_PATRIOT 0, 0, 0
|
||||
|
||||
static bool GetVehicleInfoForClanLogo(Hash vehicleModel, rage::vector3& x, rage::vector3& y, rage::vector3& z, float& scale)
|
||||
static bool GetVehicleInfoForClanLogo(Hash vehicleModel, rage::fvector3& x, rage::fvector3& y, rage::fvector3& z, float& scale)
|
||||
{
|
||||
switch (vehicleModel)
|
||||
{
|
||||
|
@ -1,17 +1,6 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
|
||||
enum class eGameState : std::uint32_t
|
||||
{
|
||||
Playing,
|
||||
Died,
|
||||
Arrested,
|
||||
FailedMission,
|
||||
LeftGame,
|
||||
Respawn,
|
||||
InMPCutScene
|
||||
};
|
||||
|
||||
constexpr auto MAX_PLAYERS = 32;
|
||||
|
||||
enum class ControllerInputs : std::uint32_t
|
||||
|
@ -8,62 +8,6 @@
|
||||
#pragma pack(push, 1)
|
||||
namespace rage
|
||||
{
|
||||
class netAddress
|
||||
{
|
||||
public:
|
||||
uint8_t m_field4; //0x0000
|
||||
uint8_t m_field3; //0x0001
|
||||
uint8_t m_field2; //0x0002
|
||||
uint8_t m_field1; //0x0003
|
||||
}; //Size: 0x0004
|
||||
static_assert(sizeof(netAddress) == 0x4);
|
||||
|
||||
class netPlayerData
|
||||
{
|
||||
public:
|
||||
char pad_0000[8]; //0x0000
|
||||
uint64_t m_rockstar_id; //0x0008
|
||||
char pad_0010[52]; //0x0010
|
||||
class netAddress m_relay_ip; //0x0044
|
||||
uint16_t m_relay_port; //0x0048
|
||||
char pad_004A[2]; //0x004A
|
||||
class netAddress m_external_ip; //0x004C
|
||||
uint16_t m_external_port; //0x0050
|
||||
char pad_0052[2]; //0x0052
|
||||
class netAddress m_internal_ip; //0x0054
|
||||
uint16_t m_internal_port; //0x0058
|
||||
char pad_005A[6]; //0x005A
|
||||
uint64_t m_host_token; //0x0060
|
||||
char pad_0068[8]; //0x0068
|
||||
uint64_t m_rockstar_id2; //0x0070
|
||||
char pad_0078[12]; //0x0078
|
||||
char m_name[20]; //0x0084
|
||||
}; //Size: 0x0098
|
||||
static_assert(sizeof(netPlayerData) == 0x98);
|
||||
|
||||
class nonPhysicalPlayerDataBase
|
||||
{
|
||||
public:
|
||||
virtual ~nonPhysicalPlayerDataBase() = default; // 0 (0x00)
|
||||
virtual void unk_0x08() = 0; // 1 (0x08)
|
||||
virtual void unk_0x10() = 0; // 2 (0x10)
|
||||
virtual void unk_0x18() = 0; // 3 (0x18)
|
||||
virtual void log(netLoggingInterface* logger) = 0; // 4 (0x20)
|
||||
};
|
||||
|
||||
class netPlayer
|
||||
{
|
||||
public:
|
||||
virtual ~netPlayer() = default; // 0 (0x00)
|
||||
virtual void reset() = 0; // 1 (0x08)
|
||||
virtual bool is_valid() const = 0; // 2 (0x10)
|
||||
virtual const char *get_name() const = 0; // 3 (0x18)
|
||||
virtual void _0x20() = 0; // 4 (0x20)
|
||||
virtual bool is_host() = 0; // 5 (0x28)
|
||||
virtual netPlayerData *get_net_data() = 0; // 6 (0x30)
|
||||
virtual void _0x38() = 0; // 7 (0x38)
|
||||
};
|
||||
|
||||
class netPlayerMgrBase
|
||||
{
|
||||
public:
|
||||
@ -76,34 +20,6 @@ namespace gta
|
||||
inline constexpr auto num_players = 32;
|
||||
}
|
||||
|
||||
class CNonPhysicalPlayerData : public rage::nonPhysicalPlayerDataBase
|
||||
{
|
||||
public:
|
||||
std::int32_t m_bubble_id; // 0x08
|
||||
std::int32_t m_player_id; // 0x0C
|
||||
rage::vector3 m_position; // 0x10
|
||||
};
|
||||
|
||||
class CNetGamePlayer : public rage::netPlayer
|
||||
{
|
||||
public:
|
||||
char pad_0x0008[0x10]; //0x0008
|
||||
std::uint32_t msg_id; // 0x18
|
||||
char pad_0x001C[0x4]; //0x001C
|
||||
std::int8_t active_id; //0x0020
|
||||
std::int8_t player_id; //0x0021
|
||||
char pad_0x0022[0x6E]; //0x0022
|
||||
BYTE local_player_check;//0x0090
|
||||
char pad_0x00A1[0xF]; //0x0091
|
||||
CPlayerInfo* player_info; //0x00A0
|
||||
|
||||
inline bool is_local_player()
|
||||
{
|
||||
return local_player_check & 1;
|
||||
}
|
||||
};
|
||||
static_assert(sizeof(CNetGamePlayer) == 0xA8);
|
||||
|
||||
//class CPlayerInfo : public rage::fwExtensibleBase
|
||||
//{
|
||||
//public:
|
||||
@ -144,5 +60,4 @@ static_assert(sizeof(CNetGamePlayer) == 0xA8);
|
||||
//}; //Size: 0x0869
|
||||
//static_assert(sizeof(CPlayerInfo) == 0x869);
|
||||
|
||||
static_assert(sizeof(CNonPhysicalPlayerData) == 0x1C);
|
||||
#pragma pack(pop)
|
||||
|
@ -6,28 +6,6 @@
|
||||
|
||||
namespace rage
|
||||
{
|
||||
class fwEntity
|
||||
{
|
||||
public:
|
||||
char pad_0000[32]; //0x0000
|
||||
class CBaseModelInfo* m_model_info; //0x0020
|
||||
int8_t m_invisible; //0x0028
|
||||
char pad_0029[7]; //0x0029
|
||||
class CNavigation* m_navigation; //0x0030
|
||||
char pad_0038[1]; //0x0038
|
||||
int8_t m_entity_type; //0x0039
|
||||
char pad_003A[150]; //0x003A
|
||||
class netObject* m_net_object; //0x00D0
|
||||
char pad_00D8[176]; //0x00D8
|
||||
uint32_t m_damage_bits; //0x0188
|
||||
|
||||
bool is_invincible() { return(m_damage_bits & (1 << 8)); }
|
||||
void enable_invincible() { m_damage_bits |= (1 << 8); }
|
||||
void disable_invincible() { m_damage_bits &= ~(1 << 8); }
|
||||
}; //Size: 0x018C
|
||||
static_assert(sizeof(fwEntity) == 0x18C, "fwEntity is not properly sized");
|
||||
|
||||
|
||||
class CVehicle : public fwEntity
|
||||
{
|
||||
public:
|
||||
@ -36,18 +14,6 @@ namespace rage
|
||||
//class CPed* m_occupants[8]; //0x0C30
|
||||
}; //Size: 0x018C
|
||||
|
||||
class CNavigation
|
||||
{
|
||||
public:
|
||||
char pad_0000[32]; //0x0000
|
||||
float m_heading; //0x0020
|
||||
float m_heading2; //0x0024
|
||||
char pad_0028[8]; //0x0028
|
||||
vector3 m_rotation; //0x0030
|
||||
char pad_003C[20]; //0x003C
|
||||
vector3 m_position; //0x0050
|
||||
}; //Size: 0x005C
|
||||
|
||||
class CPed : public fwEntity
|
||||
{
|
||||
public:
|
||||
|
@ -31,6 +31,7 @@ namespace rage
|
||||
std::uint32_t m_stack_size; // 0x50
|
||||
char m_padding2[0x54]; // 0x54
|
||||
};
|
||||
static_assert(sizeof(scrThreadContext) == 0xA8);
|
||||
|
||||
class scrThread
|
||||
{
|
||||
@ -54,8 +55,6 @@ namespace rage
|
||||
scriptHandler *m_handler; // 0x110
|
||||
scriptHandlerNetComponent *m_net_component; // 0x118
|
||||
};
|
||||
|
||||
static_assert(sizeof(scrThreadContext) == 0xA8);
|
||||
static_assert(sizeof(scrThread) == 0x120);
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,5 @@ namespace rage
|
||||
return *reinterpret_cast<tlsContext**>(__readgsqword(0x58));
|
||||
}
|
||||
};
|
||||
|
||||
static_assert(sizeof(tlsContext) == 0x838);
|
||||
}
|
||||
|
@ -8,13 +8,6 @@ namespace rage
|
||||
float y{};
|
||||
};
|
||||
|
||||
struct vector3
|
||||
{
|
||||
float x{};
|
||||
float y{};
|
||||
float z{};
|
||||
};
|
||||
|
||||
struct vector4
|
||||
{
|
||||
float x{};
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "player_tabs.hpp"
|
||||
#include "util/misc.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
@ -15,19 +16,19 @@ namespace big
|
||||
|
||||
if (CNetGamePlayer* net_player = g.selected_player.net_player; net_player != nullptr)
|
||||
{
|
||||
if (CPlayerInfo* player_info = net_player->player_info; player_info != nullptr)
|
||||
if (CPlayerInfo* player_info = net_player->m_player_info; player_info != nullptr)
|
||||
{
|
||||
netPlayerData& netData = player_info->m_net_player_data;
|
||||
rage::netPlayerData& netData = player_info->m_net_player_data;
|
||||
|
||||
ImGui::Text("Session Host: %s", net_player->is_host() ? "Yes" : "No");
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::Text("Wanted Level: %d", player_info->m_wanted_level);
|
||||
ImGui::Text("Player God Mode: %s", player_info->m_ped->m_godmode ? "Yes" : "No");
|
||||
ImGui::Text("Player God Mode: %s", misc::has_bit_set((int*)&player_info->m_ped->m_damage_bits, 8) ? "Yes" : "No");
|
||||
ImGui::Text("Vehicle God Mode: %s",
|
||||
player_info->m_ped->m_vehicle == nullptr ? "No vehicle detected" :
|
||||
player_info->m_ped->m_vehicle->m_godmode ? "Yes" : "No"
|
||||
misc::has_bit_set((int*)&player_info->m_ped->m_vehicle->m_damage_bits, 8) ? "Yes" : "No"
|
||||
);
|
||||
|
||||
ImGui::Separator();
|
||||
|
@ -58,7 +58,7 @@ namespace big
|
||||
);
|
||||
|
||||
static bool scripted_game_event(CScriptedGameEvent* scripted_game_event, CNetGamePlayer* player);
|
||||
static bool send_net_info_to_lobby(netPlayerData* player, int64_t a2, int64_t a3, DWORD* a4);
|
||||
static bool send_net_info_to_lobby(rage::netPlayerData* player, int64_t a2, int64_t a3, DWORD* a4);
|
||||
};
|
||||
|
||||
struct minhook_keepalive
|
||||
|
@ -6,7 +6,7 @@ namespace big
|
||||
{
|
||||
bool hooks::increment_stat_event(CNetworkIncrementStatEvent* net_event, CNetGamePlayer* sender, int64_t a3)
|
||||
{
|
||||
Player sender_id = sender->player_id;
|
||||
Player sender_id = sender->m_player_id;
|
||||
|
||||
switch (net_event->m_stat)
|
||||
{
|
||||
|
@ -4,7 +4,7 @@ namespace big
|
||||
{
|
||||
void hooks::player_join(CNetworkObjectMgr* _this, CNetGamePlayer* net_player)
|
||||
{
|
||||
LOG(INFO) << "Player '" << net_player->get_name() << "' joined taking slot #" << (int)net_player->player_id;
|
||||
LOG(INFO) << "Player '" << net_player->get_name() << "' joined taking slot #" << (int)net_player->m_player_id;
|
||||
|
||||
return g_hooking->m_player_has_joined_hook.get_original<decltype(&hooks::player_join)>()(_this, net_player);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ namespace big
|
||||
{
|
||||
void hooks::player_leave(CNetworkObjectMgr* _this, CNetGamePlayer* net_player)
|
||||
{
|
||||
LOG(INFO) << "Player '" << net_player->get_name() << "' left freeing slot #" << (int)net_player->player_id;
|
||||
LOG(INFO) << "Player '" << net_player->get_name() << "' left freeing slot #" << (int)net_player->m_player_id;
|
||||
|
||||
return g_hooking->m_player_has_left_hook.get_original<decltype(&hooks::player_leave)>()(_this, net_player);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ namespace big
|
||||
if (event_id > 90u) return false;
|
||||
|
||||
const char* event_name = *(char**)((DWORD64)event_manager + 8i64 * event_id + 243376);
|
||||
if (event_name == nullptr || source_player == nullptr || source_player->player_id < 0 || source_player->player_id >= 32)
|
||||
if (event_name == nullptr || source_player == nullptr || source_player->m_player_id < 0 || source_player->m_player_id >= 32)
|
||||
{
|
||||
g_pointers->m_send_event_ack(event_manager, source_player, target_player, event_index, event_handled_bitset);
|
||||
return false;
|
||||
@ -32,7 +32,7 @@ namespace big
|
||||
{
|
||||
case RockstarEvent::NETWORK_CLEAR_PED_TASKS_EVENT:
|
||||
{
|
||||
if (source_player->player_id < 32)
|
||||
if (source_player->m_player_id < 32)
|
||||
{
|
||||
g_pointers->m_send_event_ack(event_manager, source_player, target_player, event_index, event_handled_bitset);
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace big
|
||||
{
|
||||
bool hooks::send_net_info_to_lobby(netPlayerData* player, int64_t a2, int64_t a3, DWORD* a4)
|
||||
bool hooks::send_net_info_to_lobby(rage::netPlayerData* player, int64_t a2, int64_t a3, DWORD* a4)
|
||||
{
|
||||
// check so we're 100% sure we modify data only for ourselves
|
||||
if (g_local_player->m_player_info->m_net_player_data.m_rockstar_id == player->m_rockstar_id)
|
||||
|
2
vendor/GTAV-Classes
vendored
2
vendor/GTAV-Classes
vendored
@ -1 +1 @@
|
||||
Subproject commit a069ad9316e70f612a937f5bda31fcc36dc38441
|
||||
Subproject commit d7f9a681a202e0824f8b0a1d1a635569422587fe
|
Reference in New Issue
Block a user