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

Method ConAuthRemove

src/engine/server/server.cpp:3784–3804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3782}
3783
3784void CServer::ConAuthRemove(IConsole::IResult *pResult, void *pUser)
3785{
3786 CServer *pThis = (CServer *)pUser;
3787 CAuthManager *pManager = &pThis->m_AuthManager;
3788
3789 const char *pIdent = pResult->GetString(0);
3790
3791 int KeySlot = pManager->FindKey(pIdent);
3792 if(KeySlot == -1)
3793 {
3794 pThis->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "auth", "ident couldn't be found");
3795 return;
3796 }
3797
3798 pThis->AuthRemoveKey(KeySlot);
3799
3800 if(!pManager->NumNonDefaultKeys())
3801 pThis->SendRconType(-1, false);
3802
3803 pThis->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "auth", "key removed, all users logged out");
3804}
3805
3806static void ListKeysCallback(const char *pIdent, const char *pRoleName, void *pUser)
3807{

Callers

nothing calls this directly

Calls 7

FindKeyMethod · 0.80
AuthRemoveKeyMethod · 0.80
NumNonDefaultKeysMethod · 0.80
SendRconTypeMethod · 0.80
GetStringMethod · 0.45
PrintMethod · 0.45
ConsoleMethod · 0.45

Tested by

no test coverage detected