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.

53 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef ENGINE_HLDS_API_H
  7. #define ENGINE_HLDS_API_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "interface.h"
  12. #include "appframework/IAppSystem.h"
  13. #define VENGINE_HLDS_API_VERSION "VENGINE_HLDS_API_VERSION002"
  14. struct ModInfo_t
  15. {
  16. void *m_pInstance;
  17. const char *m_pBaseDirectory; // Executable directory ("c:/program files/half-life 2", for example)
  18. const char *m_pInitialMod; // Mod name ("cstrike", for example)
  19. const char *m_pInitialGame; // Root game name ("hl2", for example, in the case of cstrike)
  20. CAppSystemGroup *m_pParentAppSystemGroup;
  21. bool m_bTextMode;
  22. };
  23. //-----------------------------------------------------------------------------
  24. // Purpose: This is the interface exported by the engine.dll to allow a dedicated server front end
  25. // application to host it.
  26. //-----------------------------------------------------------------------------
  27. class IDedicatedServerAPI : public IAppSystem
  28. {
  29. // Functions
  30. public:
  31. // Initialize the engine with the specified base directory and interface factories
  32. virtual bool ModInit( ModInfo_t &info ) = 0;
  33. // Shutdown the engine
  34. virtual void ModShutdown( void ) = 0;
  35. // Run a frame
  36. virtual bool RunFrame( void ) = 0;
  37. // Insert text into console
  38. virtual void AddConsoleText( char *text ) = 0;
  39. // Get current status to display in the hlds UI (console window title bar, e.g. )
  40. virtual void UpdateStatus(float *fps, int *nActive, int *nMaxPlayers, char *pszMap, int maxlen ) = 0;
  41. // Get current Hostname to display in the hlds UI (console window title bar, e.g. )
  42. virtual void UpdateHostname(char *pszHostname, int maxlen) = 0;
  43. };
  44. #endif // ENGINE_HLDS_API_H