From 7e136bba14de1b13973db25600f4b58a78d74fe2 Mon Sep 17 00:00:00 2001 From: Mr_Goldberg Date: Fri, 14 Feb 2020 15:01:54 -0500 Subject: [PATCH] Callback results improvements. --- dll/base.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dll/base.h b/dll/base.h index 5900583..a6ec8f7 100644 --- a/dll/base.h +++ b/dll/base.h @@ -111,7 +111,7 @@ public: }; #define STEAM_CALLRESULT_TIMEOUT 120.0 -#define STEAM_CALLRESULT_WAIT_FOR_CB 0.05 +#define STEAM_CALLRESULT_WAIT_FOR_CB 0.01 struct Steam_Call_Result { Steam_Call_Result(SteamAPICall_t a, int icb, void *r, unsigned int s, double r_in, bool run_cc_cb) { api_call = a; @@ -243,9 +243,11 @@ public: auto cb_result = std::find_if(callresults.begin(), callresults.end(), [api_call](struct Steam_Call_Result const& item) { return item.api_call == api_call; }); if (cb_result != callresults.end()) { if (cb_result->reserved) { + std::chrono::high_resolution_clock::time_point created = cb_result->created; std::vector temp_cbs = cb_result->callbacks; *cb_result = Steam_Call_Result(api_call, iCallback, result, size, timeout, run_call_completed_cb); cb_result->callbacks = temp_cbs; + cb_result->created = created; return cb_result->api_call; } } else {