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.

57 lines
1.9 KiB

  1. //========= Copyright � 1996-2005, 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. // for the multi-processed fork() server, set the server instance number (1..)
  44. virtual void SetSubProcessID( int nID, int nSocketHandle ) = 0;
  45. };
  46. #endif // ENGINE_HLDS_API_H