MCPcopy Create free account
hub / github.com/cppla/ServerStatus / NewClientCallback

Method NewClientCallback

server/src/server.cpp:7–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include "server.h"
6
7int CServer::NewClientCallback(int ClientID, void *pUser)
8{
9 CServer *pThis = (CServer *)pUser;
10
11 char aAddrStr[NETADDR_MAXSTRSIZE];
12 net_addr_str(pThis->m_Network.ClientAddr(ClientID), aAddrStr, sizeof(aAddrStr), true);
13 if(pThis->Main()->Config()->m_Verbose)
14 dbg_msg("server", "Connection accepted. ncid=%d addr=%s'", ClientID, aAddrStr);
15
16 pThis->m_aClients[ClientID].m_State = CClient::STATE_CONNECTED;
17 pThis->m_aClients[ClientID].m_TimeConnected = time_get();
18 pThis->m_Network.Send(ClientID, "Authentication required:");
19
20 return 0;
21}
22
23int CServer::DelClientCallback(int ClientID, const char *pReason, void *pUser)
24{

Callers

nothing calls this directly

Calls 7

net_addr_strFunction · 0.85
dbg_msgFunction · 0.85
time_getFunction · 0.85
ClientAddrMethod · 0.80
ConfigMethod · 0.80
MainMethod · 0.80
SendMethod · 0.45

Tested by

no test coverage detected