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

Method NewClientCallback

src/engine/shared/econ.cpp:13–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11}
12
13int CEcon::NewClientCallback(int ClientId, void *pUser)
14{
15 CEcon *pThis = (CEcon *)pUser;
16
17 char aAddrStr[NETADDR_MAXSTRSIZE];
18 net_addr_str(pThis->m_NetConsole.ClientAddr(ClientId), aAddrStr, sizeof(aAddrStr), true);
19 char aBuf[128];
20 str_format(aBuf, sizeof(aBuf), "client accepted. cid=%d addr=%s'", ClientId, aAddrStr);
21 pThis->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "econ", aBuf);
22
23 pThis->m_aClients[ClientId].m_State = CClient::STATE_CONNECTED;
24 pThis->m_aClients[ClientId].m_TimeConnected = time_get();
25 pThis->m_aClients[ClientId].m_AuthTries = 0;
26
27 pThis->m_NetConsole.Send(ClientId, "Enter password:");
28 return 0;
29}
30
31int CEcon::DelClientCallback(int ClientId, const char *pReason, void *pUser)
32{

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected