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.

69 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef IGAMELIST_H
  8. #define IGAMELIST_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. struct serveritem_t;
  13. #include "FindSteamServers.h"
  14. #define EMPTY_SERVER_NAME "0.0.0.0:0"
  15. //-----------------------------------------------------------------------------
  16. // Purpose: Interface to accessing a game list
  17. //-----------------------------------------------------------------------------
  18. class IGameList
  19. {
  20. public:
  21. enum InterfaceItem_e
  22. {
  23. FILTERS,
  24. GETNEWLIST,
  25. ADDSERVER,
  26. ADDCURRENTSERVER,
  27. };
  28. // returns true if the game list supports the specified ui elements
  29. virtual bool SupportsItem(InterfaceItem_e item) = 0;
  30. // starts the servers refreshing
  31. virtual void StartRefresh() = 0;
  32. // gets a new server list
  33. virtual void GetNewServerList() = 0;
  34. // stops current refresh/GetNewServerList()
  35. virtual void StopRefresh() = 0;
  36. // returns true if the list is currently refreshing servers
  37. virtual bool IsRefreshing() = 0;
  38. // gets information about specified server
  39. virtual serveritem_t &GetServer(unsigned int serverID) = 0;
  40. // adds a new server to list
  41. virtual void AddNewServer(serveritem_t &server) = 0;
  42. // marks that server list has been fully received
  43. virtual void ListReceived(bool moreAvailable, const char *lastUniqueIP, ESteamServerType serverType) = 0;
  44. // called when Connect button is pressed
  45. virtual void OnBeginConnect() = 0;
  46. // reapplies filters
  47. virtual void ApplyFilters() = 0;
  48. // invalid server index
  49. virtual int GetInvalidServerListID() = 0;
  50. };
  51. #endif // IGAMELIST_H