change the server type parameter of the request before continuing the code, since it's used multiple times and also being set in the request object

This commit is contained in:
otavepto 2024-02-29 02:38:51 +02:00 committed by otavepto
parent 3d836d694d
commit dfc8be4a7c

View File

@ -42,6 +42,11 @@ HServerListRequest Steam_Matchmaking_Servers::RequestServerList(AppId_t iApp, IS
++server_list_request;
HServerListRequest id = (char *)0 + server_list_request; // (char *)0 silences the compiler warning
if (settings->matchmaking_server_list_always_lan_type) {
PRINT_DEBUG("Steam_Matchmaking_Servers::RequestServerList forcing request type to LAN\n");
type = EMatchMakingType::eLANServer;
}
struct Steam_Matchmaking_Request request{};
request.appid = iApp;
request.callbacks = pRequestServersResponse;
@ -53,7 +58,7 @@ HServerListRequest Steam_Matchmaking_Servers::RequestServerList(AppId_t iApp, IS
requests.push_back(request);
PRINT_DEBUG("Steam_Matchmaking_Servers::request id: %p\n", id);
if (type == eLANServer || settings->matchmaking_server_list_always_lan_type) return id;
if (type == eLANServer) return id;
if (type == eFriendsServer) {
for (auto &g : gameservers_friends) {