mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-11-27 14:08:39 +01:00
Callback results improvements.
This commit is contained in:
parent
6f4273bf3a
commit
7e136bba14
1 changed files with 3 additions and 1 deletions
|
@ -111,7 +111,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
#define STEAM_CALLRESULT_TIMEOUT 120.0
|
#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 {
|
struct Steam_Call_Result {
|
||||||
Steam_Call_Result(SteamAPICall_t a, int icb, void *r, unsigned int s, double r_in, bool run_cc_cb) {
|
Steam_Call_Result(SteamAPICall_t a, int icb, void *r, unsigned int s, double r_in, bool run_cc_cb) {
|
||||||
api_call = a;
|
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; });
|
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 != callresults.end()) {
|
||||||
if (cb_result->reserved) {
|
if (cb_result->reserved) {
|
||||||
|
std::chrono::high_resolution_clock::time_point created = cb_result->created;
|
||||||
std::vector<class CCallbackBase *> temp_cbs = cb_result->callbacks;
|
std::vector<class CCallbackBase *> temp_cbs = cb_result->callbacks;
|
||||||
*cb_result = Steam_Call_Result(api_call, iCallback, result, size, timeout, run_call_completed_cb);
|
*cb_result = Steam_Call_Result(api_call, iCallback, result, size, timeout, run_call_completed_cb);
|
||||||
cb_result->callbacks = temp_cbs;
|
cb_result->callbacks = temp_cbs;
|
||||||
|
cb_result->created = created;
|
||||||
return cb_result->api_call;
|
return cb_result->api_call;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue