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 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