remove useless dvar fetching

This commit is contained in:
m 2022-05-03 02:01:54 -05:00
parent 4e234e88ef
commit 00ac17c901
2 changed files with 4 additions and 7 deletions

View File

@ -273,7 +273,7 @@ namespace Components
const auto masterServerName = Dvar::Var("masterServerName").get<const char*>();
Game::netadr_t masterServerAddr;
if (ServerList::GetMasterServer(masterServerAddr))
if (ServerList::GetMasterServer(masterServerName, masterPort, masterServerAddr))
{
Toast::Show("cardicon_headshot", "Server Browser", "Fetching servers...", 3000);
useMasterServer = true;
@ -738,12 +738,9 @@ namespace Components
}
}
bool ServerList::GetMasterServer(Game::netadr_t& address)
bool ServerList::GetMasterServer(const char* ip, int port, Game::netadr_t& address)
{
auto masterPort = Dvar::Var("masterPort").get<int>();
auto masterServerName = Dvar::Var("masterServerName").get<const char*>();
return Game::NET_StringToAdr(Utils::String::VA("%s:%u", masterServerName, masterPort), &address);
return Game::NET_StringToAdr(Utils::String::VA("%s:%u", ip, port), &address);
}
bool ServerList::IsServerListOpen()

View File

@ -50,7 +50,7 @@ namespace Components
static void UpdateVisibleInfo();
static bool GetMasterServer(Game::netadr_t& address);
static bool GetMasterServer(const char* ip, int port, Game::netadr_t& address);
static bool useMasterServer;
private: