dedi info + remove shaders component

The shaders are working and populating on 1.15 so no need to disable them.
This commit is contained in:
Skull Merlin 2022-05-20 23:36:52 +03:00
parent 7210536a44
commit 32b02d9b92
2 changed files with 3 additions and 55 deletions

View File

@ -1,5 +1,4 @@
#include <std_include.hpp> #include <std_include.hpp>
#include "console.hpp"
#include "loader/component_loader.hpp" #include "loader/component_loader.hpp"
#include "game/game.hpp" #include "game/game.hpp"
#include "scheduler.hpp" #include "scheduler.hpp"
@ -22,7 +21,7 @@ namespace dedicated_info
auto* sv_running = game::Dvar_FindVar("sv_running"); auto* sv_running = game::Dvar_FindVar("sv_running");
if (!sv_running || !sv_running->current.enabled) if (!sv_running || !sv_running->current.enabled)
{ {
console::set_title("H1-Mod Dedicated Server"); SetConsoleTitle("H1-Mod Dedicated Server");
return; return;
} }
@ -54,7 +53,7 @@ namespace dedicated_info
utils::string::strip(sv_hostname->current.string, cleaned_hostname.data(), utils::string::strip(sv_hostname->current.string, cleaned_hostname.data(),
static_cast<int>(strlen(sv_hostname->current.string)) + 1); static_cast<int>(strlen(sv_hostname->current.string)) + 1);
console::set_title(utils::string::va("%s on %s [%d/%d] (%d)", cleaned_hostname.data(), SetConsoleTitle(utils::string::va("%s on %s [%d/%d] (%d)", cleaned_hostname.data(),
mapname->current.string, client_count, mapname->current.string, client_count,
sv_maxclients->current.integer, bot_count)); sv_maxclients->current.integer, bot_count));
}, scheduler::pipeline::main, 1s); }, scheduler::pipeline::main, 1s);
@ -62,4 +61,4 @@ namespace dedicated_info
}; };
} }
//REGISTER_COMPONENT(dedicated_info::component) REGISTER_COMPONENT(dedicated_info::component)

View File

@ -1,51 +0,0 @@
#include <std_include.hpp>
#include "loader/component_loader.hpp"
#include "scheduler.hpp"
#include "dvars.hpp"
#include "game/game.hpp"
#include "game/dvars.hpp"
#include <utils/nt.hpp>
#include <utils/hook.hpp>
#include <utils/flags.hpp>
namespace shaders
{
namespace
{
game::dvar_t* disable_shader_caching = nullptr;
bool shader_should_show_dialog_stub()
{
return !disable_shader_caching->current.enabled;
}
}
class component final : public component_interface
{
public:
void post_unpack() override
{
if (!game::environment::is_mp())
{
return;
}
const auto has_flag = utils::flags::has_flag("noshadercaching");
disable_shader_caching = dvars::register_bool("disable_shader_caching", has_flag,
game::DVAR_FLAG_SAVED, "Disable shader caching");
if (has_flag)
{
dvars::override::set_bool("disable_shader_caching", 1);
dvars::override::set_from_string("disable_shader_caching", "1");
}
utils::hook::jump(0x14007E710, shader_should_show_dialog_stub);
}
};
}
//REGISTER_COMPONENT(shaders::component)