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.

69 lines
2.0 KiB

  1. //========= Copyright � 1996-2001, Valve LLC, All rights reserved. ============
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef SERVERBROWSER_H
  8. #define SERVERBROWSER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. class CServerBrowserDialog;
  13. //-----------------------------------------------------------------------------
  14. // Purpose: Handles the UI and pinging of a half-life game server list
  15. //-----------------------------------------------------------------------------
  16. class CServerBrowser : public IServerBrowser, public IVGuiModule
  17. {
  18. public:
  19. CServerBrowser();
  20. ~CServerBrowser();
  21. // IVGui module implementation
  22. virtual bool Initialize(CreateInterfaceFn *factorylist, int numFactories);
  23. virtual bool PostInitialize(CreateInterfaceFn *modules, int factoryCount);
  24. virtual vgui::VPANEL GetPanel();
  25. virtual bool Activate();
  26. virtual bool IsValid();
  27. virtual void Shutdown();
  28. virtual void Deactivate();
  29. virtual void Reactivate();
  30. virtual void SetParent(vgui::VPANEL parent);
  31. // IServerBrowser implementation
  32. // joins a specified game - game info dialog will only be opened if the server is fully or passworded
  33. virtual bool JoinGame( uint32 unGameIP, uint16 usGamePort );
  34. virtual bool JoinGame( uint64 ulSteamIDFriend );
  35. // opens a game info dialog to watch the specified server; associated with the friend 'userName'
  36. virtual bool OpenGameInfoDialog( uint64 ulSteamIDFriend );
  37. // forces the game info dialog closed
  38. virtual void CloseGameInfoDialog( uint64 ulSteamIDFriend );
  39. // closes all the game info dialogs
  40. virtual void CloseAllGameInfoDialogs();
  41. // methods
  42. virtual void CreateDialog();
  43. virtual void Open();
  44. // true if the user can't play a game
  45. bool IsVACBannedFromGame( int nAppID );
  46. private:
  47. vgui::DHANDLE<CServerBrowserDialog> m_hInternetDlg;
  48. };
  49. // singleton accessor
  50. CServerBrowser &ServerBrowser();
  51. class CSteamAPIContext;
  52. extern CSteamAPIContext *steamapicontext;
  53. #endif // SERVERBROWSER_H