start of ranked component

This commit is contained in:
m 2024-01-07 17:03:38 -06:00
parent f9d405ee7c
commit 0418527137
3 changed files with 35 additions and 2 deletions

View File

@ -112,8 +112,6 @@ namespace dedicated
}
};
command::execute("onlinegame 1", true);
command::execute("xblive_privatematch 1", true);
initialize_gamemode();
}

View File

@ -0,0 +1,34 @@
#include <std_include.hpp>
#include "loader/component_loader.hpp"
#include "component/dvars.hpp"
#include "game/game.hpp"
#include <utils/hook.hpp>
#include <utils/flags.hpp>
namespace ranked
{
class component final : public component_interface
{
public:
void post_unpack() override
{
dvars::override::register_bool("xblive_privatematch", false, game::DVAR_FLAG_REPLICATED);
if (game::environment::is_dedi())
{
dvars::override::register_bool("xblive_privatematch", false, game::DVAR_FLAG_REPLICATED | game::DVAR_FLAG_WRITE);
game::Dvar_RegisterBool("onlinegame", true, game::DVAR_FLAG_READ, "Current game is an online game with stats, custom classes, unlocks");
}
}
component_priority priority() override
{
return component_priority::ranked;
}
};
}
REGISTER_COMPONENT(ranked::component)

View File

@ -4,6 +4,7 @@ enum class component_priority
{
min = 0,
dvars,
ranked,
steam_proxy,
arxan,
};