2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-05 19:45:33 +03:00

Fixed password checks

This commit is contained in:
WPMGPRoSToTeMa 2016-02-08 16:07:01 +03:00
parent 93e0f62373
commit 77de540208

View File

@ -2139,10 +2139,10 @@ int SV_CheckUserInfo(netadr_t *adr, char *userinfo, qboolean bIsReconnecting, in
if (!NET_IsLocalAddress(*adr)) if (!NET_IsLocalAddress(*adr))
{ {
if (sv_password.string[0] != 0 && Q_stricmp(sv_password.string, "none")) const char* password = Info_ValueForKey(userinfo, "password");
{
const char* password = Info_ValueForKey(userinfo, "password");
if (sv_password.string[0] != '\0' && Q_stricmp(sv_password.string, "none") && Q_strcmp(sv_password.string, password))
{
#ifdef REHLDS_FIXES #ifdef REHLDS_FIXES
if (password[0] == '\0') if (password[0] == '\0')
{ {
@ -2150,9 +2150,7 @@ int SV_CheckUserInfo(netadr_t *adr, char *userinfo, qboolean bIsReconnecting, in
SV_RejectConnection(adr, "No password set. Clean your userinfo.\n"); SV_RejectConnection(adr, "No password set. Clean your userinfo.\n");
} }
else else
#endif #endif // REHLDS_FIXES
if (Q_strcmp(sv_password.string, password))
{ {
Con_Printf("%s: password failed\n", NET_AdrToString(*adr)); Con_Printf("%s: password failed\n", NET_AdrToString(*adr));
SV_RejectConnectionForPassword(adr); SV_RejectConnectionForPassword(adr);