MCPcopy Create free account
hub / github.com/ddnet/ddnet / DelClientCallback

Method DelClientCallback

src/engine/shared/econ.cpp:31–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31int CEcon::DelClientCallback(int ClientId, const char *pReason, void *pUser)
32{
33 CEcon *pThis = (CEcon *)pUser;
34
35 char aAddrStr[NETADDR_MAXSTRSIZE];
36 net_addr_str(pThis->m_NetConsole.ClientAddr(ClientId), aAddrStr, sizeof(aAddrStr), true);
37 char aBuf[256];
38 str_format(aBuf, sizeof(aBuf), "client dropped. cid=%d addr=%s reason='%s'", ClientId, aAddrStr, pReason);
39 pThis->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "econ", aBuf);
40
41 pThis->m_aClients[ClientId].m_State = CClient::STATE_EMPTY;
42 return 0;
43}
44
45void CEcon::ConLogout(IConsole::IResult *pResult, void *pUserData)
46{

Callers

nothing calls this directly

Calls 5

net_addr_strFunction · 0.85
str_formatFunction · 0.85
ClientAddrMethod · 0.45
PrintMethod · 0.45
ConsoleMethod · 0.45

Tested by

no test coverage detected