| 4221 | } |
| 4222 | |
| 4223 | void CServer::ConchainRconPasswordChangeGeneric(const char *pRoleName, const char *pCurrent, IConsole::IResult *pResult) |
| 4224 | { |
| 4225 | if(pResult->NumArguments() == 1) |
| 4226 | { |
| 4227 | int KeySlot = m_AuthManager.DefaultKey(pRoleName); |
| 4228 | const char *pNew = pResult->GetString(0); |
| 4229 | if(str_comp(pCurrent, pNew) == 0) |
| 4230 | { |
| 4231 | return; |
| 4232 | } |
| 4233 | if(KeySlot == -1 && pNew[0]) |
| 4234 | { |
| 4235 | m_AuthManager.AddDefaultKey(pRoleName, pNew); |
| 4236 | } |
| 4237 | else if(KeySlot >= 0) |
| 4238 | { |
| 4239 | if(!pNew[0]) |
| 4240 | { |
| 4241 | AuthRemoveKey(KeySlot); |
| 4242 | // Already logs users out. |
| 4243 | } |
| 4244 | else |
| 4245 | { |
| 4246 | m_AuthManager.UpdateKey(KeySlot, pNew, pRoleName); |
| 4247 | LogoutKey(KeySlot, "key update"); |
| 4248 | } |
| 4249 | } |
| 4250 | } |
| 4251 | } |
| 4252 | |
| 4253 | void CServer::ConchainRconPasswordChange(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData) |
| 4254 | { |
no test coverage detected