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.

86 lines
1.9 KiB

  1. //===== Copyright � 1996-2009, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef MM_SESSION_OFFLINE_CUSTOM_H
  7. #define MM_SESSION_OFFLINE_CUSTOM_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. //
  12. // CMatchSessionOfflineCustom
  13. //
  14. // Implementation of an offline session
  15. // that allows customization before the actual
  16. // game commences (like playing commentary mode
  17. // or playing single-player)
  18. //
  19. class CMatchSessionOfflineCustom : public IMatchSessionInternal
  20. {
  21. // Methods of IMatchSession
  22. public:
  23. // Get an internal pointer to session system-specific data
  24. virtual KeyValues * GetSessionSystemData() { return NULL; }
  25. // Get an internal pointer to session settings
  26. virtual KeyValues * GetSessionSettings();
  27. // Update session settings, only changing keys and values need
  28. // to be passed and they will be updated
  29. virtual void UpdateSessionSettings( KeyValues *pSettings );
  30. virtual void UpdateTeamProperties( KeyValues *pTeamProperties );
  31. virtual uint64 GetSessionID();
  32. // Issue a session command
  33. virtual void Command( KeyValues *pCommand );
  34. // Run a frame update
  35. virtual void Update();
  36. // Destroy the session object
  37. virtual void Destroy();
  38. // Debug print a session object
  39. virtual void DebugPrint();
  40. // Check if another session is joinable
  41. virtual bool IsAnotherSessionJoinable( char const *pszAnotherSessionInfo ) { return true; }
  42. // Process event
  43. virtual void OnEvent( KeyValues *pEvent );
  44. public:
  45. explicit CMatchSessionOfflineCustom( KeyValues *pSettings );
  46. ~CMatchSessionOfflineCustom();
  47. protected:
  48. void InitializeGameSettings();
  49. //
  50. // Overrides
  51. //
  52. protected:
  53. void OnGamePrepareLobbyForGame();
  54. protected:
  55. KeyValues *m_pSettings;
  56. KeyValues::AutoDelete m_autodelete_pSettings;
  57. enum State_t
  58. {
  59. STATE_INIT,
  60. STATE_CONFIG,
  61. STATE_RUNNING
  62. };
  63. State_t m_eState;
  64. bool m_bExpectingServerReload;
  65. };
  66. #endif