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.

88 lines
2.3 KiB

  1. //===== Copyright 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // Purpose: Defines a group of app systems that all have the same lifetime
  6. // that need to be connected/initialized, etc. in a well-defined order
  7. //
  8. // $NoKeywords: $
  9. //
  10. //===========================================================================//
  11. #ifndef DEDICATED_H
  12. #define DEDICATED_H
  13. #ifdef _WIN32
  14. #pragma once
  15. #endif
  16. #include "appframework/tier3app.h"
  17. //-----------------------------------------------------------------------------
  18. // Forward declarations
  19. //-----------------------------------------------------------------------------
  20. class IDedicatedServerAPI;
  21. //-----------------------------------------------------------------------------
  22. // Singleton interfaces
  23. //-----------------------------------------------------------------------------
  24. extern IDedicatedServerAPI *engine;
  25. //-----------------------------------------------------------------------------
  26. // Inner loop: initialize, shutdown main systems, load steam to
  27. //-----------------------------------------------------------------------------
  28. #ifdef POSIX
  29. #define DEDICATED_BASECLASS CTier2SteamApp
  30. #else
  31. #define DEDICATED_BASECLASS CVguiSteamApp
  32. #endif
  33. class CDedicatedAppSystemGroup : public DEDICATED_BASECLASS
  34. {
  35. typedef DEDICATED_BASECLASS BaseClass;
  36. public:
  37. // Methods of IApplication
  38. virtual bool Create( );
  39. virtual bool PreInit( );
  40. virtual int Main( );
  41. virtual void PostShutdown();
  42. virtual void Destroy();
  43. // Used to chain to base class
  44. AppModule_t LoadModule( CreateInterfaceFn factory )
  45. {
  46. return CSteamAppSystemGroup::LoadModule( factory );
  47. }
  48. // Method to add various global singleton systems
  49. bool AddSystems( AppSystemInfo_t *pSystems )
  50. {
  51. return CSteamAppSystemGroup::AddSystems( pSystems );
  52. }
  53. void *FindSystem( const char *pInterfaceName )
  54. {
  55. return CSteamAppSystemGroup::FindSystem( pInterfaceName );
  56. }
  57. };
  58. // main server entry point after init
  59. void RunServer( bool bSupressStdIOBecauseWeAreAForkedChild );
  60. #ifdef _LINUX
  61. void RunServerSubProcesses( int nNumChildInstances );
  62. #endif
  63. // modify the command line, replacing all occurrences of ## with nIndex
  64. void PerformCommandLineSubstitutions( int nIndex );
  65. // forked subprocess index. 0 for master or not forked mode
  66. extern int g_nSubProcessId;
  67. #endif // DEDICATED_H