Rename component interfaces
This commit is contained in:
parent
3a6f973473
commit
59586e18e6
@ -696,7 +696,7 @@ namespace arxan
|
||||
return zw_terminate_process_hook.invoke<NTSTATUS>(process_handle, exit_status);
|
||||
}
|
||||
|
||||
struct component final : component_interface
|
||||
struct component final : generic_component
|
||||
{
|
||||
void post_load() override
|
||||
{
|
||||
|
@ -107,7 +107,7 @@ namespace auth
|
||||
return guid;
|
||||
}
|
||||
|
||||
struct component final : client_component_interface
|
||||
struct component final : client_component
|
||||
{
|
||||
void post_unpack() override
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ namespace bots
|
||||
}
|
||||
}
|
||||
|
||||
struct component final : client_component_interface
|
||||
struct component final : client_component
|
||||
{
|
||||
void post_unpack() override
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ namespace branding
|
||||
}
|
||||
}
|
||||
|
||||
struct component final : client_component_interface
|
||||
struct component final : client_component
|
||||
{
|
||||
void post_unpack() override
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ namespace colors
|
||||
utils::hook::copy(g_color_table + index * 4, color_float, sizeof(color_float));
|
||||
}
|
||||
|
||||
struct component final : client_component_interface
|
||||
struct component final : client_component
|
||||
{
|
||||
void post_unpack() override
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ namespace command
|
||||
}
|
||||
}
|
||||
|
||||
struct component final : client_component_interface
|
||||
struct component final : client_component
|
||||
{
|
||||
void post_unpack() override
|
||||
{
|
||||
|
@ -193,7 +193,7 @@ namespace console
|
||||
}
|
||||
}
|
||||
|
||||
struct component final : client_component_interface
|
||||
struct component final : client_component
|
||||
{
|
||||
void post_unpack() override
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ namespace dedicated
|
||||
{
|
||||
}
|
||||
|
||||
struct component final : server_component_interface
|
||||
struct component final : server_component
|
||||
{
|
||||
void post_unpack() override
|
||||
{
|
||||
|
@ -441,7 +441,7 @@ namespace demonware
|
||||
}
|
||||
}
|
||||
|
||||
struct component final : component_interface
|
||||
struct component final : generic_component
|
||||
{
|
||||
component()
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ namespace discord
|
||||
}
|
||||
}
|
||||
|
||||
class component final : public client_component_interface
|
||||
class component final : public client_component
|
||||
{
|
||||
public:
|
||||
void post_load() override
|
||||
|
@ -193,7 +193,7 @@ namespace exception
|
||||
}
|
||||
}
|
||||
|
||||
struct component final : component_interface
|
||||
struct component final : generic_component
|
||||
{
|
||||
component()
|
||||
{
|
||||
|
@ -29,7 +29,7 @@ namespace icon
|
||||
}
|
||||
}
|
||||
|
||||
struct component final : component_interface
|
||||
struct component final : generic_component
|
||||
{
|
||||
void post_load() override
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ namespace loot
|
||||
}
|
||||
};
|
||||
|
||||
struct component final : client_component_interface
|
||||
struct component final : client_component
|
||||
{
|
||||
void post_unpack() override
|
||||
{
|
||||
|
@ -210,7 +210,7 @@ namespace network
|
||||
return 2;
|
||||
}
|
||||
|
||||
struct component final : client_component_interface
|
||||
struct component final : client_component
|
||||
{
|
||||
void post_unpack() override
|
||||
{
|
||||
|
@ -217,7 +217,7 @@ namespace party
|
||||
network::send(host, "getInfo", challenge);
|
||||
}
|
||||
|
||||
struct component final : client_component_interface
|
||||
struct component final : client_component
|
||||
{
|
||||
void post_unpack() override
|
||||
{
|
||||
|
@ -149,7 +149,7 @@ namespace scheduler
|
||||
}, type, delay);
|
||||
}
|
||||
|
||||
struct component final : component_interface
|
||||
struct component final : generic_component
|
||||
{
|
||||
void post_load() override
|
||||
{
|
||||
|
@ -165,7 +165,7 @@ namespace splash
|
||||
}
|
||||
}
|
||||
|
||||
struct component final : client_component_interface
|
||||
struct component final : client_component
|
||||
{
|
||||
component()
|
||||
{
|
||||
|
@ -205,7 +205,7 @@ namespace steam_proxy
|
||||
}
|
||||
}
|
||||
|
||||
struct component final : component_interface
|
||||
struct component final : generic_component
|
||||
{
|
||||
void post_load() override
|
||||
{
|
||||
|
@ -127,7 +127,7 @@ namespace updater
|
||||
}
|
||||
}
|
||||
|
||||
class component final : public component_interface
|
||||
class component final : public generic_component
|
||||
{
|
||||
public:
|
||||
component()
|
||||
|
@ -9,7 +9,7 @@ namespace game
|
||||
{
|
||||
const utils::nt::library& get_host_library()
|
||||
{
|
||||
static auto host = []
|
||||
static auto host_library = []
|
||||
{
|
||||
utils::nt::library host{};
|
||||
if (!host || host == utils::nt::library::get_by_address(get_base))
|
||||
@ -19,7 +19,8 @@ namespace game
|
||||
|
||||
return host;
|
||||
}();
|
||||
return host;
|
||||
|
||||
return host_library;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,11 +17,11 @@ enum class component_type
|
||||
any,
|
||||
};
|
||||
|
||||
struct component_interface
|
||||
struct generic_component
|
||||
{
|
||||
static constexpr component_type type = component_type::any;
|
||||
|
||||
virtual ~component_interface() = default;
|
||||
virtual ~generic_component() = default;
|
||||
|
||||
virtual void post_load()
|
||||
{
|
||||
@ -41,12 +41,12 @@ struct component_interface
|
||||
}
|
||||
};
|
||||
|
||||
struct client_component_interface : component_interface
|
||||
struct client_component : generic_component
|
||||
{
|
||||
static constexpr component_type type = component_type::client;
|
||||
};
|
||||
|
||||
struct server_component_interface : component_interface
|
||||
struct server_component : generic_component
|
||||
{
|
||||
static constexpr component_type type = component_type::server;
|
||||
};
|
||||
|
@ -7,9 +7,9 @@ namespace component_loader
|
||||
{
|
||||
namespace
|
||||
{
|
||||
std::vector<std::unique_ptr<component_interface>>& get_components()
|
||||
std::vector<std::unique_ptr<generic_component>>& get_components()
|
||||
{
|
||||
using component_vector = std::vector<std::unique_ptr<component_interface>>;
|
||||
using component_vector = std::vector<std::unique_ptr<generic_component>>;
|
||||
using component_vector_container = std::unique_ptr<component_vector, std::function<void(component_vector*)>>
|
||||
;
|
||||
|
||||
@ -29,13 +29,13 @@ namespace component_loader
|
||||
return functors;
|
||||
}
|
||||
|
||||
void activate_component(std::unique_ptr<component_interface> component)
|
||||
void activate_component(std::unique_ptr<generic_component> component)
|
||||
{
|
||||
auto& components = get_components();
|
||||
components.push_back(std::move(component));
|
||||
|
||||
std::ranges::stable_sort(components, [](const std::unique_ptr<component_interface>& a,
|
||||
const std::unique_ptr<component_interface>& b)
|
||||
std::ranges::stable_sort(components, [](const std::unique_ptr<generic_component>& a,
|
||||
const std::unique_ptr<generic_component>& b)
|
||||
{
|
||||
return a->priority() > b->priority();
|
||||
});
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
namespace component_loader
|
||||
{
|
||||
using registration_functor = std::function<std::unique_ptr<component_interface>()>;
|
||||
using registration_functor = std::function<std::unique_ptr<generic_component>()>;
|
||||
|
||||
void register_component(registration_functor functor, component_type type);
|
||||
|
||||
@ -25,7 +25,7 @@ namespace component_loader
|
||||
template <typename T>
|
||||
class installer final
|
||||
{
|
||||
static_assert(std::is_base_of_v<component_interface, T>, "component has invalid base class");
|
||||
static_assert(std::is_base_of_v<generic_component, T>, "component has invalid base class");
|
||||
|
||||
public:
|
||||
installer()
|
||||
|
Loading…
Reference in New Issue
Block a user