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

Method Kick

src/engine/server/server.cpp:495–514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493}
494
495void CServer::Kick(int ClientId, const char *pReason)
496{
497 if(ClientId < 0 || ClientId >= MAX_CLIENTS || m_aClients[ClientId].m_State == CClient::STATE_EMPTY)
498 {
499 Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", "invalid client id to kick");
500 return;
501 }
502 else if(m_RconClientId == ClientId)
503 {
504 Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", "you can't kick yourself");
505 return;
506 }
507 else if(GetAuthedState(ClientId) > m_RconAuthLevel)
508 {
509 Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", "kick command denied");
510 return;
511 }
512
513 m_NetServer.Drop(ClientId, pReason);
514}
515
516void CServer::Ban(int ClientId, int Seconds, const char *pReason, bool VerbatimReason)
517{

Callers 4

DoActivityCheckMethod · 0.45
OnClientDirectInputMethod · 0.45
ConKickMethod · 0.45

Calls 2

PrintMethod · 0.45
DropMethod · 0.45

Tested by

no test coverage detected