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.

71 lines
2.5 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. // protocol.h -- communications protocols
  9. #ifndef PROTOCOL_H
  10. #define PROTOCOL_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. #define INSTANCE_BASELINE_TABLENAME "instancebaseline"
  15. #define LIGHT_STYLES_TABLENAME "lightstyles"
  16. #define USER_INFO_TABLENAME "userinfo"
  17. #define SERVER_STARTUP_DATA_TABLENAME "server_query_info" // the name is a remnant...
  18. #define DYNAMIC_MODEL_TABLENAME "dynamicmodel"
  19. //#define CURRENT_PROTOCOL 1
  20. #define DELTA_OFFSET_BITS 5
  21. #define DELTA_OFFSET_MAX ( ( 1 << DELTA_OFFSET_BITS ) - 1 )
  22. #define DELTASIZE_BITS 20 // must be: 2^DELTASIZE_BITS > (NET_MAX_PAYLOAD * 8)
  23. // Largest # of commands to send in a packet
  24. #define NUM_NEW_COMMAND_BITS 4
  25. #define MAX_NEW_COMMANDS ((1 << NUM_NEW_COMMAND_BITS)-1)
  26. // Max number of history commands to send ( 2 by default ) in case of dropped packets
  27. #define NUM_BACKUP_COMMAND_BITS 3
  28. #define MAX_BACKUP_COMMANDS ((1 << NUM_BACKUP_COMMAND_BITS)-1)
  29. #define PROTOCOL_AUTHCERTIFICATE 0x01 // Connection from client is using a WON authenticated certificate
  30. #define PROTOCOL_HASHEDCDKEY 0x02 // Connection from client is using hashed CD key because WON comm. channel was unreachable
  31. #define PROTOCOL_STEAM 0x03 // Steam certificates
  32. #define PROTOCOL_LASTVALID 0x03 // Last valid protocol
  33. #define CONNECTIONLESS_HEADER 0xFFFFFFFF // all OOB packet start with this sequence
  34. #define STEAM_KEYSIZE 2048 // max size needed to contain a steam authentication key (both server and client)
  35. // each channel packet has 1 byte of FLAG bits
  36. #define PACKET_FLAG_RELIABLE (1<<0) // packet contains subchannel stream data
  37. #define PACKET_FLAG_COMPRESSED (1<<1) // packet is compressed
  38. #define PACKET_FLAG_ENCRYPTED (1<<2) // packet is encrypted
  39. #define PACKET_FLAG_SPLIT (1<<3) // packet is split
  40. #define PACKET_FLAG_CHOKED (1<<4) // packet was choked by sender
  41. // NOTE: Bits 5, 6, and 7 are used to specify the # of padding bits at the end of the packet!!!
  42. #define ENCODE_PAD_BITS( x ) ( ( x << 5 ) & 0xff )
  43. #define DECODE_PAD_BITS( x ) ( ( x >> 5 ) & 0xff )
  44. //
  45. // client to server
  46. //
  47. #define RES_FATALIFMISSING (1<<0) // Disconnect if we can't get this file.
  48. #define RES_PRELOAD (1<<1) // Load on client rather than just reserving name
  49. // Some day we may want to integrate Zoid's CL 1295766 - Rewrite of Source networking to be protobuf based.
  50. #endif // PROTOCOL_H