From 0418527137e85c6a91db451cf073fb3f0c42f7ec Mon Sep 17 00:00:00 2001 From: m Date: Sun, 7 Jan 2024 17:03:38 -0600 Subject: [PATCH] start of ranked component --- src/client/component/dedicated.cpp | 2 -- src/client/component/ranked.cpp | 34 +++++++++++++++++++++++ src/client/loader/component_interface.hpp | 1 + 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 src/client/component/ranked.cpp diff --git a/src/client/component/dedicated.cpp b/src/client/component/dedicated.cpp index bc314f4a..f239f887 100644 --- a/src/client/component/dedicated.cpp +++ b/src/client/component/dedicated.cpp @@ -112,8 +112,6 @@ namespace dedicated } }; - command::execute("onlinegame 1", true); - command::execute("xblive_privatematch 1", true); initialize_gamemode(); } diff --git a/src/client/component/ranked.cpp b/src/client/component/ranked.cpp new file mode 100644 index 00000000..01b545e9 --- /dev/null +++ b/src/client/component/ranked.cpp @@ -0,0 +1,34 @@ +#include +#include "loader/component_loader.hpp" + +#include "component/dvars.hpp" + +#include "game/game.hpp" + +#include +#include + +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) diff --git a/src/client/loader/component_interface.hpp b/src/client/loader/component_interface.hpp index 7c6854a1..3fac3f2d 100644 --- a/src/client/loader/component_interface.hpp +++ b/src/client/loader/component_interface.hpp @@ -4,6 +4,7 @@ enum class component_priority { min = 0, dvars, + ranked, steam_proxy, arxan, };