mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 20:16:10 +08:00
Update INetChannelInfo for latest updates and other cleanup.
This commit is contained in:
@ -38,6 +38,12 @@ typedef struct netpacket_s
|
||||
} netpacket_t;
|
||||
#endif // NET_PACKET_ST_DEFINED
|
||||
|
||||
enum ENetChannelBufType
|
||||
{
|
||||
BUF_RELIABLE = 0,
|
||||
BUF_UNRELIABLE,
|
||||
BUF_VOICE,
|
||||
};
|
||||
|
||||
abstract_class INetChannel : public INetChannelInfo
|
||||
{
|
||||
@ -52,9 +58,9 @@ public:
|
||||
|
||||
virtual void Reset( void ) = 0;
|
||||
virtual void Clear( void ) = 0;
|
||||
virtual void Shutdown(const char *reason) = 0;
|
||||
virtual void Shutdown(/* ENetworkDisconnectionReason */ int reason) = 0;
|
||||
|
||||
virtual bool ProcessDemoStream( struct netpacket_s* packet ) = 0;
|
||||
virtual bool ProcessDemoPacket( struct netpacket_s* packet ) = 0;
|
||||
virtual void ProcessPacket( struct netpacket_s* packet, bool bHasHeader ) = 0;
|
||||
|
||||
virtual bool SendNetMsg(INetMessage &msg, bool bForceReliable = false, bool bVoice = false ) = 0;
|
||||
@ -87,10 +93,10 @@ public:
|
||||
virtual void SetCompressionMode( bool bUseCompression ) = 0;
|
||||
virtual unsigned int RequestFile(const char *filename, bool isReplayDemoFile) = 0;
|
||||
|
||||
virtual void SetMaxBufferSize(bool bReliable, int nBytes, bool bVoice = false ) = 0;
|
||||
virtual void SetMaxBufferSize( ENetChannelBufType bufferType, int nBytes ) = 0;
|
||||
|
||||
virtual bool IsNull() const = 0;
|
||||
virtual void SetInterpolationAmount( float flInterpolationAmount, float ) = 0;
|
||||
virtual void SetInterpolationAmount( float flInterpolationAmount ) = 0;
|
||||
virtual void SetRemoteFramerate( float flFrameTime, float flFrameTimeStdDeviation ) = 0;
|
||||
|
||||
// Max # of payload bytes before we must split/fragment the packet
|
||||
@ -104,11 +110,11 @@ public:
|
||||
|
||||
virtual bool IsRemoteDisconnected() const = 0;
|
||||
|
||||
virtual int GetNumBitsWritten(int bufferType) = 0;
|
||||
virtual int GetNumBitsWritten(ENetChannelBufType bufferType) const = 0;
|
||||
|
||||
virtual void SetUsesMaxRoutablePlayload(bool useMax) = 0;
|
||||
|
||||
virtual bool WasLastMessageReliable() = 0;
|
||||
virtual bool WasLastMessageReliable() const = 0;
|
||||
};
|
||||
|
||||
|
||||
|
@ -51,6 +51,7 @@ public:
|
||||
virtual int GetDataRate( void ) const = 0; // send data rate in byte/sec
|
||||
|
||||
virtual bool IsLoopback( void ) const = 0; // true if loopback channel
|
||||
virtual bool IsLocalhost( void ) const = 0; // true if localhost
|
||||
virtual bool IsTimingOut( void ) const = 0; // true if timing out
|
||||
|
||||
virtual float GetLatency( int flow ) const = 0; // current latency (RTT), more accurate but jittering
|
||||
|
@ -26,9 +26,9 @@ public:
|
||||
|
||||
virtual void ConnectionStart(INetChannel *chan) = 0; // called first time network channel is established
|
||||
|
||||
virtual void ConnectionClosing(const char *reason) = 0; // network channel is being closed by remote site
|
||||
virtual void ConnectionClosing(/* ENetworkDisconnectionReason */ int reason) = 0; // network channel is being closed by remote site
|
||||
|
||||
virtual void ConnectionCrashed(const char *reason) = 0; // network error occured
|
||||
virtual void ConnectionCrashed(/* ENetworkDisconnectionReason */ int reason) = 0; // network error occured
|
||||
|
||||
virtual void PacketStart(int incoming_sequence, int outgoing_acknowledged) = 0; // called each time a new packet arrived
|
||||
|
||||
|
Reference in New Issue
Block a user