From b6d41f0c173f8139e8c39140b9dd9e222c52ac1e Mon Sep 17 00:00:00 2001 From: m Date: Sat, 25 Jun 2022 07:03:11 -0500 Subject: [PATCH 1/2] master server dvars (#96) * add master_server_ip & master_server_port * fix build * fix dvars crashing game --- src/client/component/server_list.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/client/component/server_list.cpp b/src/client/component/server_list.cpp index cd078488..25db1248 100644 --- a/src/client/component/server_list.cpp +++ b/src/client/component/server_list.cpp @@ -10,6 +10,7 @@ #include "command.hpp" #include "game/game.hpp" +#include "game/dvars.hpp" #include "game/ui_scripting/execution.hpp" #include @@ -51,6 +52,9 @@ namespace server_list volatile bool update_server_list = false; std::chrono::high_resolution_clock::time_point last_scroll{}; + game::dvar_t* master_server_ip; + game::dvar_t* master_server_port; + size_t get_page_count() { const auto count = servers.size() / server_limit; @@ -300,7 +304,8 @@ namespace server_list bool get_master_server(game::netadr_s& address) { - return game::NET_StringToAdr("master.h1.gg:20810", &address); + return game::NET_StringToAdr(utils::string::va("%s:%s", + master_server_ip->current.string, master_server_port->current.string), &address); } void handle_info_response(const game::netadr_s& address, const utils::info_string& info) @@ -370,6 +375,15 @@ namespace server_list { if (!game::environment::is_mp()) return; + scheduler::once([]() + { + // add dvars to change destination master server ip/port + master_server_ip = dvars::register_string("masterServerIP", "master.h1.gg", game::DVAR_FLAG_NONE, + "IP of the destination master server to connect to"); + master_server_port = dvars::register_string("masterServerPort", "20810", game::DVAR_FLAG_NONE, + "Port of the destination master server to connect to"); + }, scheduler::pipeline::main); + localized_strings::override("PLATFORM_SYSTEM_LINK_TITLE", "SERVER LIST"); // hook LUI_OpenMenu to refresh server list for system link menu From 0212d729b8aa19c6c4465840bd5709d194318777 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Jun 2022 07:03:26 -0500 Subject: [PATCH 2/2] Bump deps/sol2 from `2198d93` to `c905547` (#90) Bumps [deps/sol2](https://github.com/ThePhD/sol2) from `2198d93` to `c905547`. - [Release notes](https://github.com/ThePhD/sol2/releases) - [Commits](https://github.com/ThePhD/sol2/compare/2198d9374d260f168d53b6248e49068a6307227d...c9055478c7c437f9a97610329701652673ab8262) --- updated-dependencies: - dependency-name: deps/sol2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- deps/sol2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/sol2 b/deps/sol2 index 2198d937..c9055478 160000 --- a/deps/sol2 +++ b/deps/sol2 @@ -1 +1 @@ -Subproject commit 2198d9374d260f168d53b6248e49068a6307227d +Subproject commit c9055478c7c437f9a97610329701652673ab8262