2758: Remove the rudimentary fuzzing since no one uses it anyway r=heinrich5991 a=def-



2769: Update front.png by Soreu r=heinrich5991 a=def-



2772: Dont predict camera position on spectator changed r=heinrich5991 a=BannZay

No reason to predict camera position in case when we just changed spectator.
But tbh I have not found a big reason to predict it at all.

Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: Andrii <bannzay3@gmail.com>
This commit is contained in:
bors[bot] 2020-09-06 23:25:16 +00:00 committed by GitHub
commit cbc272fd5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 1 additions and 54 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

After

Width:  |  Height:  |  Size: 294 KiB

View file

@ -68,12 +68,6 @@
extern "C" {
#endif
#ifdef FUZZING
static unsigned char gs_NetData[1024];
static int gs_NetPosition = 0;
static int gs_NetSize = 0;
#endif
IOHANDLE io_stdin() { return (IOHANDLE)stdin; }
IOHANDLE io_stdout() { return (IOHANDLE)stdout; }
IOHANDLE io_stderr() { return (IOHANDLE)stderr; }
@ -1475,21 +1469,12 @@ NETSOCKET net_udp_create(NETADDR bindaddr)
/* set non-blocking */
net_set_non_blocking(sock);
#ifdef FUZZING
IOHANDLE file = io_open("bar.txt", IOFLAG_READ);
gs_NetPosition = 0;
gs_NetSize = io_length(file);
io_read(file, gs_NetData, 1024);
io_close(file);
#endif /* FUZZING */
/* return */
return sock;
}
int net_udp_send(NETSOCKET sock, const NETADDR *addr, const void *data, int size)
{
#ifndef FUZZING
int d = -1;
if(addr->type&NETTYPE_IPV4)
@ -1564,9 +1549,6 @@ int net_udp_send(NETSOCKET sock, const NETADDR *addr, const void *data, int size
network_stats.sent_bytes += size;
network_stats.sent_packets++;
return d;
#else
return size;
#endif /* FUZZING */
}
void net_init_mmsgs(MMSGS* m)
@ -1592,7 +1574,6 @@ void net_init_mmsgs(MMSGS* m)
int net_udp_recv(NETSOCKET sock, NETADDR *addr, void *buffer, int maxsize, MMSGS* m, unsigned char **data)
{
#ifndef FUZZING
char sockaddrbuf[128];
int bytes = 0;
@ -1663,34 +1644,6 @@ int net_udp_recv(NETSOCKET sock, NETADDR *addr, void *buffer, int maxsize, MMSGS
else if(bytes == 0)
return 0;
return -1; /* error */
#else /* ifdef FUZZING */
addr->type = NETTYPE_IPV4;
addr->port = 11111;
addr->ip[0] = 127;
addr->ip[1] = 0;
addr->ip[2] = 0;
addr->ip[3] = 1;
int CurrentData = 0;
while (gs_NetPosition < gs_NetSize && CurrentData < maxsize)
{
if(gs_NetData[gs_NetPosition] == '\n')
{
gs_NetPosition++;
break;
}
((unsigned char*)buffer)[CurrentData] = gs_NetData[gs_NetPosition];
*data = buffer;
CurrentData++;
gs_NetPosition++;
}
if (gs_NetPosition >= gs_NetSize)
exit(0);
return CurrentData;
#endif /* FUZZING */
}
int net_udp_close(NETSOCKET sock)

View file

@ -145,14 +145,12 @@ void CNetBase::SendPacket(NETSOCKET Socket, NETADDR *pAddr, CNetPacketConstruct
CompressedSize = ms_Huffman.Compress(pPacket->m_aChunkData, pPacket->m_DataSize, &aBuffer[HeaderSize], NET_MAX_PACKETSIZE-HeaderSize);
// check if the compression was enabled, successful and good enough
#ifndef FUZZING
if(!NoCompress && CompressedSize > 0 && CompressedSize < pPacket->m_DataSize)
{
FinalSize = CompressedSize;
pPacket->m_Flags |= NET_PACKETFLAG_COMPRESSION;
}
else
#endif
{
// use uncompressed data
FinalSize = pPacket->m_DataSize;
@ -430,7 +428,5 @@ static const unsigned gs_aFreqTable[256+1] = {
void CNetBase::Init()
{
#ifndef FUZZING
ms_Huffman.Init(gs_aFreqTable);
#endif
}

View file

@ -318,10 +318,8 @@ int CNetConnection::Feed(CNetPacketConstruct *pPacket, NETADDR *pAddr, SECURITY_
{
if(CtrlMsg == NET_CTRLMSG_CONNECT)
{
#ifndef FUZZING
if(net_addr_comp_noport(&m_PeerAddr, pAddr) == 0 && time_get() - m_LastUpdateTime < time_freq() * 3)
return 0;
#endif
// send response and init connection
Reset();

View file

@ -585,7 +585,7 @@ void CGameClient::UpdatePositions()
}
else if(m_Snap.m_pSpectatorInfo && ((Client()->State() == IClient::STATE_DEMOPLAYBACK && m_DemoSpecID == SPEC_FOLLOW) || (Client()->State() != IClient::STATE_DEMOPLAYBACK && m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW)))
{
if(m_Snap.m_pPrevSpectatorInfo)
if(m_Snap.m_pPrevSpectatorInfo && m_Snap.m_pPrevSpectatorInfo->m_SpectatorID == m_Snap.m_pSpectatorInfo->m_SpectatorID)
m_Snap.m_SpecInfo.m_Position = mix(vec2(m_Snap.m_pPrevSpectatorInfo->m_X, m_Snap.m_pPrevSpectatorInfo->m_Y),
vec2(m_Snap.m_pSpectatorInfo->m_X, m_Snap.m_pSpectatorInfo->m_Y), Client()->IntraGameTick(g_Config.m_ClDummy));
else