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

Method AddDefaultKey

src/engine/server/authmanager.cpp:205–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205void CAuthManager::AddDefaultKey(const char *pRoleName, const char *pPw)
206{
207 int Level = RoleNameToAuthLevel(pRoleName);
208 dbg_assert(AUTHED_HELPER <= Level && Level <= AUTHED_ADMIN, "default role with name '%s' not found.", pRoleName);
209
210 static const char s_aaIdents[3][sizeof(HELPER_IDENT)] = {ADMIN_IDENT, MOD_IDENT, HELPER_IDENT};
211 int Index = AUTHED_ADMIN - Level;
212 if(m_aDefault[Index] >= 0)
213 return; // already exists
214 m_aDefault[Index] = AddKey(s_aaIdents[Index], pPw, AuthLevelToRoleName(Level));
215}
216
217bool CAuthManager::IsGenerated() const
218{

Callers 1

Calls 1

RoleNameToAuthLevelFunction · 0.85

Tested by

no test coverage detected