MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / RunThinkPart

Method RunThinkPart

core/logic/smn_database.cpp:251–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249 m_pFunction->Execute(NULL);
250 }
251 void RunThinkPart()
252 {
253 /* Create a Handle for our query */
254 HandleSecurity sec(me->GetIdentity(), g_pCoreIdent);
255
256 Handle_t qh = BAD_HANDLE;
257
258 if (m_pQuery)
259 {
260 CombinedQuery *c = new CombinedQuery(m_pQuery, m_pDatabase);
261
262 qh = CreateLocalHandle(hCombinedQueryType, c, &sec);
263 if (qh != BAD_HANDLE)
264 {
265 m_pQuery = NULL;
266 } else {
267 g_pSM->Format(error, sizeof(error), "Could not alloc handle");
268 delete c;
269 }
270 }
271
272 if (m_pFunction->IsRunnable())
273 {
274 m_pFunction->PushCell(m_MyHandle);
275 m_pFunction->PushCell(qh);
276 m_pFunction->PushString(qh == BAD_HANDLE ? error : "");
277 m_pFunction->PushCell(m_Data);
278 m_pFunction->Execute(NULL);
279 }
280
281 if (qh != BAD_HANDLE)
282 {
283 handlesys->FreeHandle(qh, &sec);
284 }
285 }
286 void Destroy()
287 {
288 delete this;

Callers 6

ConnectToDbAsyncFunction · 0.45
SQL_TQueryFunction · 0.45
SQL_ExecuteTransactionFunction · 0.45
RunFrameMethod · 0.45
OnPluginWillUnloadMethod · 0.45

Calls 8

CreateLocalHandleFunction · 0.85
FormatMethod · 0.80
IsRunnableMethod · 0.80
PushCellMethod · 0.80
PushStringMethod · 0.80
FreeHandleMethod · 0.80
GetIdentityMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected