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
2.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef IGAMESERVERDATA_H
  8. #define IGAMESERVERDATA_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "interface.h"
  13. #include "netadr.h"
  14. typedef unsigned int ra_listener_id;
  15. const ra_listener_id INVALID_LISTENER_ID = 0xffffffff;
  16. //-----------------------------------------------------------------------------
  17. // Purpose: interface for the dedicated server UI to access the game server data
  18. // designed to be a simple data parsing interface so that the implementation
  19. // can be as similar to remote administration as possible
  20. //-----------------------------------------------------------------------------
  21. abstract_class IGameServerData : public IBaseInterface
  22. {
  23. public:
  24. // writes out a request
  25. virtual void WriteDataRequest( ra_listener_id listener, const void *buffer, int bufferSize) = 0;
  26. // returns the number of bytes read
  27. virtual int ReadDataResponse( ra_listener_id listener, void *buffer, int bufferSize) = 0;
  28. // get a handle to refer to this connection to the gameserver data interface
  29. // is authConnection is true the SERVERDATA_AUTH command needs to succeed before other commands
  30. virtual ra_listener_id GetNextListenerID( bool authConnection = true, const netadr_t *adr = NULL ) = 0;
  31. // tell the remote access class that this ID is the special dedicated server UI callback (and not an rcon one)
  32. virtual void RegisterAdminUIID( ra_listener_id listener ) = 0;
  33. };
  34. // enumerations for writing out the requests
  35. enum ServerDataRequestType_t
  36. {
  37. SERVERDATA_REQUESTVALUE,
  38. SERVERDATA_SETVALUE,
  39. SERVERDATA_EXECCOMMAND,
  40. SERVERDATA_AUTH, // special RCON command to authenticate a connection
  41. SERVERDATA_VPROF, // subscribe to a vprof stream
  42. SERVERDATA_REMOVE_VPROF, // unsubscribe from a vprof stream
  43. SERVERDATA_TAKE_SCREENSHOT,
  44. SERVERDATA_SEND_CONSOLE_LOG,
  45. SERVERDATA_SEND_REMOTEBUG,
  46. };
  47. enum ServerDataResponseType_t
  48. {
  49. SERVERDATA_RESPONSE_VALUE = 0,
  50. SERVERDATA_UPDATE,
  51. SERVERDATA_AUTH_RESPONSE,
  52. SERVERDATA_VPROF_DATA,
  53. SERVERDATA_VPROF_GROUPS,
  54. SERVERDATA_SCREENSHOT_RESPONSE,
  55. SERVERDATA_CONSOLE_LOG_RESPONSE,
  56. SERVERDATA_RESPONSE_STRING,
  57. SERVERDATA_RESPONSE_REMOTEBUG,
  58. };
  59. /* PACKET FORMAT
  60. REQUEST:
  61. int requestID;
  62. int ServerDataRequestType_t;
  63. NullTerminatedString (variable or command)
  64. NullTerminatedString (value)
  65. RESPONSE:
  66. int requestID;
  67. int ServerDataResponseType_t;
  68. NullTerminatedString (variable)
  69. NullTerminatedString (value)
  70. */
  71. #define GAMESERVERDATA_INTERFACE_VERSION "GameServerData001"
  72. #endif // IGAMESERVERDATA_H