Merge pull request #97 from h1-mod/develop

Release v1.0.2
This commit is contained in:
m 2022-06-25 07:06:41 -05:00 committed by GitHub
commit eb6eeb4cec
2 changed files with 16 additions and 2 deletions

2
deps/sol2 vendored

@ -1 +1 @@
Subproject commit 2198d9374d260f168d53b6248e49068a6307227d Subproject commit c9055478c7c437f9a97610329701652673ab8262

View File

@ -10,6 +10,7 @@
#include "command.hpp" #include "command.hpp"
#include "game/game.hpp" #include "game/game.hpp"
#include "game/dvars.hpp"
#include "game/ui_scripting/execution.hpp" #include "game/ui_scripting/execution.hpp"
#include <utils/cryptography.hpp> #include <utils/cryptography.hpp>
@ -51,6 +52,9 @@ namespace server_list
volatile bool update_server_list = false; volatile bool update_server_list = false;
std::chrono::high_resolution_clock::time_point last_scroll{}; 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() size_t get_page_count()
{ {
const auto count = servers.size() / server_limit; const auto count = servers.size() / server_limit;
@ -300,7 +304,8 @@ namespace server_list
bool get_master_server(game::netadr_s& address) 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) 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; 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"); localized_strings::override("PLATFORM_SYSTEM_LINK_TITLE", "SERVER LIST");
// hook LUI_OpenMenu to refresh server list for system link menu // hook LUI_OpenMenu to refresh server list for system link menu