remove useless dvar fetching
This commit is contained in:
parent
4e234e88ef
commit
00ac17c901
@ -273,7 +273,7 @@ namespace Components
|
|||||||
const auto masterServerName = Dvar::Var("masterServerName").get<const char*>();
|
const auto masterServerName = Dvar::Var("masterServerName").get<const char*>();
|
||||||
|
|
||||||
Game::netadr_t masterServerAddr;
|
Game::netadr_t masterServerAddr;
|
||||||
if (ServerList::GetMasterServer(masterServerAddr))
|
if (ServerList::GetMasterServer(masterServerName, masterPort, masterServerAddr))
|
||||||
{
|
{
|
||||||
Toast::Show("cardicon_headshot", "Server Browser", "Fetching servers...", 3000);
|
Toast::Show("cardicon_headshot", "Server Browser", "Fetching servers...", 3000);
|
||||||
useMasterServer = true;
|
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>();
|
return Game::NET_StringToAdr(Utils::String::VA("%s:%u", ip, port), &address);
|
||||||
auto masterServerName = Dvar::Var("masterServerName").get<const char*>();
|
|
||||||
|
|
||||||
return Game::NET_StringToAdr(Utils::String::VA("%s:%u", masterServerName, masterPort), &address);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ServerList::IsServerListOpen()
|
bool ServerList::IsServerListOpen()
|
||||||
|
@ -50,7 +50,7 @@ namespace Components
|
|||||||
|
|
||||||
static void UpdateVisibleInfo();
|
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;
|
static bool useMasterServer;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user