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.

57 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef ISERVERBROWSER_H
  8. #define ISERVERBROWSER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "interface.h"
  13. //-----------------------------------------------------------------------------
  14. // Purpose: Interface to server browser module
  15. //-----------------------------------------------------------------------------
  16. abstract_class IServerBrowser
  17. {
  18. public:
  19. // activates the server browser window, brings it to the foreground
  20. virtual bool Activate() = 0;
  21. // joins a game directly
  22. virtual bool JoinGame( uint32 unGameIP, uint16 usGamePort, const char *pszConnectCode ) = 0;
  23. // joins a specified game - game info dialog will only be opened if the server is fully or passworded
  24. virtual bool JoinGame( uint64 ulSteamIDFriend, const char *pszConnectCode ) = 0;
  25. // opens a game info dialog to watch the specified server; associated with the friend 'userName'
  26. virtual bool OpenGameInfoDialog( uint64 ulSteamIDFriend, const char *pszConnectCode ) = 0;
  27. // forces the game info dialog closed
  28. virtual void CloseGameInfoDialog( uint64 ulSteamIDFriend ) = 0;
  29. // closes all the game info dialogs
  30. virtual void CloseAllGameInfoDialogs() = 0;
  31. /// Given a map name, strips off some stuff and returns the "friendly" name of the map.
  32. /// Returns the cleaned out map name into the caller's buffer, and returns the friendly
  33. /// game type name.
  34. virtual const char *GetMapFriendlyNameAndGameType( const char *pszMapName, char *szFriendlyMapName, int cchFriendlyName ) = 0;
  35. // Enable filtering of workshop maps, requires the game/tool loading us to feed subscription data. This is a
  36. // slightly ugly workaround to TF2 not yet having native workshop UI in quickplay, once that is in place this should
  37. // either be stripped back out or expanded to be directly aware of the steam workshop without being managed.
  38. virtual void SetWorkshopEnabled( bool bManaged ) = 0;
  39. virtual void AddWorkshopSubscribedMap( const char *pszMapName ) = 0;
  40. virtual void RemoveWorkshopSubscribedMap( const char *pszMapName ) = 0;
  41. };
  42. #define SERVERBROWSER_INTERFACE_VERSION "ServerBrowser005"
  43. #endif // ISERVERBROWSER_H