Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
3.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #if !defined( INETCHANNELINFO_H )
  14. #define INETCHANNELINFO_H
  15. #ifdef _WIN32
  16. #pragma once
  17. #endif
  18. #define FLOW_OUTGOING 0
  19. #define FLOW_INCOMING 1
  20. #define MAX_FLOWS 2 // in & out
  21. class INetChannelInfo
  22. {
  23. public:
  24. enum {
  25. GENERIC = 0, // must be first and is default group
  26. LOCALPLAYER, // bytes for local player entity update
  27. OTHERPLAYERS, // bytes for other players update
  28. ENTITIES, // all other entity bytes
  29. SOUNDS, // game sounds
  30. EVENTS, // event messages
  31. TEMPENTS, // temp entities
  32. USERMESSAGES, // user messages
  33. ENTMESSAGES, // entity messages
  34. VOICE, // voice data
  35. STRINGTABLE, // a stringtable update
  36. MOVE, // client move cmds
  37. STRINGCMD, // string command
  38. SIGNON, // various signondata
  39. PAINTMAP, // paintmap data
  40. ENCRYPTED, // encrypted data
  41. TOTAL, // must be last and is not a real group
  42. };
  43. enum ENetworkEventType_t
  44. {
  45. k_ENetworkEventType_Generic = 0, // Generic network event
  46. k_ENetworkEventType_TimedOut = 1, // Network connection timed out
  47. };
  48. virtual const char *GetName( void ) const = 0; // get channel name
  49. virtual const char *GetAddress( void ) const = 0; // get channel IP address as string
  50. virtual float GetTime( void ) const = 0; // current net time
  51. virtual float GetTimeConnected( void ) const = 0; // get connection time in seconds
  52. virtual int GetBufferSize( void ) const = 0; // netchannel packet history size
  53. virtual int GetDataRate( void ) const = 0; // send data rate in byte/sec
  54. virtual bool IsLoopback( void ) const = 0; // true if loopback channel
  55. virtual bool IsTimingOut( void ) const = 0; // true if timing out
  56. virtual bool IsPlayback( void ) const = 0; // true if demo playback
  57. virtual float GetLatency( int flow ) const = 0; // current latency (RTT), more accurate but jittering
  58. virtual float GetAvgLatency( int flow ) const = 0; // average packet latency in seconds
  59. virtual float GetAvgLoss( int flow ) const = 0; // avg packet loss[0..1]
  60. virtual float GetAvgChoke( int flow ) const = 0; // avg packet choke[0..1]
  61. virtual float GetAvgData( int flow ) const = 0; // data flow in bytes/sec
  62. virtual float GetAvgPackets( int flow ) const = 0; // avg packets/sec
  63. virtual int GetTotalData( int flow ) const = 0; // total flow in/out in bytes
  64. virtual int GetTotalPackets( int flow ) const = 0;
  65. virtual int GetSequenceNr( int flow ) const = 0; // last send seq number
  66. virtual bool IsValidPacket( int flow, int frame_number ) const = 0; // true if packet was not lost/dropped/chocked/flushed
  67. virtual float GetPacketTime( int flow, int frame_number ) const = 0; // time when packet was send
  68. virtual int GetPacketBytes( int flow, int frame_number, int group ) const = 0; // group size of this packet
  69. virtual bool GetStreamProgress( int flow, int *received, int *total ) const = 0; // TCP progress if transmitting
  70. virtual float GetTimeSinceLastReceived( void ) const = 0; // get time since last recieved packet in seconds
  71. virtual float GetCommandInterpolationAmount( int flow, int frame_number ) const = 0;
  72. virtual void GetPacketResponseLatency( int flow, int frame_number, int *pnLatencyMsecs, int *pnChoke ) const = 0;
  73. virtual void GetRemoteFramerate( float *pflFrameTime, float *pflFrameTimeStdDeviation, float *pflFrameStartTimeStdDeviation ) const = 0;
  74. virtual float GetTimeoutSeconds() const = 0;
  75. };
  76. #endif // INETCHANNELINFO_H