format files and do renames
This commit is contained in:
parent
b5f2161a90
commit
faaa317ba1
@ -1,42 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "services/players/player.hpp"
|
|
||||||
|
|
||||||
namespace big
|
|
||||||
{
|
|
||||||
class sync_list
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
std::array<std::string, 100> list;
|
|
||||||
int size = 0;
|
|
||||||
|
|
||||||
inline void add_sync_data_to_list(player_ptr sender, std::string details)
|
|
||||||
{
|
|
||||||
if (size == 100)
|
|
||||||
{
|
|
||||||
// Copy the last 50 elements to the first 50 positions
|
|
||||||
std::copy(list.begin() + 50, list.end(), list.begin());
|
|
||||||
size = 50;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the new element after the first 50 elements
|
|
||||||
auto now = std::chrono::system_clock::now();
|
|
||||||
auto localTime = std::chrono::zoned_time{std::chrono::current_zone(), now};
|
|
||||||
|
|
||||||
list[size] = std::format("[{:%H:%M:%S}] [{}] {}",localTime.get_local_time(), sender->get_name(), details);
|
|
||||||
|
|
||||||
++size;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct g_misc_data_t
|
|
||||||
{
|
|
||||||
sync_list ped_sync_list;
|
|
||||||
sync_list vehicle_sync_list;
|
|
||||||
sync_list object_sync_list;
|
|
||||||
sync_list pickup_sync_list;
|
|
||||||
sync_list explosion_sync_list;
|
|
||||||
sync_list ptfx_sync_list;
|
|
||||||
};
|
|
||||||
|
|
||||||
inline g_misc_data_t g_misc_data{};
|
|
||||||
}
|
|
42
src/core/var/sync_lists.hpp
Normal file
42
src/core/var/sync_lists.hpp
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "services/players/player.hpp"
|
||||||
|
|
||||||
|
namespace big
|
||||||
|
{
|
||||||
|
class sync_list
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
std::array<std::string, 100> list;
|
||||||
|
int size = 0;
|
||||||
|
|
||||||
|
void add_sync_data(player_ptr sender, std::string details)
|
||||||
|
{
|
||||||
|
if (size == 100)
|
||||||
|
{
|
||||||
|
// Copy the last 50 elements to the first 50 positions
|
||||||
|
std::copy(list.begin() + 50, list.end(), list.begin());
|
||||||
|
// Add the new elements after the first 50 elements
|
||||||
|
size = 50;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto now = std::chrono::system_clock::now();
|
||||||
|
auto localTime = std::chrono::zoned_time{std::chrono::current_zone(), now};
|
||||||
|
|
||||||
|
list[size] = std::format("[{:%H:%M:%S}] [{}] {}", localTime.get_local_time(), sender->get_name(), details);
|
||||||
|
|
||||||
|
++size;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct g_sync_lists_t
|
||||||
|
{
|
||||||
|
sync_list peds;
|
||||||
|
sync_list vehicles;
|
||||||
|
sync_list objects;
|
||||||
|
sync_list pickups;
|
||||||
|
sync_list explosions;
|
||||||
|
sync_list ptfxs;
|
||||||
|
};
|
||||||
|
|
||||||
|
inline g_sync_lists_t g_sync_lists{};
|
||||||
|
}
|
@ -70,7 +70,7 @@
|
|||||||
#include "util/sync_trees.hpp"
|
#include "util/sync_trees.hpp"
|
||||||
#include "vehicle/CTrainConfig.hpp"
|
#include "vehicle/CTrainConfig.hpp"
|
||||||
#include "vehicle/CVehicleModelInfo.hpp"
|
#include "vehicle/CVehicleModelInfo.hpp"
|
||||||
#include "core/var/misc.hpp"
|
#include "core/var/sync_lists.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace big
|
namespace big
|
||||||
@ -1208,7 +1208,7 @@ namespace big
|
|||||||
|
|
||||||
auto& vehs = g_gta_data_service.vehicles();
|
auto& vehs = g_gta_data_service.vehicles();
|
||||||
auto it = vehs.find(creation_node->m_model);
|
auto it = vehs.find(creation_node->m_model);
|
||||||
g_misc_data.vehicle_sync_list.add_sync_data_to_list(sender_plyr, (it != vehs.end() ? g_gta_data_service.get_vehicle_full_name(it->second) : "?"));
|
g_sync_lists.vehicles.add_sync_data(sender_plyr, (it != vehs.end() ? g_gta_data_service.get_vehicle_full_name(it->second) : "?"));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1241,7 +1241,7 @@ namespace big
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_misc_data.pickup_sync_list.add_sync_data_to_list(sender_plyr, "");
|
g_sync_lists.pickups.add_sync_data(sender_plyr, "");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case sync_node_id("CPhysicalAttachDataNode"):
|
case sync_node_id("CPhysicalAttachDataNode"):
|
||||||
@ -1299,7 +1299,7 @@ namespace big
|
|||||||
|
|
||||||
auto& peds = g_gta_data_service.peds();
|
auto& peds = g_gta_data_service.peds();
|
||||||
auto it = peds.find(creation_node->m_model);
|
auto it = peds.find(creation_node->m_model);
|
||||||
g_misc_data.ped_sync_list.add_sync_data_to_list(sender_plyr,
|
g_sync_lists.peds.add_sync_data(sender_plyr,
|
||||||
std::format("{}, {}", it != peds.end() ? it->second.m_name : "?", it != peds.end() ? it->second.m_ped_type : "?"));
|
std::format("{}, {}", it != peds.end() ? it->second.m_name : "?", it != peds.end() ? it->second.m_ped_type : "?"));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -1332,7 +1332,7 @@ namespace big
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_misc_data.object_sync_list.add_sync_data_to_list(sender_plyr, std::to_string(creation_node->m_model));
|
g_sync_lists.objects.add_sync_data(sender_plyr, std::to_string(creation_node->m_model));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case sync_node_id("CPlayerAppearanceDataNode"):
|
case sync_node_id("CPlayerAppearanceDataNode"):
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "core/data/bullet_impact_types.hpp"
|
#include "core/data/bullet_impact_types.hpp"
|
||||||
#include "core/var/misc.hpp"
|
#include "core/var/sync_lists.hpp"
|
||||||
#include "fiber_pool.hpp"
|
#include "fiber_pool.hpp"
|
||||||
#include "gta/enums.hpp"
|
#include "gta/enums.hpp"
|
||||||
#include "gta/net_game_event.hpp"
|
#include "gta/net_game_event.hpp"
|
||||||
@ -399,7 +399,7 @@ namespace big
|
|||||||
if (plyr)
|
if (plyr)
|
||||||
{
|
{
|
||||||
auto exp_type_itr = BULLET_IMPACTS.find(explosionType);
|
auto exp_type_itr = BULLET_IMPACTS.find(explosionType);
|
||||||
g_misc_data.explosion_sync_list.add_sync_data_to_list(plyr,
|
g_sync_lists.explosions.add_sync_data(plyr,
|
||||||
std::format("(Dist- {}, {})",
|
std::format("(Dist- {}, {})",
|
||||||
math::distance_between_vectors(*plyr->get_ped()->get_position(), {posX, posY, posZ}),
|
math::distance_between_vectors(*plyr->get_ped()->get_position(), {posX, posY, posZ}),
|
||||||
exp_type_itr != BULLET_IMPACTS.end() ? exp_type_itr->second : "?"));
|
exp_type_itr != BULLET_IMPACTS.end() ? exp_type_itr->second : "?"));
|
||||||
|
@ -169,7 +169,7 @@ namespace big
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
TAB_DECL(NETWORK_SYNCS),
|
TAB_DECL(NETWORK_SYNCS),
|
||||||
view::network_syncs
|
view::network_syncs
|
||||||
},
|
},
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "core/var/misc.hpp"
|
#include "core/var/sync_lists.hpp"
|
||||||
#include "services/players/player_service.hpp"
|
#include "services/players/player_service.hpp"
|
||||||
#include "view.hpp"
|
#include "view.hpp"
|
||||||
|
|
||||||
@ -19,12 +19,12 @@ namespace big
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const std::unordered_map<std::string_view, sync_list*> all_special_views = {
|
static const std::unordered_map<std::string_view, sync_list*> all_special_views = {
|
||||||
{"ped", &g_misc_data.ped_sync_list},
|
{"ped", &g_sync_lists.peds},
|
||||||
{"vehicle", &g_misc_data.vehicle_sync_list},
|
{"vehicle", &g_sync_lists.vehicles},
|
||||||
{"object", &g_misc_data.object_sync_list},
|
{"object", &g_sync_lists.objects},
|
||||||
{"pickup", &g_misc_data.pickup_sync_list},
|
{"pickup", &g_sync_lists.pickups},
|
||||||
{"explosion", &g_misc_data.explosion_sync_list},
|
{"explosion", &g_sync_lists.explosions},
|
||||||
{"ptfx", &g_misc_data.ptfx_sync_list},
|
{"ptfx", &g_sync_lists.ptfxs},
|
||||||
};
|
};
|
||||||
|
|
||||||
void view::network_syncs()
|
void view::network_syncs()
|
||||||
|
@ -159,7 +159,7 @@ namespace big
|
|||||||
ImGui::Checkbox("VIEW_PLAYER_INFO_BLOCK_CLONE_CREATE"_T.data(), &g_player_service->get_selected()->block_clone_create);
|
ImGui::Checkbox("VIEW_PLAYER_INFO_BLOCK_CLONE_CREATE"_T.data(), &g_player_service->get_selected()->block_clone_create);
|
||||||
ImGui::Checkbox("VIEW_PLAYER_INFO_BLOCK_CLONE_SYNC"_T.data(), &g_player_service->get_selected()->block_clone_sync);
|
ImGui::Checkbox("VIEW_PLAYER_INFO_BLOCK_CLONE_SYNC"_T.data(), &g_player_service->get_selected()->block_clone_sync);
|
||||||
ImGui::Checkbox("VIEW_PLAYER_INFO_BLOCK_NETWORK_EVENTS"_T.data(), &g_player_service->get_selected()->block_net_events);
|
ImGui::Checkbox("VIEW_PLAYER_INFO_BLOCK_NETWORK_EVENTS"_T.data(), &g_player_service->get_selected()->block_net_events);
|
||||||
ImGui::Checkbox("VIEW_PLAYER_INFO_BLOCK_PTFX_EVENTS"_T.data(), &g_player_service->get_selected()->block_ptfx);
|
ImGui::Checkbox("VIEW_PLAYER_INFO_BLOCK_PTFX_EVENTS"_T.data(), &g_player_service->get_selected()->block_ptfx);
|
||||||
ImGui::Checkbox("VIEW_PLAYER_INFO_LOG_CLONES"_T.data(), &g_player_service->get_selected()->log_clones);
|
ImGui::Checkbox("VIEW_PLAYER_INFO_LOG_CLONES"_T.data(), &g_player_service->get_selected()->log_clones);
|
||||||
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
@ -248,7 +248,7 @@ namespace big
|
|||||||
if (CVehicleModelInfo* vehicle_model_info = static_cast<CVehicleModelInfo*>(vehicle->m_model_info))
|
if (CVehicleModelInfo* vehicle_model_info = static_cast<CVehicleModelInfo*>(vehicle->m_model_info))
|
||||||
{
|
{
|
||||||
auto vehicle_item = g_gta_data_service.vehicles()[vehicle_model_info->m_hash];
|
auto vehicle_item = g_gta_data_service.vehicles()[vehicle_model_info->m_hash];
|
||||||
vehicle_name = g_gta_data_service.get_vehicle_full_name(vehicle_item);
|
vehicle_name = g_gta_data_service.get_vehicle_full_name(vehicle_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (veh_damage_bits & (uint32_t)eEntityProofs::GOD)
|
if (veh_damage_bits & (uint32_t)eEntityProofs::GOD)
|
||||||
|
Reference in New Issue
Block a user