mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-05 19:45:33 +03:00
Added a message when connected to a password-protected server without a password
This commit is contained in:
parent
67a4fed2f6
commit
9aaaafb078
@ -2133,10 +2133,24 @@ 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") && Q_strcmp(sv_password.string, Info_ValueForKey(userinfo, "password")))
|
if (sv_password.string[0] != 0 && Q_stricmp(sv_password.string, "none"))
|
||||||
{
|
{
|
||||||
Con_Printf("%s: password failed\n", NET_AdrToString(*adr));
|
const char* password = Info_ValueForKey(userinfo, "password");
|
||||||
SV_RejectConnectionForPassword(adr);
|
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
if (password[0] == '\0')
|
||||||
|
{
|
||||||
|
Con_Printf("%s: connect without password\n", NET_AdrToString(*adr));
|
||||||
|
SV_RejectConnection(adr, "No password set. Clean your userinfo.\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (Q_strcmp(sv_password.string, password))
|
||||||
|
{
|
||||||
|
Con_Printf("%s: password failed\n", NET_AdrToString(*adr));
|
||||||
|
SV_RejectConnectionForPassword(adr);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user