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.

81 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef LANGAMES_H
  8. #define LANGAMES_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. class CLanBroadcastMsgHandler;
  13. //-----------------------------------------------------------------------------
  14. // Purpose: Favorite games list
  15. //-----------------------------------------------------------------------------
  16. class CLanGames : public CBaseGamesPage
  17. {
  18. DECLARE_CLASS_SIMPLE( CLanGames, CBaseGamesPage );
  19. public:
  20. CLanGames(vgui::Panel *parent, bool bAutoRefresh=true, const char *pCustomResFilename=NULL);
  21. ~CLanGames();
  22. // property page handlers
  23. virtual void OnPageShow();
  24. // IGameList handlers
  25. // returns true if the game list supports the specified ui elements
  26. virtual bool SupportsItem(InterfaceItem_e item);
  27. // Control which button are visible.
  28. void ManualShowButtons( bool bShowConnect, bool bShowRefreshAll, bool bShowFilter );
  29. // If you pass NULL for pSpecificAddresses, it will broadcast on certain points.
  30. // If you pass a non-null value, then it will send info queries directly to those ports.
  31. void InternalGetNewServerList( CUtlVector<netadr_t> *pSpecificAddresses );
  32. virtual void StartRefresh();
  33. // stops current refresh/GetNewServerList()
  34. virtual void StopRefresh();
  35. // IServerRefreshResponse handlers
  36. // called when a server response has timed out
  37. virtual void ServerFailedToRespond( HServerListRequest hReq, int iServer );
  38. // called when the current refresh list is complete
  39. virtual void RefreshComplete( HServerListRequest hReq, EMatchMakingServerResponse response );
  40. // Tell the game list what to put in there when there are no games found.
  41. virtual void SetEmptyListText();
  42. private:
  43. // vgui message handlers
  44. virtual void OnTick();
  45. // lan timeout checking
  46. virtual void CheckRetryRequest();
  47. // context menu message handlers
  48. MESSAGE_FUNC_INT( OnOpenContextMenu, "OpenContextMenu", itemID );
  49. // number of servers refreshed
  50. int m_iServerRefreshCount;
  51. // true if we're broadcasting for servers
  52. bool m_bRequesting;
  53. // time at which we last broadcasted
  54. double m_fRequestTime;
  55. bool m_bAutoRefresh;
  56. };
  57. #endif // LANGAMES_H