mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator
synced 2025-05-23 21:57:40 +08:00
Add try_get_steam_client().
This allows the emulator to attempt to access the global steam_client object without creating it if it doesn't exist.
This commit is contained in:
parent
cde29f0fd0
commit
75035de2f4
10
dll/dll.cpp
10
dll/dll.cpp
@ -140,6 +140,16 @@ Steam_Client *get_steam_client()
|
|||||||
return steamclient_instance;
|
return steamclient_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Steam_Client *try_get_steam_client()
|
||||||
|
{
|
||||||
|
Steam_Client * ret = NULL;
|
||||||
|
if (global_mutex.try_lock() == true) {
|
||||||
|
ret = steamclient_instance;
|
||||||
|
global_mutex.unlock();
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
void destroy_client()
|
void destroy_client()
|
||||||
{
|
{
|
||||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||||
|
@ -93,6 +93,7 @@ class GB_CCallbackInterImp : protected CCallbackBase
|
|||||||
|
|
||||||
Steam_Client *get_steam_client();
|
Steam_Client *get_steam_client();
|
||||||
bool steamclient_has_ipv6_functions();
|
bool steamclient_has_ipv6_functions();
|
||||||
|
Steam_Client *try_get_steam_client();
|
||||||
|
|
||||||
HSteamUser flat_hsteamuser();
|
HSteamUser flat_hsteamuser();
|
||||||
HSteamPipe flat_hsteampipe();
|
HSteamPipe flat_hsteampipe();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user