Browse Source

engine: network: remove some totally ununsed functions

pull/2/head
Alibek Omarov 2 years ago
parent
commit
12efcf1c44
  1. 15
      engine/common/net_chan.c
  2. 62
      engine/common/net_ws.c
  3. 2
      engine/common/net_ws.h
  4. 1
      engine/common/netchan.h

15
engine/common/net_chan.c

@ -1711,21 +1711,6 @@ void Netchan_TransmitBits( netchan_t *chan, int length, byte *data ) @@ -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

62
engine/common/net_ws.c

@ -1681,68 +1681,6 @@ void NET_SendPacket( netsrc_t sock, size_t length, const void *data, netadr_t to @@ -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

2
engine/common/net_ws.h

@ -72,8 +72,6 @@ qboolean NET_CompareAdr( const netadr_t a, const netadr_t b ); @@ -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 );

1
engine/common/netchan.h

@ -294,7 +294,6 @@ qboolean Netchan_CopyNormalFragments( netchan_t *chan, sizebuf_t *msg, size_t *l @@ -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 );

Loading…
Cancel
Save