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

Method OnClientDisconnected

core/ConVarManager.cpp:246–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246void ConVarManager::OnClientDisconnected(int client)
247{
248 /* Remove convar queries for this client that haven't returned results yet */
249 for (List<ConVarQuery>::iterator iter = m_ConVarQueries.begin(); iter != m_ConVarQueries.end();)
250 {
251 ConVarQuery &query = (*iter);
252 if (query.client == client)
253 {
254 IPluginFunction *pCallback = query.pCallback;
255 if (pCallback)
256 {
257 cell_t ret;
258
259 pCallback->PushCell(query.cookie);
260 pCallback->PushCell(client);
261 pCallback->PushCell(eQueryCvarValueStatus_Cancelled);
262 pCallback->PushString("");
263 pCallback->PushString("");
264 pCallback->PushCell(query.value);
265 pCallback->Execute(&ret);
266 }
267 iter = m_ConVarQueries.erase(iter);
268 continue;
269 }
270
271 ++iter;
272 }
273}
274
275void ConVarManager::OnHandleDestroy(HandleType_t type, void *object)
276{

Callers

nothing calls this directly

Calls 6

PushCellMethod · 0.80
PushStringMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
ExecuteMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected