mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-04-21 21:52:06 +02: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
2 changed files with 11 additions and 0 deletions
10
dll/dll.cpp
10
dll/dll.cpp
|
@ -140,6 +140,16 @@ Steam_Client *get_steam_client()
|
|||
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()
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
|
|
|
@ -93,6 +93,7 @@ class GB_CCallbackInterImp : protected CCallbackBase
|
|||
|
||||
Steam_Client *get_steam_client();
|
||||
bool steamclient_has_ipv6_functions();
|
||||
Steam_Client *try_get_steam_client();
|
||||
|
||||
HSteamUser flat_hsteamuser();
|
||||
HSteamPipe flat_hsteampipe();
|
||||
|
|
Loading…
Add table
Reference in a new issue