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.

189 lines
8.1 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #if !defined( PROTO_OOB_H )
  9. #define PROTO_OOB_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. // This is used, unless overridden in the registry
  14. #define VALVE_MASTER_ADDRESS "207.173.177.10:27011"
  15. #define PORT_RCON 27015 // Default RCON port, TCP
  16. #define PORT_MASTER 27011 // Default master port, UDP
  17. #define PORT_CLIENT 27005 // Default client port, UDP/TCP
  18. #define PORT_SERVER 27015 // Default server port, UDP/TCP
  19. #define PORT_HLTV 27020 // Default hltv port
  20. #define PORT_HLTV1 27021 // Default hltv[instance 1] port
  21. #define PORT_X360_RESERVED_FIRST 27026 // X360 reserved port first
  22. #define PORT_X360_RESERVED_LAST 27034 // X360 reserved port last
  23. #ifdef ENABLE_RPT
  24. #define PORT_RPT 27035 // default RPT (remote perf testing) port, TCP
  25. #define PORT_RPT_LISTEN 27036 // RPT connection listener (remote perf testing) port, TCP
  26. #endif // ENABLE_RPT
  27. #define PORT_REPLAY 27040 // Default replay port
  28. // out of band message id bytes
  29. // M = master, S = server, C = client, A = any
  30. // the second character will always be \n if the message isn't a single
  31. // byte long (?? not true anymore?)
  32. // Requesting for full server list from Server Master
  33. #define A2M_GET_SERVERS 'c' // no params
  34. // Master response with full server list
  35. #define M2A_SERVERS 'd' // + 6 byte IP/Port list.
  36. // Request for full server list from Server Master done in batches
  37. #define A2M_GET_SERVERS_BATCH 'e' // + in532 uniqueID ( -1 for first batch )
  38. // Master response with server list for channel
  39. #define M2A_SERVER_BATCH 'f' // + int32 next uniqueID( -1 for last batch ) + 6 byte IP/Port list.
  40. // Request for MOTD from Server Master (Message of the Day)
  41. #define A2M_GET_MOTD 'g' // no params
  42. // MOTD response Server Master
  43. #define M2A_MOTD 'h' // + string
  44. // Generic Ping Request
  45. #define A2A_PING 'i' // respond with an A2A_ACK
  46. // Generic Ack
  47. #define A2A_ACK 'j' // general acknowledgement without info
  48. #define C2S_CONNECT 'k' // client requests to connect
  49. // Print to client console.
  50. #define A2A_PRINT 'l' // print a message on client
  51. // info request
  52. #define S2A_INFO_DETAILED 'm' // New Query protocol, returns dedicated or not, + other performance info.
  53. #define A2S_RESERVE 'n' // reserves this server for specific players for a short period of time. Fails if not empty.
  54. #define S2A_RESERVE_RESPONSE 'p' // server response to reservation request
  55. // Another user is requesting a challenge value from this machine
  56. // NOTE: this is currently duplicated in SteamClient.dll but for a different purpose,
  57. // so these can safely diverge anytime. SteamClient will be using a different protocol
  58. // to update the master servers anyway.
  59. #define A2S_GETCHALLENGE 'q' // Request challenge # from another machine
  60. #define A2S_RCON 'r' // client rcon command
  61. #define A2A_CUSTOM 't' // a custom command, follow by a string for 3rd party tools
  62. // A user is requesting the list of master servers, auth servers, and titan dir servers from the Client Master server
  63. #define A2M_GETMASTERSERVERS 'v' // + byte (type of request, TYPE_CLIENT_MASTER or TYPE_SERVER_MASTER)
  64. // Master server list response
  65. #define M2A_MASTERSERVERS 'w' // + byte type + 6 byte IP/Port List
  66. #define A2M_GETACTIVEMODS 'x' // + string Request to master to provide mod statistics ( current usage ). "1" for first mod.
  67. #define M2A_ACTIVEMODS 'y' // response: modname\r\nusers\r\nservers
  68. #define M2M_MSG 'z' // Master peering message
  69. // SERVER TO CLIENT/ANY
  70. // Client connection is initiated by requesting a challenge value
  71. // the server sends this value back
  72. #define S2C_CHALLENGE 'A' // + challenge value
  73. // Server notification to client to commence signon process using challenge value.
  74. #define S2C_CONNECTION 'B' // no params
  75. // Response to server info requests
  76. // Request for detailed server/rule information.
  77. #define S2A_INFO_GOLDSRC 'm' // Reserved for use by goldsrc servers
  78. #define S2M_GETFILE 'J' // request module from master
  79. #define M2S_SENDFILE 'K' // send module to server
  80. #define S2C_REDIRECT 'L' // + IP x.x.x.x:port, redirect client to other server/proxy
  81. #define C2M_CHECKMD5 'M' // player client asks secure master if Module MD5 is valid
  82. #define M2C_ISVALIDMD5 'N' // secure servers answer to C2M_CHECKMD5
  83. // MASTER TO SERVER
  84. #define M2A_ACTIVEMODS3 'P' // response: keyvalues struct of mods
  85. #define A2M_GETACTIVEMODS3 'Q' // get a list of mods and the stats about them
  86. #define S2A_LOGSTRING 'R' // send a log string
  87. #define S2A_LOGKEY 'S' // send a log event as key value
  88. #define S2A_LOGSTRING2 'S' // send a log string including a secret value << this clashes with S2A_LOGKEY that nothing seems to use in CS:GO and is followed by secret value so should be compatible for server ops with their existing tools
  89. #define A2S_SERVERQUERY_GETCHALLENGE 'W' // Request challenge # from another machine
  90. #define A2S_KEY_STRING "Source Engine Query" // required postfix to a A2S_INFO query
  91. #define A2M_GET_SERVERS_BATCH2 '1' // New style server query
  92. #define A2M_GETACTIVEMODS2 '2' // New style mod info query
  93. #define C2S_AUTHREQUEST1 '3' //
  94. #define S2C_AUTHCHALLENGE1 '4' //
  95. #define C2S_AUTHCHALLENGE2 '5' //
  96. #define S2C_AUTHCOMPLETE '6'
  97. #define C2S_AUTHCONNECT '7' // Unused, signals that the client has
  98. // authenticated the server
  99. #define C2S_VALIDATE_SESSION '8'
  100. // #define UNUSED_A2S_LANSEARCH 'C' // LAN game details searches
  101. // #define UNUSED_S2A_LANSEARCHREPLY 'F' // LAN game details reply
  102. #define S2C_CONNREJECT '9' // Special protocol for rejected connections.
  103. #define MAX_OOB_KEYVALUES 600 // max size in bytes for keyvalues included in an OOB msg
  104. #define MAKE_4BYTES( a, b, c, d ) ( ( ((unsigned char)(d)) << 24 ) | ( ((unsigned char)(c)) << 16 ) | ( ((unsigned char)(b)) << 8 ) | ( ((unsigned char)(a)) << 0 ) )
  105. #define A2A_KV_CMD '?' // generic KeyValues command [1 byte: version] [version dependent data...]
  106. #define A2A_KV_VERSION 1 // version of generic KeyValues command
  107. // [4 bytes: header] [4 bytes: replyid] [4 bytes: challenge] [4 bytes: extra] [4 bytes: numbytes] [numbytes: serialized KV]
  108. // These can be owned by Steam after we get rid of this legacy code.
  109. #define S2A_INFO_SRC 'I' // + Address, hostname, map, gamedir, gamedescription, active players, maxplayers, protocol
  110. #define S2M_HEARTBEAT 'a' // + challeange + sequence + active + #channels + channels
  111. #define S2M_HEARTBEAT2 '0' // New style heartbeat
  112. #define S2M_SHUTDOWN 'b' // no params
  113. #define M2A_CHALLENGE 's' // + challenge value
  114. #define M2S_REQUESTRESTART 'O' // HLMaster rejected a server's connection because the server needs to be updated
  115. #define A2S_RULES 'V' // request rules list from server
  116. #define S2A_RULES 'E' // + number of rules + string key and string value pairs
  117. #define A2S_INFO 'T' // server info request - this must match the Goldsrc engine
  118. #define S2A_PLAYER 'D' // + Playernum, name, frags, /*deaths*/, time on server
  119. #define A2S_PLAYER 'U' // request player list
  120. #define A2S_PING2 'Y' // new-style minimalist ping request
  121. #define S2A_PING2REPLY 'Z' // new-style minimalist ping reply
  122. // temp hack until we kill the legacy interface
  123. // The new S2A_INFO_SRC packet has a byte at the end that has these bits in it, telling
  124. // which data follows.
  125. #define S2A_EXTRA_DATA_HAS_GAME_PORT 0x80 // Next 2 bytes include the game port.
  126. #define S2A_EXTRA_DATA_HAS_SPECTATOR_DATA 0x40 // Next 2 bytes include the spectator port, then the spectator server name.
  127. #define S2A_EXTRA_DATA_HAS_GAMETAG_DATA 0x20 // Next bytes are the game tag string
  128. #define S2A_EXTRA_DATA_HAS_STEAMID 0x10 // Next 8 bytes are the steamID
  129. #define S2A_EXTRA_DATA_GAMEID 0x01 // Next 8 bytes are the gameID of the server
  130. #define A2S_RESERVE_CHECK '!' // check if server reservation cookie is same as the one we are holding
  131. #define S2A_RESERVE_CHECK_RESPONSE '%' // server response to reservation request
  132. #define A2S_PING '$'
  133. #define S2A_PING_RESPONSE '^'
  134. #endif