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

Method Update

src/engine/shared/network_console.cpp:116–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116void CNetConsole::Update()
117{
118 NETSOCKET Socket;
119 NETADDR Addr;
120 if(net_tcp_accept(m_Socket, &Socket, &Addr) > 0)
121 {
122 AcceptClient(Socket, &Addr);
123 }
124
125 for(int i = 0; i < NET_MAX_CONSOLE_CLIENTS; i++)
126 {
127 if(m_aSlots[i].m_Connection.State() == CConsoleNetConnection::EState::ONLINE)
128 m_aSlots[i].m_Connection.Update();
129 if(m_aSlots[i].m_Connection.State() == CConsoleNetConnection::EState::ERROR)
130 Drop(i, m_aSlots[i].m_Connection.ErrorString());
131 }
132}
133
134int CNetConsole::Recv(char *pLine, int MaxLength, int *pClientId)
135{

Callers

nothing calls this directly

Calls 3

net_tcp_acceptFunction · 0.85
StateMethod · 0.45
ErrorStringMethod · 0.45

Tested by

no test coverage detected