mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-16 00:28:20 +03:00
Merge pull request #413 from dreamstalker/fixes201703194
Use TYPE_xxx defines for *hltv values.
This commit is contained in:
commit
c4d0210615
@ -2011,7 +2011,7 @@ int EXT_FUNC SV_FinishCertificateCheck_internal(netadr_t *adr, int nAuthProtocol
|
|||||||
|
|
||||||
const char *val = Info_ValueForKey(userinfo, "*hltv");
|
const char *val = Info_ValueForKey(userinfo, "*hltv");
|
||||||
|
|
||||||
if (val[0] == 0 || Q_atoi(val) != 1)
|
if (val[0] == 0 || Q_atoi(val) != TYPE_PROXY)
|
||||||
{
|
{
|
||||||
SV_RejectConnection(adr, "Invalid CD Key.\n");
|
SV_RejectConnection(adr, "Invalid CD Key.\n");
|
||||||
return 0;
|
return 0;
|
||||||
@ -2254,10 +2254,10 @@ int SV_CheckUserInfo(netadr_t *adr, char *userinfo, qboolean bIsReconnecting, in
|
|||||||
|
|
||||||
switch (Q_atoi(s))
|
switch (Q_atoi(s))
|
||||||
{
|
{
|
||||||
case 0:
|
case TYPE_CLIENT:
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case 1:
|
case TYPE_PROXY:
|
||||||
SV_CountProxies(&proxies);
|
SV_CountProxies(&proxies);
|
||||||
if (proxies >= sv_proxies.value && !bIsReconnecting)
|
if (proxies >= sv_proxies.value && !bIsReconnecting)
|
||||||
{
|
{
|
||||||
@ -2266,7 +2266,7 @@ int SV_CheckUserInfo(netadr_t *adr, char *userinfo, qboolean bIsReconnecting, in
|
|||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case 3:
|
case TYPE_COMMENTATOR:
|
||||||
SV_RejectConnection(adr, "Please connect to HLTV master proxy.\n");
|
SV_RejectConnection(adr, "Please connect to HLTV master proxy.\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -2470,7 +2470,7 @@ void EXT_FUNC SV_ConnectClient_internal(void)
|
|||||||
SV_RejectConnection(&adr, "Invalid validation type\n");
|
SV_RejectConnection(&adr, "Invalid validation type\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Q_atoi(val) != 1)
|
if (Q_atoi(val) != TYPE_PROXY)
|
||||||
{
|
{
|
||||||
SV_RejectConnection(&adr, "Invalid validation type\n");
|
SV_RejectConnection(&adr, "Invalid validation type\n");
|
||||||
return;
|
return;
|
||||||
@ -5051,7 +5051,7 @@ void SV_ExtractFromUserinfo(client_t *cl)
|
|||||||
cl->lc = val[0] != 0 ? Q_atoi(val) != 0 : 0;
|
cl->lc = val[0] != 0 ? Q_atoi(val) != 0 : 0;
|
||||||
|
|
||||||
val = Info_ValueForKey(userinfo, "*hltv");
|
val = Info_ValueForKey(userinfo, "*hltv");
|
||||||
cl->proxy = val[0] != 0 ? Q_atoi(val) == 1 : 0;
|
cl->proxy = val[0] != 0 ? Q_atoi(val) == TYPE_PROXY : 0;
|
||||||
|
|
||||||
SV_CheckUpdateRate(&cl->next_messageinterval);
|
SV_CheckUpdateRate(&cl->next_messageinterval);
|
||||||
SV_CheckRate(cl);
|
SV_CheckRate(cl);
|
||||||
|
@ -59,3 +59,4 @@
|
|||||||
#include "rehlds_security.h"
|
#include "rehlds_security.h"
|
||||||
|
|
||||||
#include "dlls/cdll_dll.h"
|
#include "dlls/cdll_dll.h"
|
||||||
|
#include "hltv.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user