From 12efcf1c443c3af4e29ec8a610feb87edc7116ac Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 3 Apr 2023 03:13:50 +0300 Subject: [PATCH] engine: network: remove some totally ununsed functions --- engine/common/net_chan.c | 15 ---------- engine/common/net_ws.c | 62 ---------------------------------------- engine/common/net_ws.h | 2 -- engine/common/netchan.h | 1 - 4 files changed, 80 deletions(-) diff --git a/engine/common/net_chan.c b/engine/common/net_chan.c index d75d226f..2f093f3d 100644 --- a/engine/common/net_chan.c +++ b/engine/common/net_chan.c @@ -1711,21 +1711,6 @@ void Netchan_TransmitBits( netchan_t *chan, int length, byte *data ) } } -/* -=============== -Netchan_Transmit - -tries to send an unreliable message to a connection, and handles the -transmition / retransmition of the reliable messages. - -A 0 length will still generate a packet and deal with the reliable messages. -================ -*/ -void Netchan_Transmit( netchan_t *chan, int lengthInBytes, byte *data ) -{ - Netchan_TransmitBits( chan, lengthInBytes << 3, data ); -} - /* ================= Netchan_Process diff --git a/engine/common/net_ws.c b/engine/common/net_ws.c index e6ff7134..a9929516 100644 --- a/engine/common/net_ws.c +++ b/engine/common/net_ws.c @@ -1681,68 +1681,6 @@ void NET_SendPacket( netsrc_t sock, size_t length, const void *data, netadr_t to NET_SendPacketEx( sock, length, data, to, 0 ); } -/* -==================== -NET_BufferToBufferCompress - -generic fast compression -==================== -*/ -qboolean NET_BufferToBufferCompress( byte *dest, uint *destLen, byte *source, uint sourceLen ) -{ - uint uCompressedLen = 0; - byte *pbOut = NULL; - - memcpy( dest, source, sourceLen ); - pbOut = LZSS_Compress( source, sourceLen, &uCompressedLen ); - - if( pbOut && uCompressedLen > 0 && uCompressedLen <= *destLen ) - { - memcpy( dest, pbOut, uCompressedLen ); - *destLen = uCompressedLen; - free( pbOut ); - return true; - } - else - { - if( pbOut ) free( pbOut ); - memcpy( dest, source, sourceLen ); - *destLen = sourceLen; - return false; - } -} - -/* -==================== -NET_BufferToBufferDecompress - -generic fast decompression -==================== -*/ -qboolean NET_BufferToBufferDecompress( byte *dest, uint *destLen, byte *source, uint sourceLen ) -{ - if( LZSS_IsCompressed( source )) - { - uint uDecompressedLen = LZSS_GetActualSize( source ); - - if( uDecompressedLen <= *destLen ) - { - *destLen = LZSS_Decompress( source, dest ); - } - else - { - return false; - } - } - else - { - memcpy( dest, source, sourceLen ); - *destLen = sourceLen; - } - - return true; -} - /* ==================== NET_IPSocket diff --git a/engine/common/net_ws.h b/engine/common/net_ws.h index d45db4fb..effd597a 100644 --- a/engine/common/net_ws.h +++ b/engine/common/net_ws.h @@ -72,8 +72,6 @@ qboolean NET_CompareAdr( const netadr_t a, const netadr_t b ); qboolean NET_CompareBaseAdr( const netadr_t a, const netadr_t b ); qboolean NET_CompareAdrByMask( const netadr_t a, const netadr_t b, uint prefixlen ); qboolean NET_GetPacket( netsrc_t sock, netadr_t *from, byte *data, size_t *length ); -qboolean NET_BufferToBufferCompress( byte *dest, uint *destLen, byte *source, uint sourceLen ); -qboolean NET_BufferToBufferDecompress( byte *dest, uint *destLen, byte *source, uint sourceLen ); void NET_SendPacket( netsrc_t sock, size_t length, const void *data, netadr_t to ); void NET_SendPacketEx( netsrc_t sock, size_t length, const void *data, netadr_t to, size_t splitsize ); void NET_ClearLagData( qboolean bClient, qboolean bServer ); diff --git a/engine/common/netchan.h b/engine/common/netchan.h index 3acc28bb..6a283803 100644 --- a/engine/common/netchan.h +++ b/engine/common/netchan.h @@ -294,7 +294,6 @@ qboolean Netchan_CopyNormalFragments( netchan_t *chan, sizebuf_t *msg, size_t *l qboolean Netchan_CopyFileFragments( netchan_t *chan, sizebuf_t *msg ); void Netchan_CreateFragments( netchan_t *chan, sizebuf_t *msg ); int Netchan_CreateFileFragments( netchan_t *chan, const char *filename ); -void Netchan_Transmit( netchan_t *chan, int lengthInBytes, byte *data ); void Netchan_TransmitBits( netchan_t *chan, int lengthInBits, byte *data ); void Netchan_OutOfBand( int net_socket, netadr_t adr, int length, byte *data ); void Netchan_OutOfBandPrint( int net_socket, netadr_t adr, const char *format, ... ) _format( 3 );