Team Fortress 2 Source Code as on 22/4/2020
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.

64 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: interface to the game coordinator for this application
  4. //
  5. //=============================================================================
  6. #ifndef ISTEAMGAMECOORDINATOR
  7. #define ISTEAMGAMECOORDINATOR
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "steam/steamtypes.h"
  12. #include "steam/steamclientpublic.h"
  13. #include "steam/isteamclient.h"
  14. // list of possible return values from the ISteamGameCoordinator API
  15. enum EGCResults
  16. {
  17. k_EGCResultOK = 0,
  18. k_EGCResultNoMessage = 1, // There is no message in the queue
  19. k_EGCResultBufferTooSmall = 2, // The buffer is too small for the requested message
  20. k_EGCResultNotLoggedOn = 3, // The client is not logged onto Steam
  21. k_EGCResultInvalidMessage = 4, // Something was wrong with the message being sent with SendMessage
  22. };
  23. //-----------------------------------------------------------------------------
  24. // Purpose: Functions for sending and receiving messages from the Game Coordinator
  25. // for this application
  26. //-----------------------------------------------------------------------------
  27. class ISteamGameCoordinator
  28. {
  29. public:
  30. // sends a message to the Game Coordinator
  31. virtual EGCResults SendMessage( uint32 unMsgType, const void *pubData, uint32 cubData ) = 0;
  32. // returns true if there is a message waiting from the game coordinator
  33. virtual bool IsMessageAvailable( uint32 *pcubMsgSize ) = 0;
  34. // fills the provided buffer with the first message in the queue and returns k_EGCResultOK or
  35. // returns k_EGCResultNoMessage if there is no message waiting. pcubMsgSize is filled with the message size.
  36. // If the provided buffer is not large enough to fit the entire message, k_EGCResultBufferTooSmall is returned
  37. // and the message remains at the head of the queue.
  38. virtual EGCResults RetrieveMessage( uint32 *punMsgType, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0;
  39. };
  40. #define STEAMGAMECOORDINATOR_INTERFACE_VERSION "SteamGameCoordinator001"
  41. // callback notification - A new message is available for reading from the message queue
  42. struct GCMessageAvailable_t
  43. {
  44. enum { k_iCallback = k_iSteamGameCoordinatorCallbacks + 1 };
  45. uint32 m_nMessageSize;
  46. };
  47. // callback notification - A message failed to make it to the GC. It may be down temporarily
  48. struct GCMessageFailed_t
  49. {
  50. enum { k_iCallback = k_iSteamGameCoordinatorCallbacks + 2 };
  51. };
  52. #endif // ISTEAMGAMECOORDINATOR