mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-07-21 04:36:18 +03:00
lsteamclient: Use the PE side request to cache GetServerDetails results.
This commit is contained in:
parent
76b98269dd
commit
11083b94b5
@ -239,7 +239,7 @@ MANUAL_METHODS = {
|
||||
|
||||
"ISteamMatchmakingServers_CancelQuery": lambda ver, abi: abi == 'u' and ver >= 2,
|
||||
"ISteamMatchmakingServers_GetServerCount": lambda ver, abi: abi == 'u' and ver >= 2,
|
||||
"ISteamMatchmakingServers_GetServerDetails": lambda ver, abi: abi == 'u' and ver >= 2,
|
||||
"ISteamMatchmakingServers_GetServerDetails": lambda ver, abi: ver >= 2,
|
||||
"ISteamMatchmakingServers_IsRefreshing": lambda ver, abi: abi == 'u' and ver >= 2,
|
||||
"ISteamMatchmakingServers_PingServer": lambda ver, abi: abi == 'u',
|
||||
"ISteamMatchmakingServers_PlayerDetails": lambda ver, abi: abi == 'u',
|
||||
|
@ -176,5 +176,35 @@ void __thiscall winISteamMatchmakingServers_SteamMatchMakingServers002_ReleaseRe
|
||||
|
||||
STEAMCLIENT_CALL( ISteamMatchmakingServers_SteamMatchMakingServers002_ReleaseRequest, ¶ms );
|
||||
|
||||
if (request) HeapFree( GetProcessHeap(), 0, request->details );
|
||||
HeapFree( GetProcessHeap(), 0, request );
|
||||
}
|
||||
|
||||
gameserveritem_t_105 * __thiscall winISteamMatchmakingServers_SteamMatchMakingServers002_GetServerDetails( struct w_iface *_this, void *hRequest, int32_t iServer )
|
||||
{
|
||||
struct ISteamMatchmakingServers_SteamMatchMakingServers002_GetServerDetails_params params =
|
||||
{
|
||||
.u_iface = _this->u_iface,
|
||||
.hRequest = hRequest,
|
||||
.iServer = iServer,
|
||||
};
|
||||
struct w_request *request = hRequest;
|
||||
|
||||
TRACE( "%p\n", _this );
|
||||
|
||||
if (request && !request->details)
|
||||
{
|
||||
struct ISteamMatchmakingServers_SteamMatchMakingServers002_GetServerCount_params count_params =
|
||||
{
|
||||
.u_iface = _this->u_iface,
|
||||
.hRequest = hRequest,
|
||||
};
|
||||
|
||||
STEAMCLIENT_CALL( ISteamMatchmakingServers_SteamMatchMakingServers002_GetServerCount, &count_params );
|
||||
if (count_params._ret) request->details = HeapAlloc( GetProcessHeap(), 0, count_params._ret * sizeof(*request->details) );
|
||||
}
|
||||
|
||||
STEAMCLIENT_CALL( ISteamMatchmakingServers_SteamMatchMakingServers002_GetServerDetails, ¶ms );
|
||||
if (request && request->details && params._ret.ptr) return request->details + iServer;
|
||||
return get_unix_buffer( params._ret );
|
||||
}
|
||||
|
@ -347,7 +347,9 @@ template< typename Iface, typename Params >
|
||||
static NTSTATUS ISteamMatchmakingServers_GetServerDetails( Iface *iface, Params *params )
|
||||
{
|
||||
struct w_request *w_request = (struct w_request *)(void *)params->hRequest;
|
||||
params->_ret = iface->GetServerDetails( w_request ? (void *)w_request->u_request : nullptr, params->iServer );
|
||||
gameserveritem_t_105 *item = iface->GetServerDetails( w_request ? (void *)w_request->u_request : nullptr, params->iServer );
|
||||
if (w_request && w_request->details) w_request->details[params->iServer] = *item;
|
||||
params->_ret = item;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -229,6 +229,7 @@ struct w_request
|
||||
{
|
||||
struct u_request u_request;
|
||||
struct u_response u_response;
|
||||
gameserveritem_t_105 *details;
|
||||
};
|
||||
|
||||
#include <poppack.h>
|
||||
|
@ -278,19 +278,6 @@ DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers002_P
|
||||
DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers002_ServerRules, 16)
|
||||
DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers002_CancelServerQuery, 8)
|
||||
|
||||
gameserveritem_t_105 * __thiscall winISteamMatchmakingServers_SteamMatchMakingServers002_GetServerDetails(struct w_iface *_this, void *hRequest, int32_t iServer)
|
||||
{
|
||||
struct ISteamMatchmakingServers_SteamMatchMakingServers002_GetServerDetails_params params =
|
||||
{
|
||||
.u_iface = _this->u_iface,
|
||||
.hRequest = hRequest,
|
||||
.iServer = iServer,
|
||||
};
|
||||
TRACE("%p\n", _this);
|
||||
STEAMCLIENT_CALL( ISteamMatchmakingServers_SteamMatchMakingServers002_GetServerDetails, ¶ms );
|
||||
return get_unix_buffer( params._ret );
|
||||
}
|
||||
|
||||
void __thiscall winISteamMatchmakingServers_SteamMatchMakingServers002_CancelQuery(struct w_iface *_this, void *hRequest)
|
||||
{
|
||||
struct ISteamMatchmakingServers_SteamMatchMakingServers002_CancelQuery_params params =
|
||||
|
Loading…
x
Reference in New Issue
Block a user