MCPcopy Create free account
hub / github.com/Rat431/ColdAPI_Steam / RunCallbacks

Function RunCallbacks

src/ColdAPI_Steam/CSteamCallbacks.cpp:14–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12 std::vector<CSteamAPIResult_t>::iterator CurrentCB;
13
14 void RunCallbacks()
15 {
16 // Lock
17 Thread.lock();
18
19 // Loop to our stored callresults.
20 auto criter = ResultsBuffer.begin();
21 while (criter != ResultsBuffer.end())
22 {
23 // Scan from the request callresult IDs and run its callback.
24 auto ResultHws = ResultHandlersBuffers.find(criter->Call);
25 if (ResultHws != ResultHandlersBuffers.end()) {
26 // Run the callback if was marked active.
27 if (_Calls[criter->Call] == true)
28 ResultHandlersBuffers[criter->Call]->Run(criter->Data, false, criter->Call);
29 }
30 // Scan from the callback type.
31 auto cbiter = CallbacksBuffer.begin();
32 while (cbiter != CallbacksBuffer.end())
33 {
34 CCallbackBase* CallBack = *cbiter;
35 if (CallBack && CallBack->GetICallback() == criter->Type)
36 if (_Calls[criter->Call] == true)
37 CallBack->Run(criter->Data);
38 ++cbiter;
39 }
40 ++criter;
41 }
42 ResultsBuffer.clear();
43 Thread.unlock();
44 }
45 void RegisterCallback(CCallbackBase* handler, int callbackID)
46 {
47 // Store the new callback ID.

Callers 2

SteamAPI_RunCallbacksFunction · 0.85
Steam_RunCallbacksFunction · 0.85

Calls 2

RunMethod · 0.45
GetICallbackMethod · 0.45

Tested by

no test coverage detected