Skip to content

Commit

Permalink
Fix unit-test
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Jan 17, 2024
1 parent 62407e0 commit 355172d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 41 deletions.
2 changes: 0 additions & 2 deletions rehlds/engine/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ typedef struct ipfilter_s
} compare;
float banEndTime;
float banTime;
#ifdef REHLDS_FIXES
int cidr;
#endif // REHLDS_FIXES
} ipfilter_t;

typedef struct userfilter_s
Expand Down
39 changes: 0 additions & 39 deletions rehlds/engine/sv_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6553,7 +6553,6 @@ int EXT_FUNC RegUserMsg(const char *pszName, int iSize)
return pNewMsg->iMsg;
}

#ifdef REHLDS_FIXES
uint32_t CIDRToMask(int cidr)
{
return htonl(0xFFFFFFFFull << (32 - cidr));
Expand Down Expand Up @@ -6703,44 +6702,6 @@ qboolean StringToFilter(const char *s, ipfilter_t *f)

return true;
}
#else // REHLDS_FIXES
qboolean StringToFilter(const char *s, ipfilter_t *f)
{
char num[128];
unsigned char b[4] = { 0, 0, 0, 0 };
unsigned char m[4] = { 0, 0, 0, 0 };

const char* cc = s;
int i = 0;
while (1)
{
if (*cc < '0' || *cc > '9')
break;

int j = 0;
while (*cc >= '0' && *cc <= '9')
num[j++] = *(cc++);

num[j] = 0;
b[i] = Q_atoi(num);
if (b[i])
m[i] = -1;

if (*cc)
{
++cc;
++i;
if (i < 4)
continue;
}
f->mask = *(uint32 *)m;
f->compare.u32 = *(uint32 *)b;
return TRUE;
}
Con_Printf("Bad filter address: %s\n", cc);
return FALSE;
}
#endif // REHLDS_FIXES

USERID_t *SV_StringToUserID(const char *str)
{
Expand Down

0 comments on commit 355172d

Please sign in to comment.