Compare commits

..

6 Commits

Author SHA1 Message Date
Mr_Goldberg 38ad2c057c
Fix flat api not getting exported. 2020-01-15 19:43:46 -05:00
Mr_Goldberg 0c4831260e
Forgot this. 2020-01-15 14:27:27 -05:00
Mr_Goldberg d9173e7b50
Fix yaml. 2020-01-15 13:27:15 -05:00
Mr_Goldberg 47c8f0a2a1
Fix yaml? 2020-01-15 13:21:37 -05:00
Mr_Goldberg 0ed433cb26
Add a bundle of the source code to the git builds zip. 2020-01-15 13:18:12 -05:00
Mr_Goldberg 81830efd58
Close background thread on steamclient shutdown. 2020-01-15 12:40:18 -05:00
3 changed files with 30 additions and 16 deletions

View File

@ -153,6 +153,10 @@ deploy_all:
script:
- ls -lah
- dnf -y install git
- mkdir -p release/source_code
- git bundle create release/source_code/source_code.bundle --all
- "echo \"This is a git bundle of the full repo, to use: git clone source_code.bundle --branch master\" > release/source_code/Readme.txt"
- mv linux release/
- shopt -s extglob
- rm -rf .g*

View File

@ -21,7 +21,7 @@
#define STEAMAPI_API static
#define STEAMCLIENT_API S_API_EXPORT
#else
#define STEAMAPI_API S_API
#define STEAMAPI_API S_API_EXPORT
#define STEAMCLIENT_API static
#endif

View File

@ -18,25 +18,25 @@
#include "steam_client.h"
#include "settings_parser.h"
static bool kill_background_thread;
#include <condition_variable>
static std::condition_variable kill_background_thread_cv;
static std::atomic_bool kill_background_thread;
static void background_thread(Steam_Client *client)
{
PRINT_DEBUG("background thread starting\n");
while (1) {
std::this_thread::sleep_for(std::chrono::seconds(1));
global_mutex.lock();
bool net_alive = client->network->isAlive();
if (!net_alive || kill_background_thread) {
global_mutex.unlock();
if (!net_alive) {
//delete network;
}
std::mutex mtx;
std::unique_lock<std::mutex> lck(mtx);
kill_background_thread = false;
while (1) {
if (kill_background_thread || kill_background_thread_cv.wait_for(lck, std::chrono::seconds(1)) != std::cv_status::timeout) {
if (kill_background_thread) {
PRINT_DEBUG("background thread exit\n");
return;
}
}
global_mutex.lock();
PRINT_DEBUG("background thread run\n");
client->network->Run();
client->steam_matchmaking->RunBackground();
@ -730,10 +730,20 @@ void Steam_Client::SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction
bool Steam_Client::BShutdownIfAllPipesClosed()
{
PRINT_DEBUG("BShutdownIfAllPipesClosed\n");
if (!steam_pipes.size()) {
if (background_keepalive.joinable()) {
kill_background_thread = true;
kill_background_thread_cv.notify_one();
background_keepalive.join();
}
PRINT_DEBUG("all pipes closed\n");
return true;
}
return false;
}
// Expose HTTP interface
ISteamHTTP *Steam_Client::GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion )
{