mirror of
https://github.com/alicealys/t5-gsc-utils.git
synced 2026-08-01 12:40:36 +00:00
Compare commits
1
Commits
6beabba9e5
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a87903b88 |
@@ -13,24 +13,21 @@ namespace user_info
|
|||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
using user_info_map = std::unordered_map<std::string, std::string>;
|
using user_info_map = std::unordered_map<std::string, std::string>;
|
||||||
std::unordered_map<int, user_info_map> user_info_overrides;
|
std::array<user_info_map, 18> user_info_overrides;
|
||||||
|
|
||||||
utils::hook::detour scr_shutdown_system_hook;
|
utils::hook::detour scr_shutdown_system_hook;
|
||||||
|
|
||||||
void clear_client_overrides(const int client_num)
|
void clear_client_overrides(unsigned int client_num)
|
||||||
{
|
{
|
||||||
user_info_overrides[client_num].clear();
|
user_info_overrides[client_num].clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear_all_overrides()
|
void clear_all_overrides()
|
||||||
{
|
{
|
||||||
user_info_overrides.clear();
|
for (auto& entry : user_info_overrides)
|
||||||
}
|
|
||||||
|
|
||||||
void client_disconnect_stub(const int client_num)
|
|
||||||
{
|
{
|
||||||
clear_client_overrides(client_num);
|
entry.clear();
|
||||||
game::ClientDisconnect(client_num);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void scr_shutdown_system_stub(const game::scriptInstance_t inst, const unsigned char sys, const int b_complete)
|
void scr_shutdown_system_stub(const game::scriptInstance_t inst, const unsigned char sys, const int b_complete)
|
||||||
@@ -45,11 +42,6 @@ namespace user_info
|
|||||||
|
|
||||||
utils::info_string map(buffer);
|
utils::info_string map(buffer);
|
||||||
|
|
||||||
if (!user_info_overrides.contains(index))
|
|
||||||
{
|
|
||||||
user_info_overrides[index] = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto& [key, val] : user_info_overrides[index])
|
for (const auto& [key, val] : user_info_overrides[index])
|
||||||
{
|
{
|
||||||
if (val.empty())
|
if (val.empty())
|
||||||
@@ -75,7 +67,8 @@ namespace user_info
|
|||||||
utils::hook::call(SELECT_VALUE(0x5D38EB, 0x4A75E2), sv_get_user_info_stub);
|
utils::hook::call(SELECT_VALUE(0x5D38EB, 0x4A75E2), sv_get_user_info_stub);
|
||||||
utils::hook::call(SELECT_VALUE(0x67FFE9, 0x548DB0), sv_get_user_info_stub);
|
utils::hook::call(SELECT_VALUE(0x67FFE9, 0x548DB0), sv_get_user_info_stub);
|
||||||
|
|
||||||
utils::hook::call(SELECT_VALUE(0x4F3931, 0x5DC953), client_disconnect_stub);
|
plugin->get_interface()->callbacks()->on_player_connect(clear_client_overrides);
|
||||||
|
plugin->get_interface()->callbacks()->on_player_disconnect(clear_client_overrides);
|
||||||
|
|
||||||
scr_shutdown_system_hook.create(SELECT_VALUE(0x596D40, 0x540780), scr_shutdown_system_stub);
|
scr_shutdown_system_hook.create(SELECT_VALUE(0x596D40, 0x540780), scr_shutdown_system_stub);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user